News

Copy ESX VMs from one host to another with OVF

This is easy with shared storage but how best to do it with stand alone servers using internal storage - common in SMEs?

There are various ways, such as sFTP, using the VMware convertor and using ovftool. see https://www.virtuallyghetto.com/2012/06/how-to-copy-vms-directly-between-esxi.html

for more details.

C:Program FilesVMwareVMware OVF Tool>

C:Program FilesVMwareVMware OVF Tool>ovftool -ds=WM-01 vi://192.168.0.6/WM-PXE vi://192.168.0.158
Enter login information for source vi://192.168.0.6/
Username: root
Password: ************
Opening VI source: vi://[email protected]:443/WM-PXE
Enter login information for target vi://192.168.0.158/
Username: root
Password: ************
Opening VI target: vi://[email protected]:443/
Deploying to VI: vi://[email protected]:443/
Disk progress: 4%

VM convertor was pretty fast - less than an hour - to copy a 150Gb VM to a new host so worth looking into.

vftool -ds=WM-01 vi://192.168.0.6/WM-PXE vi://192.168.0.158

Note that the first '-ds=WM-01' is the target datastore, not the source. This is then followed by the source host, the VM [WM=PXE in this example] and then the target host. Also note that even when running this on a Windows box, the VM names are case sensitive, as it comes from the Un*x world.

Also, it's often worth adding the -dm=thin parameter so fat disks are transferred as thin.

C:Scriptsovftool>ovftool -ds=WM-01 -dm=thin vi://192.168.0.6/W11-22H2 vi://192.168.0.5
Enter login information for source vi://192.168.0.6/
Username: root
Password: ************
Opening VI source: vi://[email protected]:443/W11-22H2
Enter login information for target vi://192.168.0.5/
Username: root
Password: ************
Opening VI target: vi://[email protected]:443/
Deploying to VI: vi://[email protected]:443/
Transfer Completed
Completed successfully

<< Go back to the previous page