Search This Blog

Saturday, March 17, 2012

Create Multiple VM using PowerShell in Windows 8

In my previous post, i have discussed about how to convert golden image from dynamic disk to fixed disk for deployment use. Now let move on to use these virtual hard by creating virtual machine configuration.

Previous post:-

Let start to create Virtual machine using Powershell in Windows 8.

1. Modify previous script and enter additional command:

new-vm -Name Test1VM -MemoryStartupBytes 1024MB -VHDPath E:\Test1.vhd -SwitchName Production -ComputerName Node1
new-vm -Name Test2VM -MemoryStartupBytes 1024MB -VHDPath E:\Test2.vhd -SwitchName Production -ComputerName Node1
new-vm -Name Test3VM -MemoryStartupBytes 1024MB -VHDPath E:\Test3.vhd -SwitchName Production -ComputerName Node1
new-vm -Name Test4VM -MemoryStartupBytes 1024MB -VHDPath E:\Test4.vhd -SwitchName Production -ComputerName Node1

Command description:-

new-vm –name (virtual machine name) –MemoryStartupBytes (startup memory value) –VHDPath (location of converted VHD) –SwitchName (virtual switch name) –computername (hyper-v host name)


Create 4 virtual machine name “Test1VM,Test2VM,Test3VM, Test4VM” with the startup memory set to 1GB, pointing to exiting VHD path and assign to virtual switch: Production



That should do the trick. No multiple step in GUI and i found using Powershell is much easier and fun as well. :)