My HomeLab's first host has the IP address 192.168.1.80 (the source), and the target host has the address 192.168.1.81.
I had used ovftool before for convert a VMware Fusion VM to OVF file. Then when I tried to use to export VMs I got this error:
./ovftool vi://root@192.168.1.80
Segmentation fault: 11
Because I found some references where people had used ovftool to export VMs, like virtuallyGhetto site, I guessed my problem was the version.
I checked my Mac has the version: 3.5.2:
./ovftool -v VMware ovftool 3.5.2 (build-1880279)
I looked for a new one version, and I found the version 4.2.0 available on VMware site (VMware-ovftool-4.2.0-4586971-mac.x64.dmg file). After I installed the new one version, I checked again:
./ovftool -v VMware ovftool 4.2.0 (build-4586971)
We are ready. First, I need to check what is the list of VM's on the source host:
./ovftool vi://root@192.168.1.80
Enter login information for source vi://192.168.1.80/
Username: root
Password: ********
Error: Found wrong kind of object (ResourcePool). Possible completions are:
VMware vCenter Orchestrator Appliance
VMware vCenter Server 6
VMware vCenter Orchestrator Appliance OTB
vRealize Infrastructure Navigator
VMware vRealize Appliance 7.0
Redhat Enterprise Linux 7.2 x86_64
I choose "vRealize Infrastructure Navigator", just because it's the little one. Also I need to define what is the datastore on target host, I chose datastore_1_Server1 datastore. We are ready, go:
./ovftool -ds=datastore_1_Server1 vi://root@192.168.1.80/vRealize\ Infrastructure\ Navigator vi://root@192.168.1.81
Enter login information for source vi://192.168.1.80/
Username: root
Password: ********
Opening VI source: vi://root@192.168.1.80:443/vRealize%20Infrastructure%20Navigator
Opening VI target: vi://root@192.168.1.81:443/
Deploying to VI: vi://root@192.168.1.81:443/
Transfer Completed
Completed successfully
Also, you can create some too simple script to do the task for each VM on source host, in my case it could be:
#!/bin/bash
OVFTOOL="/Applications/VMware\ OVF\ Tool/ovftool"
OIFS="$IFS"
IFS=$'\n'
VMs="VMware vCenter Orchestrator Appliance VMware vCenter Orchestrator Appliance OTB"
for vm in ${VMs}; do
echo "${vm}"
echo $OVFTOOL -ds=datastore_1_Server1 vi://root:VMware1\!@192.168.1.80/${vm} vi://root:VMware1\!@192.168.1.81
done
IFS="$OIFS"
Done. The VM's were copied. Remember, with this method you will copy the VM, not move it. Then, after you are sure the VM was copied fine, you need to remove the old one VM from the source host (after you tested the new copy is working). Regards
No comments:
Post a Comment