Skip to content
Jaromir Kaspar edited this page Apr 24, 2016 · 25 revisions

Howto

  • 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 (at least it takes 20 minutes on my ultrabook with fast SSD and defender disabled) as DC is installed in the background.

  • 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

1. Customize variables.ps1 (optional)

  • 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 password 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 in variables.ps1

$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 } }


2. Run 1_Prereq.ps1

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)

Clone this wiki locally