From bda322dd9384c54abab6e84a1bfd8bc4b919032f Mon Sep 17 00:00:00 2001 From: Jan Egil Ring Date: Fri, 16 Aug 2024 03:19:00 +0200 Subject: [PATCH] Moved DSC configuration for Hyper-V (#2675) * Moved DSC configuration for Hyper-V and VM Switch from Common to DataOps and ITPro Signed-off-by: Jan Egil Ring * Updated Hyper-V DSC for ITPro and DevOps Signed-off-by: Jan Egil Ring * Do not install Hyper-V if flavor is DevOps Signed-off-by: Jan Egil Ring --------- Signed-off-by: Jan Egil Ring --- .../artifacts/Bootstrap.ps1 | 4 +++ .../artifacts/dsc/common.dsc.yml | 31 ------------------ .../artifacts/dsc/dataops.dsc.yml | 32 ++++++++++++++++++- .../artifacts/dsc/devops.dsc.yml | 1 - .../artifacts/dsc/itpro.dsc.yml | 31 ++++++++++++++++++ 5 files changed, 66 insertions(+), 33 deletions(-) diff --git a/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 b/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 index 3cb2ce8721..02a44c593f 100644 --- a/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 +++ b/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 @@ -429,6 +429,8 @@ else { # Disabling Windows Server Manager Scheduled Task Get-ScheduledTask -TaskName ServerManager | Disable-ScheduledTask + if ($flavor -eq "ITPro") { + Write-Header "Installing Hyper-V" # Install Hyper-V and reboot @@ -437,6 +439,8 @@ else { Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart Install-WindowsFeature -Name Hyper-V -IncludeAllSubFeature -IncludeManagementTools -Restart + } + # Clean up Bootstrap.log Write-Host "Clean up Bootstrap.log" Stop-Transcript diff --git a/azure_jumpstart_arcbox/artifacts/dsc/common.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/common.dsc.yml index c644df8520..cbae2a56bb 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/common.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/common.dsc.yml @@ -86,35 +86,4 @@ properties: settings: FontName: Cascadia Mono FontFile: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.18.3181.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf - - resource: PSDscResources/WindowsFeature - id: Hyper-V - directives: - description: Install Hyper-V - settings: - Name: Hyper-V - Ensure: Present - - resource: HyperVDsc/VMHost - id: VMHost - directives: - description: Configure VM Host settings - settings: - IsSingleInstance: Yes - EnableEnhancedSessionMode: True - - resource: HyperVDsc/VMSwitch - id: VMSwitch - directives: - description: Configure VM Switch - settings: - Name: InternalNATSwitch - Ensure: Present - Type: Internal - - resource: NetworkingDsc/IPAddress - id: IPAddress.VMSwitch - directives: - description: Configure VM Switch vNIC IP Address - settings: - InterfaceAlias: 'vEthernet (InternalNATSwitch)' - IPAddress: '10.10.1.1/24' - AddressFamily: IPv4 - KeepExistingAddress: false configurationVersion: 0.2.0 \ No newline at end of file diff --git a/azure_jumpstart_arcbox/artifacts/dsc/dataops.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/dataops.dsc.yml index 722865abe4..b7f8a8f193 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/dataops.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/dataops.dsc.yml @@ -58,5 +58,35 @@ properties: settings: id: Istio.Istio source: winget - + - resource: PSDscResources/WindowsFeature + id: Hyper-V + directives: + description: Install Hyper-V + settings: + Name: Hyper-V + Ensure: Present + - resource: HyperVDsc/VMHost + id: VMHost + directives: + description: Configure VM Host settings + settings: + IsSingleInstance: Yes + EnableEnhancedSessionMode: True + - resource: HyperVDsc/VMSwitch + id: VMSwitch + directives: + description: Configure VM Switch + settings: + Name: InternalNATSwitch + Ensure: Present + Type: Internal + - resource: NetworkingDsc/IPAddress + id: IPAddress.VMSwitch + directives: + description: Configure VM Switch vNIC IP Address + settings: + InterfaceAlias: 'vEthernet (InternalNATSwitch)' + IPAddress: '10.10.1.1/24' + AddressFamily: IPv4 + KeepExistingAddress: false configurationVersion: 0.2.0 \ No newline at end of file diff --git a/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml index d77cb4f582..9a79565f0d 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml @@ -37,5 +37,4 @@ properties: settings: id: Istio.Istio source: winget - configurationVersion: 0.2.0 \ No newline at end of file diff --git a/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml index 2e7b256e31..616c6d817e 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml @@ -9,4 +9,35 @@ properties: settings: id: 7zip.7zip source: winget + - resource: PSDscResources/WindowsFeature + id: Hyper-V + directives: + description: Install Hyper-V + settings: + Name: Hyper-V + Ensure: Present + - resource: HyperVDsc/VMHost + id: VMHost + directives: + description: Configure VM Host settings + settings: + IsSingleInstance: Yes + EnableEnhancedSessionMode: True + - resource: HyperVDsc/VMSwitch + id: VMSwitch + directives: + description: Configure VM Switch + settings: + Name: InternalNATSwitch + Ensure: Present + Type: Internal + - resource: NetworkingDsc/IPAddress + id: IPAddress.VMSwitch + directives: + description: Configure VM Switch vNIC IP Address + settings: + InterfaceAlias: 'vEthernet (InternalNATSwitch)' + IPAddress: '10.10.1.1/24' + AddressFamily: IPv4 + KeepExistingAddress: false configurationVersion: 0.2.0 \ No newline at end of file