Copying Guests or Moving HD’s between ESXi hosts

By | April 2, 2014

To copy a guest between ESXi hosts you can use SCP.

# scp -rC /vmfs/volumes/datastoreABC/GuestXYX root@newesxihost:/vmfs/volumes/datastoreEFG/

Note 1: SSH is required to be running on the destination server and highly likely to be require on the source server unless you’re issuing the SCP command from the console.

the -C compresses the transfer and in my experience saves you a little bit of time – especially if you’re copying thick provisioned disks and aren’t full.

Note 2: The guess machine is required to be powered down. Don’t be tempted to suspend the machine, when you try and power up on the server ESXi server it’ll likley complain that the CPU type is from a different vendor and can’t resume. It MAY work if you’re sticking with the same CPU vendor but I’ve never had the opprtunity to test it and really, why would you both taking the risk?

Once the guess is copied OR you’ve physically moved the disk to the new ESXi host you can import the Virtual Machine into inventory on your target ESXi hosy by browsing the datastore where the virtual machine is located, right click the .vmx file and clicking Add to Inventory. When you start the machine up you’ll be asked if you copied or moved it. I tend to choose Move regardless of if I’ve copied it UNLESS I plan to continuing using the virtual machine on the source server. ie, If I’m decommissioning the source server I choose move.

esxi-import-to-inventory