I recently migrated virtual machines from VMware ESXi to Proxmox VE, and hit a few quirks in the process. Here are my notes in case that may help.
Both VMware ESXi and Proxmox VE support OVF. The goal is to export a VM in OVF format from VMware ESXi and then import the OVF on Proxmox VE.
Assuming VMware ESXi is accessible from the Proxmox VE, we can use VMware OVF Tool directly from Proxmox VE in order to export and copy the OVF in one pass.
.bundle
file (requires a VMware account, can create one for free).chmod +x
and run it.Usage:
# ovftool vi://<username>@<host>:<port>/
If using SSL with a self-signed certificate, add --noSSLVerify
.
OVF Tool will prompt for the password and list objects available:
# ovftool --noSSLVerify vi://root@XXX.XXX.XXX.XXX:443/
Enter login information for source vi://XXX.XXX.XXX.XXX/
Username: root
Password: ***************
Error: Found wrong kind of object (ResourcePool). Possible completions are:
vm1
vm2
dir1/
dir2/
We can recursively list objects, e.g. here for a directory:
# ovftool --noSSLVerify vi://root@XXX.XXX.XXX.XXX:443/dir1/
Enter login information for source vi://XXX.XXX.XXX.XXX/
Username: root
Password: ***************
Error: Found wrong kind of object (ResourcePool). Possible completions are:
vm3
When accessing a VM, we are displayed the VM details to be exported via OVF:
# ovftool --noSSLVerify vi://root@XXX.XXX.XXX.XXX:443/dir1/vm3
Enter login information for source vi://XXX.XXX.XXX.XXX/
Username: root
Password: ***************
OVF version: 1.0
VirtualApp: false
Name: vm3
Download Size: Unknown
Deployment Sizes:
Flat disks: 100.00 GB
Sparse disks: Unknown
Networks:
Name: Foo
Description: Bar
Virtual Machines:
Name: vm3
Operating System: debian10_64guest
Virtual Hardware:
Families: vmx-13
Number of CPUs: 4
Cores per socket: 4
Memory: 6.00 GB
Disks:
Index: 0
Instance ID: 9
Capacity: 50.00 GB
Disk Types: SCSI-VirtualSCSI
Index: 1
Instance ID: 10
Capacity: 50.00 GB
Disk Types: SCSI-VirtualSCSI
NICs:
Adapter Type: VmxNet3
Connection: Foo
References:
File: /12/ParaVirtualSCSIController0:0
File: /12/ParaVirtualSCSIController0:1
Once we have identified the VM to export, we can write the OVF to a local file on Proxmox VE:
# ovftool --noSSLVerify vi://root@XXX.XXX.XXX.XXX:443/dir2/vm4 .
Enter login information for source vi://XXX.XXX.XXX.XXX/
Username: root
Password: ***************
Opening VI source: vi://root@XXX.XXX.XXX.XXX:443/dir2/vm4
Opening VI source: vi://root@XXX.XXX.XXX.XXX:443/dir2/vm4
Opening OVF target: .
Writing OVF package: ./vm4/vm4.ovf
Disk progress: 12%
[...]
Transfer Completed
Completed successfully
For some VMs, I hit this error:
# ovftool --noSSLVerify vi://root@XXX.XXX.XXX.XXX:443/dir2/vm4
Enter login information for source vi://XXX.XXX.XXX.XXX/
Username: root
Password: ***************
Error: Fault cause: vim.fault.FileNotFound
With the OVF available locally, we can import the VM using the qm
command line tool.
Usage:
qm importovf <id> path/to/file.ovf <proxmox_storage>
We may also specify --format <qcow2 | raw | vmdk>
to use a specific disk image format on import.
This will have no effect when importing into ZFS storage since it uses block device emulation and only allows raw
.
Example using the OVF from above:
qm importovf 400 vm4/vm4.ovf local-zfs
transferred 0.0 B of 50.0 GiB (0.00%)
[...]
transferred 50.0 GiB of 50.0 GiB (100.00%)
The VM should now be available in Proxmox VE web GUI.
Check the imported configuration. In particular:
Once satisfied, try to start the VM. With the VM up and running, we can:
# apt install qemu-guest-agent
# systemctl status qemu-guest-agent
# ls /usr/lib/vmware-tools
# systemctl status vmware
# which vmware-toolbox
# which vmware-toolbox-cmd
# dpkg -l | grep -I vm
# apt search open-vm-tools
# vmware-uninstall-tools.pl
# apt purge open-vm-tools
Some VMs failed to boot after the bootloader had successfully passed, not finding the disk partitions.
initramfs
.On Debian-based systems:
/etc/initramfs-tools/modules
:virtio_blk
virtio_scsi
initramfs
and shutdown VM:# update-initramfs -u
# shutdown now
I suspect a similar issue might happen with the network device if the virtio_net
module is also missing.
To check the list of loaded modules:
# lsmod | grep virtio
virtio_net 53248 0
net_failover 20480 1 virtio_net
virtio_console 32768 1
virtio_balloon 20480 0
virtio_blk 20480 0
virtio_scsi 20480 2
scsi_mod 249856 4 virtio_scsi,sd_mod,libata,sg
virtio_pci 28672 0
virtio_ring 28672 6 virtio_console,virtio_balloon,virtio_scsi,virtio_pci,virtio_blk,virtio_net
virtio 16384 6 virtio_console,virtio_balloon,virtio_scsi,virtio_pci,virtio_blk,virtio_net