1- # basic config for Windows Server 2019 , that creates VMs for S2D Hyperconverged scenario https://github.com/Microsoft/MSLab/tree/master/Scenarios/S2D%20Hyperconverged
1+ # basic config for Windows Server 2022 , that creates VMs for S2D Hyperconverged scenario https://github.com/Microsoft/MSLab/tree/master/Scenarios/S2D%20Hyperconverged
22
33$LabConfig = @ { DomainAdminName = ' LabAdmin' ; AdminPassword = ' LS1setup!' ; Prefix = ' MSLab-' ; DCEdition = ' 4' ; Internet = $true ; AdditionalNetworksConfig = @ (); VMs = @ ()}
44# Windows Server 2022
551 .. 4 | ForEach-Object {$VMNames = " S2D" ; $LABConfig.VMs += @ { VMName = " $VMNames $_ " ; Configuration = ' S2D' ; ParentVHD = ' Win2022Core_G2.vhdx' ; SSDNumber = 0 ; SSDSize = 800 GB ; HDDNumber = 12 ; HDDSize = 4 TB ; MemoryStartupBytes = 512 MB }}
6- # Or Azure Stack HCI 2090
7- # 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 }}
6+ # Or Azure Stack HCI 21H2
7+ # 1..4 | ForEach-Object {$VMNames="AzSHCI"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI21H2_G2 .vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 1GB }}
88# Or Windows Server 2019
99# 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 }}
1010
@@ -19,7 +19,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M
1919 AdminPassword="LS1setup!"; # Used during 2_CreateParentDisks. If changed after, it will break the functionality of 3_Deploy.ps1
2020 Prefix = "MSLab-"; # (Optional) All VMs and vSwitch are created with this prefix, so you can identify the lab. If not specified, Lab folder name is used
2121 SwitchName = "LabSwitch"; # (Optional) Name of vSwitch
22- SwitchNICs = "NIC1","NIC2" ; # (Optional) Adds these NICs to vSwitch (without connecting hostOS).
22+ SwitchNICs = "" ; # (Optional) Adds these NICs to vSwitch (without connecting hostOS). (example "NIC1","NIC2")
2323 SecureBoot=$true; # (Optional) Useful when testing unsigned builds (Useful for MS developers for daily builds)
2424 DCEdition="4"; # 4 for DataCenter or 3 for DataCenterCore
2525 InstallSCVMM="No"; # (Optional) Yes/Prereqs/SQL/ADK/No
@@ -53,7 +53,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M
5353 }
5454
5555 # Specifying LabVMs
56- 1..4 | % {
56+ 1..4 | ForEach-Object {
5757 $VMNames="S2D"; # Here you can bulk edit name of 4 VMs created. In this case will be s2d1,s2d2,s2d3,s2d4 created
5858 $LABConfig.VMs += @{
5959 VMName = "$VMNames$_" ;
@@ -226,7 +226,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M
226226 Single:
227227 $LABConfig.VMs += @{ VMName = 'Management' ; Configuration = 'Simple' ; ParentVHD = 'Win10_G2.vhdx' ; MemoryStartupBytes= 1GB ; AddToolsVHD=$True }
228228 Multiple:
229- 1..2 | % { $VMNames="Replica" ; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'Replica' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; ReplicaHDDSize = 20GB ; ReplicaLogSize = 10GB ; MemoryStartupBytes= 2GB ; VMSet= 'ReplicaSet1' ; AdditionalNetworks = $True} }
229+ 1..2 | ForEach-Object { $VMNames="Replica" ; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'Replica' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; ReplicaHDDSize = 20GB ; ReplicaLogSize = 10GB ; MemoryStartupBytes= 2GB ; VMSet= 'ReplicaSet1' ; AdditionalNetworks = $True} }
230230
231231 VMName (Mandatory)
232232 Can be whatever. This name will be used as name to djoin VM.
@@ -258,7 +258,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M
258258 @{
259259 IpAddress (Mandatory) - Static IP Address that would be injected to the OS
260260 Subnet (Mandatory)
261- }
261+ }
262262 }
263263
264264 DSCMode (Optional)
@@ -305,7 +305,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M
305305 SkipDjoin (Optional,Deprecated)
306306 If $True, VM will not be djoined. Default unattend used.
307307 Note: you might want to use AdditionalLocalAdmin variable with Windows 10 as local administrator account is by default disabled there.
308-
308+
309309 Win2012Djoin (Optional,Deprecated)
310310 If $True, older way to domain join will be used (Username and Password in Answer File instead of blob) as Djoin Blob works only in Win 2016
311311
@@ -381,15 +381,15 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M
381381 )
382382
383383 or you can use this to deploy 100 simple VMs with name NanoServer1, NanoServer2...
384- 1..100 | % {"NanoServer$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
384+ 1..100 | ForEach-Object {"NanoServer$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
385385
386386 or you can use this to deploy 100 server VMs with 1 Client OS with name Windows10
387- 1..100 | % {"NanoServer$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
387+ 1..100 | ForEach-Object {"NanoServer$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
388388 $LabConfig.VMs += @{ VMName = 'Windows10' ; Configuration = 'Simple' ; ParentVHD = 'Win10_G2.vhdx' ; MemoryStartupBytes= 512MB ; AddToolsVHD=$True ; DisableWCF=$True}
389389
390390 or you can use this to deploy 100 nanoservers and 100 Windows 10 machines named Windows10_..
391- 1..100 | % {"NanoServer$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
392- 1..100 | % {"Windows10_$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win10_G2.vhdx' ; MemoryStartupBytes= 512MB ; AddToolsVHD=$True ; DisableWCF=$True } }
391+ 1..100 | ForEach-Object {"NanoServer$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
392+ 1..100 | ForEach-Object {"Windows10_$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win10_G2.vhdx' ; MemoryStartupBytes= 512MB ; AddToolsVHD=$True ; DisableWCF=$True } }
393393
394394 or Several different VMs
395395 * you need to provide your GPT VHD for win 2012 (like created with convertwindowsimage script)
@@ -404,38 +404,38 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M
404404 $LabConfig.VMs += @{ VMName = 'Win2008R2_Core' ; Configuration = 'Simple' ; ParentVHD = 'Win2008R2.vhdx' ; MemoryStartupBytes= 512MB ; Unattend="DjoinCred" ; Generation = 1}
405405
406406 Example with sets of different DSC Configs
407- 1..2 | % {"Nano$_"} | % { $LABConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 256MB ; DSCMode='Pull'; DSCConfig=@('LAPS_Nano_Install','LAPSConfig1')} }
408- 3..4 | % {"Nano$_"} | % { $LABConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 256MB ; DSCMode='Pull'; DSCConfig=@('LAPS_Nano_Install','LAPSConfig2')} }
409- 1..6 | % {"DSC$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB ; DSCMode='Pull'; DSCConfig=@('Config1','Config2')} }
410- 7..12| % {"DSC$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB ; DSCMode='Pull'; DSCConfig='Config3'} }
407+ 1..2 | ForEach-Object {"Nano$_"} | ForEach-Object { $LABConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 256MB ; DSCMode='Pull'; DSCConfig=@('LAPS_Nano_Install','LAPSConfig1')} }
408+ 3..4 | ForEach-Object {"Nano$_"} | ForEach-Object { $LABConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 256MB ; DSCMode='Pull'; DSCConfig=@('LAPS_Nano_Install','LAPSConfig2')} }
409+ 1..6 | ForEach-Object {"DSC$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB ; DSCMode='Pull'; DSCConfig=@('Config1','Config2')} }
410+ 7..12| ForEach-Object {"DSC$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB ; DSCMode='Pull'; DSCConfig='Config3'} }
411411
412412 Hyperconverged S2D with nano and nested virtualization (see https://msdn.microsoft.com/en-us/virtualization/hyperv_on_windows/user_guide/nesting for more info)
413- 1..4 | % {"S2D$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'S2D' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 12 ; HDDSize= 4TB ; MemoryStartupBytes= 4GB ; NestedVirt=$True} }
413+ 1..4 | ForEach-Object {"S2D$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'S2D' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 12 ; HDDSize= 4TB ; MemoryStartupBytes= 4GB ; NestedVirt=$True} }
414414
415415 HyperConverged Storage Spaces Direct with Nano Server
416- 1..4 | % {"S2D$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'S2D' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 12 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB } }
416+ 1..4 | ForEach-Object {"S2D$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'S2D' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 12 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB } }
417417
418418 Disaggregated Storage Spaces Direct with Nano Server
419- 1..4 | % {"Compute$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
420- 1..4 | % {"SOFS$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'S2D' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 12; SSDSize=800GB ; HDDNumber = 0 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB } }
419+ 1..4 | ForEach-Object {"Compute$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
420+ 1..4 | ForEach-Object {"SOFS$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'S2D' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 12; SSDSize=800GB ; HDDNumber = 0 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB } }
421421
422422 "traditional" stretch cluster (like with traditional SAN)
423- 1..2 | % {"Replica$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Replica' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; ReplicaHDDSize = 20GB ; ReplicaLogSize = 10GB ; MemoryStartupBytes= 2GB ; VMSet= 'ReplicaSet1' ; AdditionalNetworks = $True} }
424- 3..4 | % {"Replica$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Replica' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; ReplicaHDDSize = 20GB ; ReplicaLogSize = 10GB ; MemoryStartupBytes= 2GB ; VMSet= 'ReplicaSet2' ; AdditionalNetworks = $True} }
423+ 1..2 | ForEach-Object {"Replica$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Replica' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; ReplicaHDDSize = 20GB ; ReplicaLogSize = 10GB ; MemoryStartupBytes= 2GB ; VMSet= 'ReplicaSet1' ; AdditionalNetworks = $True} }
424+ 3..4 | ForEach-Object {"Replica$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Replica' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; ReplicaHDDSize = 20GB ; ReplicaLogSize = 10GB ; MemoryStartupBytes= 2GB ; VMSet= 'ReplicaSet2' ; AdditionalNetworks = $True} }
425425
426426 HyperConverged Storage Spaces with Shared Storage
427- 1..4 | % {"Compute$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
428- 1..4 | % {"SOFS$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Shared' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 8 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB ; VMSet= 'SharedLab1'} }
427+ 1..4 | ForEach-Object {"Compute$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 512MB } }
428+ 1..4 | ForEach-Object {"SOFS$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Shared' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 8 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB ; VMSet= 'SharedLab1'} }
429429
430430 ShieldedVMs lab
431431 $LABConfig.VMs += @{ VMName = 'HGS' ; Configuration = 'Simple' ; ParentVHD = 'Win2016Core_G2.vhdx' ; MemoryStartupBytes= 512MB ; Unattend="NoDjoin" }
432- 1..2 | % { $VMNames="Compute" ; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 2GB ; NestedVirt=$True ; vTPM=$True } }
432+ 1..2 | ForEach-Object { $VMNames="Compute" ; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'Simple' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; MemoryStartupBytes= 2GB ; NestedVirt=$True ; vTPM=$True } }
433433
434434 Windows Server 2012R2 Hyper-V (8x4TB CSV + 1 1G Witness)
435- 1..8 | % {"Node$_"} | % { $LABConfig.VMs += @{ VMName = $_ ; Configuration = 'Shared' ; ParentVHD = 'win2012r2Core_G2.vhdx' ; SSDNumber = 1; SSDSize=1GB ; HDDNumber = 8 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB ; VMSet= 'HyperV2012R2Lab' ;Unattend="DjoinCred" } }
435+ 1..8 | ForEach-Object {"Node$_"} | ForEach-Object { $LABConfig.VMs += @{ VMName = $_ ; Configuration = 'Shared' ; ParentVHD = 'win2012r2Core_G2.vhdx' ; SSDNumber = 1; SSDSize=1GB ; HDDNumber = 8 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB ; VMSet= 'HyperV2012R2Lab' ;Unattend="DjoinCred" } }
436436
437437 Windows Server 2012R2 Storage Spaces
438- 1..2 | % {"2012r2Spaces$_"} | % { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Shared' ; ParentVHD = 'win2012r2Core_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 8 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB ; VMSet= '2012R2SpacesLab';Unattend="DjoinCred" } }
438+ 1..2 | ForEach-Object {"2012r2Spaces$_"} | ForEach-Object { $LabConfig.VMs += @{ VMName = $_ ; Configuration = 'Shared' ; ParentVHD = 'win2012r2Core_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 8 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB ; VMSet= '2012R2SpacesLab';Unattend="DjoinCred" } }
439439
440440 #>
441441# endregion
0 commit comments