-
Notifications
You must be signed in to change notification settings - Fork 289
Home
-
Download scripts and unpack it into empty folder
-
Right-click 1_Prereq.ps1 and run with PowerShell. Script will prepare folders and download DSC modules necessary for DC hydration.
Tip
-
You can copy iso file into OS folder and next script will not prompt you for OS media. You can copy tools into ToolsVHD folder and it will be added into tools.vhdx during next step.
-
You can also copy MSU/CAB files into packages folder under OSServer/OSClient. So you can have your lab always up-to-date or you can embed RSAT into Windows Client OS this way
-
After script finishes, right click 2_CreateParentDisks.ps1 and run with PowerShell. It will take ~20 minutes to finish with defender disabled or ~80 minutes with defender enabled. (choice is yours :)
-
After script finishes, right click 3_Deploy.ps1 and run with PowerShell. You may need to modify variables.ps1 if you are running this on Windows 10, as Win10 does not support Shared VHDX.
-
If you don’t like the lab, just right click Cleanup.ps1 and run with PowerShell – it will remove all VMs and vSwitches with lab prefix… Modify Variables.ps1 and you are ready to deploy different lab using 3_Deploy.ps1
#Howto in detail
- Open Variables.ps1 in PowerShell ISE
- $LabConfig variable needs to be edited before 2_CreateParentDisks.ps1. $LabVMs variable is used during 3_Deploy.ps1 and the $LabConfig.AdminPassword needs to remain same (as its used to connect to DC during hydration)
Sample variables.ps1 to create 4 node S2D with nanoservers. You can find more examples and syntax inside variables.ps1 or here
$LabConfig=@{AdminPassword='LS1setup!'; DomainAdminName='Ned'; Prefix = 'MyLab-'; SecureBoot='On'; CreateClientParent='No';DCEdition='ServerDataCenter';ClientEdition='Enterprise'}
$NetworkConfig=@{SwitchName = 'LabSwitch' ; StorageNet1='172.16.1.'; StorageNet2='172.16.2.'}
$LAbVMs = @()
1..4 | % {"Direct$_"} | % { $LAbVMs += @{ VMName = $_ ; Configuration = 'S2D' ; ParentVHD = 'Win2016NanoHV_G2.vhdx' ; SSDNumber = 4; SSDSize=800GB ; HDDNumber = 12 ; HDDSize= 4TB ; MemoryStartupBytes= 512MB } }
Script connects to internet, downloads DSC Modules and add them into PowerShell on local machine. It also downloads convertwindowsimage.ps1 from GitHub and also DiskSpd as sample application that will be added to tools disk durin 2_CreateParentDisks. Script also creates folders where you can put your ISO or ISO content + packages folder where you can add MSU/CAB packages (RSAT for client or Hotfixes for both Client and Server)
If you want to run this on server without internet connection, copy 1_prereq.ps1 to some other machine that has internet connection, run it and copy generated folders back. Then run 1_prere1.ps1 again just to verify if DSC modules are imported correctly. Folders created during 1_Prereq.ps1 You can add tools into ToolsVHD. 2_CreateParentDisks script will create Tools.vhdx that will be mounted to DC and to VMs, if you configure so.
If OSServer/OSClient does not contain Windows Server .iso or its content, it will prompt you to specify .iso location.
This will remove all VMs and VMswitch with Prefix configured in Variables.ps1, so you will be able to run 3_Deploy.ps1 again. You can safely ignore warnings and error. It just cleans all VMs and tries to unmount VHD from mountdir in case you interrupted hydration in middle of VHD servicing