- The name of the new vm
- The source vm
- The data store where you will place your new cloned vm
So you wanted to clone a virtual machine using power cli?
Lets do it
Connect to your vmware vcenter server.
You cannot clone if you are connected to an esxi host.
Use the connect-viserver vcenter name Or ip
Have ready:
In the example:
New vmname: clonevmtest
Sourcevm: convert3
Datastore: 250Stor01
New-VM -Name VM2 -VM VM1 -Datastore datastorename -vmhost hostname -DiskStorageFormat thin
New-vm -name clonevmtest -vm convert3 -datastore 250stor01-vmhost 10.250.11.1 -DiskStorageFormat thin
I suggest adding -DiskStorageFormat other wise it will use thick disks
Clone being created
done
Here is the vm configured and ready for setup and activation
For more info on the command go to <http://www.vmware.com/support/developer/PowerCLI/PowerCLI41U1/html/New-VM.html>