Importing some windows machines from ESXi

locusofself

Member
Mar 29, 2016
39
3
8
40
Hello,

I am trying to move my last several VMs from ESXi, the linux ones were a cinch but Windows7 ones are giving me some trouble.

On ESXi, I use the "ghettoVCB" backup tool which under the hood, uses "vmkfstools -i" to clone the VMs and make a "thin" .vmdk backup (which is a .vmdk text file, and a vm-flat.vmdk large file which appears to be a sparse file, for example allocated 200gb but ls -s will show the used sized of 65 gb).

Since I have this same backup location mounted (Read-only) to proxmox node, I did this:

qemu-img convert /nfs/vmbackup.vmdk -O qcow2 /var/lib/vz/qemu-server/images/125/vm-125.qcow2


This runs without error, outputs a 65 gb qcow2 file as I would expect, and the VM boots OK at first in proxmox but then Windows goes into a repair mode and says "Fixing disk issues" for about 2 hours, then it says it cannot fix it.


The *only* steps I did in preparation for the VM on windows guest beforehand:
I installed mergeide.zip
VMwaretools was never installed on these VMs
I powered off the VM before making the .vmdk backup.



I accepted the default settings on proxmox, which uses the virtio scsi driver, and I selected qcow2 format of 200gb disk. In the 125.conf file it says "ide0"

I did *not* try to match the UUID or Mac address or anything yet, should I?

Thanks for any help.

And yes I did read the migration wiki page .. but if I missed something I dont know. I am not using the desktop vmware, it is ESXi server on the same LAN as proxmox nodes in the datacenter .. I can scp, rsync, or NFS files across, but the NFS of the thin .vmdk backup is by far the fastest method.
 
For this things easily i used always clonezilla with the mergeide.zip. If this doesn't work, i used the old vmwareconverter an the mergeide.zip. This has always worked for me at the past.
 
For this things easily i used always clonezilla with the mergeide.zip. If this doesn't work, i used the old vmwareconverter an the mergeide.zip. This has always worked for me at the past.

Those are not bad suggestions, but man it sure seems like there should be a way for me to take these backups I already have on my NFS and get them converted and running using qemu-convert etc ..
 
I'm not sure if this will help anyone give me suggestions, but heres what the backups I'm working with looks like:


The .vmdk file is a text file:



# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=fffffffe
parentCID=ffffffff
isNativeSnapshot="no"
createType="vmfs"

# Extent description
RW 419430400 VMFS "sparky-rdc-flat.vmdk"

# The Disk Data Base
#DDB

ddb.deletable = "true"
ddb.virtualHWVersion = "8"
ddb.longContentID = "f686bf399a28f1086b25edef7c616d7a"
ddb.uuid = "60 00 C2 9a 83 be 52 ad-90 3c c3 ed 9e 95 53 f7"
ddb.geometry.cylinders = "26108"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.thinProvisioned = "1"
ddb.adapterType = "lsilogic"




The vm-flat.vmdk file is the big file of the actual disk. When I do "file blah-flat.vmdk" from linux I get this:

blah-flat.vmdk: DOS/MBR boot sector MS-MBR Windows 7 english at offset 0x163 "Invalid partition table" at offset 0x17b "Error loading operating system" at offset 0x19a "Missing operating system", disk signature 0x982a4ff2; partition 1 : ID=0x7, active, start-CHS (0x0,32,33), end-CHS (0xc,223,19), startsector 2048, 204800 sectors; partition 2 : ID=0x7, start-CHS (0xc,223,20), end-CHS (0x3ff,254,63), startsector 206848, 419221504 sectors



Whereas when I do "file" command on a .vmdk which was *created* by proxmox itself when I create a new VM with .vmdk as the disk it says:

root@pxmx01:/var/lib/vz/images/125# file vm-125-disk-1.vmdk
vm-125-disk-1.vmdk: VMware4 disk image
 
Before you have done your backup, have you execute the mergeide.zip? If not the converted VM's can't start. Maybe with an windows repairinstallation.
Also this things should be done:
  • set all interfaces on DHCP (if you would like to use the same IP Adresses again)
  • deinstall all cloningtools like virtualclonedrive....
  • deinstall all bad software like special drivers, ....
 
Alright some more information here.

Instead of even doing the qemu-img convert at all, I tried again just coping the two .vmdk files over from nfs and making a new vm in proxmox with a .vmdk disk and putting my vmdk files where the proxmox-created .vmdk was.

This did the same thing, the VM boots but it goes into a repair mode. So the issue doesnt seem to be with the qemu-img convert part at least .. hmm..
 
Instead of even doing the qemu-img convert at all, I tried again just coping the two .vmdk files over from nfs and making a new vm in proxmox with a .vmdk disk and putting my vmdk files where the proxmox-created .vmdk was.
That is not a good idea. Only use RAW or QCOW2.

qemu-img convert /nfs/vmbackup.vmdk -O qcow2 /var/lib/vz/qemu-server/images/125/vm-125.qcow2
I think this couldn'd work.

So here a detailed description how i would do this. Ok, you have images in vmdk format, including executed regfile. Good. So first add a VM with:
  • IDEdisks
  • 100mbit RTL Card
  • LSI Controller
Listen: It this time for the first reboot of the VM in PVE you have no drivers, so only device were windows have drivers included for installation will work. Before the first start you must convert your vmdk file to raw, not necessarily to qcow2. This is depending on your storage. So what storage to you have? LVM-Thin then qcow2 is wrong. Normal directory, then qcow2 is an option if would like snapshots too.

Converting:
Code:
qemu-img convert -O raw vm-103-disk-1.vmdk  vm-103-disk-1.raw
qemu-img convert -O qcow2 vm-103-disk-1.raw  vm-103-disk-1.qcow2

After that change your config to the right paths. Before the first start make a backup or a snapshot. Listen: if you change bus after first successfully boot of the VM to SCSI... or other, you are not able to delete the snapshot. But this is no really a problem. Only for destroying you can change it back to IDE...
 
Would it be possible to simply install the appropriate drivers for optimal KVM/proxmox hardware into the Windows guest as it is running in VMWARE, then convert the .vmdk to .qcow2 and make a new VM with it?
 

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!