Last active
March 22, 2016 20:01
-
-
Save tomtorggler/731a4ebc7233683ff894 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create VMs on a host and add them to the cluster | |
1..4 | ForEach-Object { | |
# create differencing VHD for the VM | |
$vhdParams = @{ | |
Differencing = $true; | |
ParentPath = "c:\clusterstorage\volume1\hyper-v\vhd\win2012r2.vhdx"; | |
Path = "c:\clusterstorage\volume1\hyper-v\vhd\hcvm0$_.vhdx"; | |
ComputerName = "n01" | |
} | |
New-VHD @vhdParams | |
# create the VM and add to cluster | |
$vmParams = @{ | |
VHDPath = "C:\ClusterStorage\Volume1\Hyper-V\VHD\hcvm0$_.vhdx"; | |
ComputerName = "n01"; | |
Generation = 1; | |
MemoryStartupBytes = 1gb; | |
Name = "hcvm0$_"; | |
Path = "C:\ClusterStorage\Volume1\Hyper-V"; | |
SwitchName = "sw-ext" | |
} | |
New-VM @vmParams | Add-ClusterVirtualMachineRole -Cluster hc01 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment