diff --git a/Scenarios/AzSHCI Deployment/LabConfig.ps1 b/Scenarios/AzSHCI Deployment/LabConfig.ps1 index 0a6ec6a6..4529d059 100644 --- a/Scenarios/AzSHCI Deployment/LabConfig.ps1 +++ b/Scenarios/AzSHCI Deployment/LabConfig.ps1 @@ -4,5 +4,10 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!' ; <#Prefix = #Or with nested virtualization enabled #1..4 | ForEach-Object {$LABConfig.VMs += @{ VMName = "AzSHCI$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI20H2_G2.vhdx' ; HDDNumber = 10 ; HDDSize= 10TB ; MemoryStartupBytes= 4GB; VMProcessorCount="Max" ; NestedVirt=$true}} +#or Azure Stack HCI 21H2 +1..4 | ForEach-Object {$LABConfig.VMs += @{ VMName = "AzSHCI$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI21H2_G2.vhdx' ; HDDNumber = 10 ; HDDSize= 10TB ; MemoryStartupBytes= 1GB; VMProcessorCount="Max" ; vTPM=$true}} +#Or with nested virtualization enabled +#1..4 | ForEach-Object {$LABConfig.VMs += @{ VMName = "AzSHCI$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI21H2_G2.vhdx' ; HDDNumber = 10 ; HDDSize= 10TB ; MemoryStartupBytes= 4GB; VMProcessorCount="Max" ; vTPM=$true ; NestedVirt=$true}} + #Optional Windows Admin Center in GW mode $LabConfig.VMs += @{ VMName = 'WACGW' ; ParentVHD = 'Win2019Core_G2.vhdx'; MGMTNICs=1} \ No newline at end of file diff --git a/Scenarios/AzSHCI Deployment/Scenario.ps1 b/Scenarios/AzSHCI Deployment/Scenario.ps1 index 2a9e9685..0d5750a6 100644 --- a/Scenarios/AzSHCI Deployment/Scenario.ps1 +++ b/Scenarios/AzSHCI Deployment/Scenario.ps1 @@ -798,38 +798,6 @@ start-sleep 10 #endregion -#region Create some VMs (3 per each CSV disk) https://github.com/Microsoft/WSLab/tree/master/Scenarios/S2D%20and%20Bulk%20VM%20creation - Start-Sleep -Seconds 60 #just to a bit wait as I saw sometimes that first VMs fails to create - if ($realVMs -and $VHDPath){ - $CSVs=(Get-ClusterSharedVolume -Cluster $ClusterName).Name - foreach ($CSV in $CSVs){ - $CSV=($CSV -split '\((.*?)\)')[1] - 1..$NumberOfRealVMs | ForEach-Object { - $VMName="TestVM$($CSV)_$_" - New-Item -Path "\\$ClusterName\ClusterStorage$\$CSV\$VMName\Virtual Hard Disks" -ItemType Directory - Copy-Item -Path $VHDPath -Destination "\\$ClusterName\ClusterStorage$\$CSV\$VMName\Virtual Hard Disks\$VMName.vhdx" - New-VM -Name $VMName -MemoryStartupBytes 512MB -Generation 2 -Path "c:\ClusterStorage\$CSV\" -VHDPath "c:\ClusterStorage\$CSV\$VMName\Virtual Hard Disks\$VMName.vhdx" -CimSession ((Get-ClusterNode -Cluster $ClusterName).Name | Get-Random) - Add-ClusterVirtualMachineRole -VMName $VMName -Cluster $ClusterName - } - } - #Start all VMs - Start-VM -VMname * -CimSession (Get-ClusterNode -Cluster $clustername).Name - }else{ - $CSVs=(Get-ClusterSharedVolume -Cluster $ClusterName).Name - foreach ($CSV in $CSVs){ - $CSV=($CSV -split '\((.*?)\)')[1] - 1..3 | ForEach-Object { - $VMName="TestVM$($CSV)_$_" - Invoke-Command -ComputerName ((Get-ClusterNode -Cluster $ClusterName).Name | Get-Random) -ArgumentList $CSV,$VMName -ScriptBlock { - #create some fake VMs - New-VM -Name $using:VMName -NewVHDPath "c:\ClusterStorage\$($using:CSV)\$($using:VMName)\Virtual Hard Disks\$($using:VMName).vhdx" -NewVHDSizeBytes 32GB -SwitchName $using:vSwitchName -Generation 2 -Path "c:\ClusterStorage\$($using:CSV)\" -MemoryStartupBytes 32MB - } - Add-ClusterVirtualMachineRole -VMName $VMName -Cluster $ClusterName - } - } - } -#endregion - #region Register Azure Stack HCI to Azure #download Azure module Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force @@ -898,6 +866,38 @@ #> #endregion +#region Create some VMs (3 per each CSV disk) https://github.com/Microsoft/WSLab/tree/master/Scenarios/S2D%20and%20Bulk%20VM%20creation + Start-Sleep -Seconds 60 #just to a bit wait as I saw sometimes that first VMs fails to create + if ($realVMs -and $VHDPath){ + $CSVs=(Get-ClusterSharedVolume -Cluster $ClusterName).Name + foreach ($CSV in $CSVs){ + $CSV=($CSV -split '\((.*?)\)')[1] + 1..$NumberOfRealVMs | ForEach-Object { + $VMName="TestVM$($CSV)_$_" + New-Item -Path "\\$ClusterName\ClusterStorage$\$CSV\$VMName\Virtual Hard Disks" -ItemType Directory + Copy-Item -Path $VHDPath -Destination "\\$ClusterName\ClusterStorage$\$CSV\$VMName\Virtual Hard Disks\$VMName.vhdx" + New-VM -Name $VMName -MemoryStartupBytes 512MB -Generation 2 -Path "c:\ClusterStorage\$CSV\" -VHDPath "c:\ClusterStorage\$CSV\$VMName\Virtual Hard Disks\$VMName.vhdx" -CimSession ((Get-ClusterNode -Cluster $ClusterName).Name | Get-Random) + Add-ClusterVirtualMachineRole -VMName $VMName -Cluster $ClusterName + } + } + #Start all VMs + Start-VM -VMname * -CimSession (Get-ClusterNode -Cluster $clustername).Name + }else{ + $CSVs=(Get-ClusterSharedVolume -Cluster $ClusterName).Name + foreach ($CSV in $CSVs){ + $CSV=($CSV -split '\((.*?)\)')[1] + 1..3 | ForEach-Object { + $VMName="TestVM$($CSV)_$_" + Invoke-Command -ComputerName ((Get-ClusterNode -Cluster $ClusterName).Name | Get-Random) -ArgumentList $CSV,$VMName -ScriptBlock { + #create some fake VMs + New-VM -Name $using:VMName -NewVHDPath "c:\ClusterStorage\$($using:CSV)\$($using:VMName)\Virtual Hard Disks\$($using:VMName).vhdx" -NewVHDSizeBytes 32GB -SwitchName $using:vSwitchName -Generation 2 -Path "c:\ClusterStorage\$($using:CSV)\" -MemoryStartupBytes 32MB + } + Add-ClusterVirtualMachineRole -VMName $VMName -Cluster $ClusterName + } + } + } +#endregion + #region (optional) Install Windows Admin Center Gateway https://github.com/microsoft/WSLab/tree/master/Scenarios/Windows%20Admin%20Center%20and%20Enterprise%20CA#gw-mode-installation-with-self-signed-cert ##Install Windows Admin Center Gateway $GatewayServerName="WACGW" diff --git a/Scripts/LabConfig.ps1 b/Scripts/LabConfig.ps1 index 90fbcbc9..e5b70674 100644 --- a/Scripts/LabConfig.ps1 +++ b/Scripts/LabConfig.ps1 @@ -5,8 +5,8 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M 1..4 | ForEach-Object {$VMNames="S2D"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2019Core_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 512MB }} # Or Azure Stack HCI #1..4 | ForEach-Object {$VMNames="AzSHCI"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI20H2_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 1GB }} -# Or Windows Server Insider Preview -#1..4 | ForEach-Object {$VMNames="S2D"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'WinSrvInsiderCore_20282.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 512MB }} +# Or Windows Server 2022 +#1..4 | ForEach-Object {$VMNames="S2D"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2022Core_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 512MB }} ### HELP ### diff --git a/Tools/CreateParentDisk.ps1 b/Tools/CreateParentDisk.ps1 index ee9f73c0..a9686b78 100644 --- a/Tools/CreateParentDisk.ps1 +++ b/Tools/CreateParentDisk.ps1 @@ -157,6 +157,9 @@ If (-not $isAdmin) { $tempvhdname = switch ($BuildNumber){ 17784 { "AzSHCI20H2_G2.vhdx" + } + 20348 { + "AzSHCI21H2_G2.vhdx" } } }elseif (($Edition -like "*Server*Core*") -or ($Edition -like "Windows Server * Datacenter") -or ($Edition -like "Windows Server * Standard")){ @@ -287,8 +290,11 @@ If (-not $isAdmin) { 19041 { "Win1020H1_G2.vhdx" } + 22000 { + "Win1121H2_G2.vhdx" + } } - if ($BuildNumber -GT 19041){ + if ($BuildNumber -GT 22000){ $tempvhdname="Win10Insider_$BuildNumber.vhdx" } }