Converting a server from Ganeti to vmware fails on import

250 views
Skip to first unread message

Darcy Boese

unread,
Apr 1, 2019, 1:25:10 PM4/1/19
to ganeti
A client needs to migrate from a slightly older Ganeti deployment (using kvm machines) to vmware. I've set up a test machine on the Ganeti server and used the Ganeti tools to create the ova files, as per http://docs.ganeti.org/ganeti/2.14/html/design-ovf-support.html#export-options

gnt-backup export -n <server> <machine>

which shut down the client machine, and made a snapshot to /var/lib/ganeti/export/<machine>/


In the resulting config.ini file the [backend] section was missing a line for "memory". Copying the 'maxmem = XXXX' to 'memory = XXXX' fixed that.

The next command created an .ova file for the machine:

/usr/lib64/ganeti/tools/ovfconverter export --format=vmdk --ova --external --output-dir=/root/kvm /var/lib/ganeti/export/<machine>/config.ini

So that gave me a file <machine>.ova, basically a .tar file containing three files:

<machine>.ovf
<machine>.mf
<uuid>.disk0.vmdk

This resulting file > 1GB, and according to what little documentation I can find means that the vsphere web tool required me to extract the files, so I could import them directly, as per https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.html.hostclient.doc/GUID-8ABDB2E1-DDBF-40E3-8ED6-DC857783E3E3.html

And now I'm stumped on the next hurdle: importing into vsphere. The specific error it's giving me is

Line 8: Unsupported value
'http://www.vmware.com/interfaces/specifications/vmdk.html#monolithicSparse' for attribute 'format' on element 'Disk'

The whole section containing that is this:

  <DiskSection>
    <Info>Virtual disk information</Info>
    <Disk ovf:capacity="1215151104" ovf:diskId="disk0" ovf:fileRef="file0" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#monolithicSparse"/>
  </DiskSection>

So for the moment I'm stumped, don't know how to proceed. I don't know if there's some weird command-line in the ganeti export command I can't find documented, nor if I can simply edit something in the .ovf file to continue.

sascha...@web.de

unread,
Apr 2, 2019, 12:00:13 PM4/2/19
to gan...@googlegroups.com
Hi Darcy,

on Mon, 01 Apr 2019 19:08:18 +0200 Darcy Boese writes:

> A client needs to migrate from a slightly older Ganeti deployment (using kvm
> machines) to vmware. I've set up a test machine on the Ganeti server and used
> the Ganeti tools to create the ova files ...

I have tried this too and ended up with my own solution. VMware calls
OVF/OVA Standard, but I think it's broken. Maybe ganetis ovfconverter, too.

So here are my steps:
* $ gnt-instance shutdown sample.vm.tld
* $ gnt-instance activate-disks sample.vm.tld
* for every disk of sample.vm.tld on its primary node:

$ qemu-img convert -p -t none -f raw -O vmdk -o adapter_type=lsilogic,compat6 ${src_dev} ${dest_path}/${vm}/disk_${idx}

* copy the VMDKs to ESX, or use shared NFS between Ganeti and ESX
* create a ESX-VM with CPU/RAM/HDDs from sample.vm.tld and import every disks data

$ vmkfstools --clonevirtualdisk ${src_path}/${vm}/disk_${idx} ${datastore}/${vm}/${disk}.vmdk -d thin -a pvscsi

This steps needs a two pass copy (qemu-img convert and vmkfstools). It seems
"clean" because you use VMDK-Format. However it seems also possible in
one/zero pass: If your ganeti VM is of disk template type sharedfile (NFS)
and you use the same NFS as Datastore in VMware, you just can copy or even
move the ganeti disks over *-flat VMDKs. The *-flat VMDKs are hidden from
vsphere GUI. It seems that this are just sparse data files, without
misplaced headers like adapter_type.

If your VMs are not sharedfile a single "qemu-img convert -f raw -O raw
${src_dev} /path/to/file" should produce, what can be reused over *-flat
VMDKs.

Just my 2¢, Sascha.

Darcy Boese

unread,
Apr 2, 2019, 4:51:22 PM4/2/19
to ganeti
So this worked. Basically I had to ignore all of the minisculy-available information available at ganeti.org, and go with what you said:

gnt-instance shutdown <machine>
gnt-instance activate-disks <machine>
qemu-img convert -p -t none -f raw -O vmdk -o adapter_type=lsilogic,compat6 /run/ganati/instance-disks/<machine>\:0 /mnt/temp/<disk>.vmdk
(where /mnt/temp was a nfs share available to the vmware ESXi server.

gnt-instance deactivate-disks <machine>


And then ssh to the vmware server (ssh not on by default):

cd /vmfs/volumes/<share>/<temp>/
vmkfstools --clonevirtualdisk ./<disk>.vmdk /vmfs/volumes/<share>/<machine>/<disk>.vmdk -d thin -a pvscsi

There was a minor warning that "adaptertype" was deprecated and being ignored. But ignorning that and waiting, it created a pair of files in the .../<share>/<machine>/ directory I'd set up. Then I had to create a new machine config from scratch, because without the .ova file(s) the memory/cpu/etc information was lost and had to be recreated manually.
After it booted (yay!) I had to log in and manually edit /etc/network/interfaces, as Ganeti had given the client machine an ethernet device named "ens5" but ESXi gave one named "ens160".
Hopefully it will work just as swimmingly with Windows and other flavours of Linux for the rest of the client machines.

sascha...@web.de

unread,
Apr 3, 2019, 3:16:35 PM4/3/19
to gan...@googlegroups.com
Hi Darcy,

on Tue, 02 Apr 2019 22:51:22 +0200 Darcy Boese writes:

> So this worked....

I'm glade to hear ...

> device named "ens5" but ESXi gave one named "ens160".

Yes. Predictive interface names are not predictive enough for me, too. So
I'm booting all linux OS with net.ifnames=0 to get predictive ethX back :-).

> Hopefully it will work just as swimmingly with Windows and other flavours of
> Linux for the rest of the client machines.

Most smart linux distros should do (i.e. debian based), because of two
things:

* no direct references to device files like /dev/vda vs. /dev/sda in fstab,
bootloader, kernel command line etc.

* kernel modules for common storage controllers included in ramdisk
(vmw_pvscsi, virtio ...)

Some enterprise distros (i.e. dracut based) are smarter: they build the
ramdisk only with modules included to boot on this hardware. Before changing
hypervisor one has to enforce to include other drivers too.

Windows may be tricky. But I don't know really. The problem may be the same:
storage driver not included for boot.

Thanks, Sascha.
Reply all
Reply to author
Forward
0 new messages