Migration from VMWare ESXi to Proxmox

vidra

New Member
Jul 4, 2023
5
3
1
Hello eveyone,
I am little bit stuck with the migration process: On Vmware there is two vmdk files (machine.vmdk and machine-flat.vmdk). The larger one is 1.2TB. On the new server I have fresh Proxmox 7.4 installation. New server have two RAID 1 disks (one 600GB size and the other 2TB size). On the first disk is proxmox itself and the other one is free.

So I have only 2TB disk left for migration. I've created lvm-thin pool and formatted that pool as ext4 and mounted. After that I've used scp to copy vmdks from Esxi to mounted lvm-thin.
Copying was successfull but after that I can't do anything else. I cannot attach directly vmdks to VM and I cannot use qm importdisk because I cannot import onto already formatted lvm-thin and there is just no free space to import.

So, I can remove lvm-thin and then rebuild and use for e.g. external USB drive to copy vmdks from esxi and then import those vmdks from usb drive to lvm-thin but that is alot complicated and I don't have external USB drive.
Is there simplier and better way to migrate vmdks from esxi or is there a way to attach already copied vmdks onto VM?
 
I used this guide https://unixcop.com/migrate-virtual-machine-from-vmware-esxi-to-proxmox-ve

The -flat.vmdk is the actual virtual disk. The vmdk is the metafile which qm convert needs to describe the -flat.vmdk file.

Ok, but that guide uses 3rd host as intermediate which is exactly what I am trying to avoid. I know that I can use 3rd host or USB drive to store vmdks and then import those VMs to lvm-thin but that is not solution if I don't have spare resources.
I am thinking about directly importing VMs from esxi to proxmox.
Maybe if there is some combination using scp and qm importdisk commands...
 
Download the OVFTOOL tool on the proxmox server:
https://customerconnect.vmware.com/fr/downloads/get-download?downloadGroup=OVFTOOL440

Add execution rights:
chmod +x VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

Tool installation:
./VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

Start VM export from ESX to Proxmox (The VM to be migrated must be shut down):
ovftool vi://root@ipesx/vm_name stockage_proxmox (vm name can be enclosed in " " if spaces)
ovftool vi://root@10.0.XXX.XXX/FusionPBX /volume1/test


Import into proxmox:
qm importovf <idvm> <import_file_link> --format <format>
qm importovf 333 /volume1/test/FusionPBX/FusionPBX.ovf syno-nfs --format qcow2



For Debian virtual machines, there is a network card problem. To resolve this, change the name of the network card in the configuration file. Start the virtual machine, connect to the Shell and search for the interface name with the ifconfig -a command.

Then modify the card:
nano /etc/network/interfaces

The configured network card is ens192, which you simply change to ens18. Save the modification and restart the virtual machine for it to take effect.
 
Download the OVFTOOL tool on the proxmox server:
https://customerconnect.vmware.com/fr/downloads/get-download?downloadGroup=OVFTOOL440

Add execution rights:
chmod +x VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

Tool installation:
./VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

Start VM export from ESX to Proxmox (The VM to be migrated must be shut down):
ovftool vi://root@ipesx/vm_name stockage_proxmox (vm name can be enclosed in " " if spaces)
ovftool vi://root@10.0.XXX.XXX/FusionPBX /volume1/test


Import into proxmox:
qm importovf <idvm> <import_file_link> --format <format>
qm importovf 333 /volume1/test/FusionPBX/FusionPBX.ovf syno-nfs --format qcow2



For Debian virtual machines, there is a network card problem. To resolve this, change the name of the network card in the configuration file. Start the virtual machine, connect to the Shell and search for the interface name with the ifconfig -a command.

Then modify the card:
nano /etc/network/interfaces

The configured network card is ens192, which you simply change to ens18. Save the modification and restart the virtual machine for it to take effect.
 
  • Like
Reactions: Wichets
Unfortunately that did not work. Ovftool reported this error:
Transfer Failed
Error: System error: (std::exception)

Transferred about 10% and failed.
Tried also with --chunkSize=7168mb in order to break vmdk to smaller sizes (less than 8gb per file) but with the same results.
 
Ok, after many failures, this actually worked:
This is example for migrating Windows 2016 server VM from ESXi to freshly installed Proxmox without any VM:

1. Attach another storage to the Proxmox server (for. eg. external USB drive). Make sure that this storage is larger than VM size.

2. Create lvm-thin storage on that external USB drive and define that storage as "directory" storage and name it for eg. "external".

3. Open shell and download ovftool directly from my site because download from vmware will require authentication and therefore you cannot download ovftool directly. So command is:
wget --user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" https://www.heliasc.com/download/VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

4. Change ovftool permissions and run ofvtool installation (answer to any question with yes):
chmod +x VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle
./VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

5. On ESXi, make sure that there is only one storage attached to VM and that there is no any ISO attached to VM

6. Run Ovf tool (xx.xx.xx.xx is your Esxi IP address, vm_name is name of your VM on Esxi). Ovf tool will ask you for root password of the Esxi. Operation will take a while (could be hours):
ovftool --overwrite --noSSLVerify vi://root@xx.xx.xx.xx/vm_name /mnt/pve/external

7. Create VM from OVF. You can change number 130 to any number you like. vm_name is name of your VM on Esxi and local-lvm is default VM storage location on Proxmox (you can change that to any other storage if you have one and make sure that this storage is larger than VM size). Operation will take a while (could be hours to finish):
qm importovf 130 /mnt/pve/external/vm_name/vm_name.ovf local-lvm

8. Configure bios:
qm set 130 --bios ovmf

9. Change SCSI interface to SATA because VM will not work without changing:
sed -i 's/scsi0:/sata0:/' /etc/pve/qemu-server/130.conf

10. Add network device to VM because ovftool will not add network automatically (I don't know why) and run VM. Login to win 2016, uninstall VmWare tools and install proxmox drivers and agent.

That's all folks.
 
Hello question
/mnt/pve/external where is this do i need to add this disk ?

After command
./ovftool --overwrite --noSSLVerify vi://usero@ipadres/VMname /mnt/pve/external

I get this answer ?
-bash: ./ovftool: No such file or directory


( Iám not a shell guy)
 
wget --user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" https://www.heliasc.com/download/VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

done
chmod +x VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

./VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle
Installed , answer with Yes

Installed 2 times

Still no luck
root@PVE02:/# ls
bin dev etc lib lib64 media opt root run srv tmp var
boot pve home lib32 libx32 mnt proc rpool sbin sys usr VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

root@PVE02:/# ovftool vi://root@ipadres/"Windows blabla"
-bash: ovftool: command not found ( Means command not found with google)
Try
root@PVE02:/# ./ovftool vi://root@ipadres/"Windows blabla"
-bash: ./ovftool: No such file or directory


So where would can the ovftool
 
That's strange, works here. Can you check if the file is present?

Code:
$ ls -l /usr/lib/vmware-ovftool/ovftool
-rwxr-xr-x 1 root root 485 Nov 20 17:05 /usr/lib/vmware-ovftool/ovftool
 
  • Like
Reactions: ProxmoxBoy1
$ ls -l /usr/lib/vmware-ovftool/ovftool

result /usr/lib/vmware-ovftool/ovftoo cannot access : No such file or directory

( cd /usr/lib ls > also no result vmware-ovftool listed)


find . -name "ovftool*"
no results

find . -name "VMware*" 2 results

./VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle
./root/VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle


Edit

Since i could not find the install dir and files i started the install again
./VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle

Now keep pressing enter until the end
Now the prompt yes/no about the whole story it stared installing.


So now iám writing my first ovf package.

Thx for all the help guys.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!