Ubuntu 14.04 x64 UEFI V2V Hyper-V – vSphere

Using VMware Converter to do some cold clone V2V didn’t lead to a working VM. After conversion the VM Type was set to Other (32-bit) which lead to a non booting VM, not even from .iso.

NonBootUEFI32bit

Changing it to ‘Ubuntu Linux (64-bit)’ would make it boot from CD, however, Converter had build the VM with BusLogic Parallel SCSI, and a 64-bit guest will not poweron with this adapter:

Buslogic

An error was received from the ESX host while powering on VM .
Failed to start the virtual machine.
Module DevicePowerOn power on failed.
The BusLogic SCSI adapter is not supported for 64-bit guests. See the documentation for the appropriate type of SCSI adapter to use with 64-bit guests.

Changing it to LSI Logic Parallel made this error go away.

Now we can boot, but only from CD. Using the Ubuntu install DVD .iso boot into Rescue Mode:

bootcd

Just enter thru each of the screens until it asks for the file system to use as root file system:

selectpartition

Select to one called /dev/-vg/root

bootpart

Yes we need /boot to be mounted

startshell

Now start a shell in /dev/-vg/root

confirm

In the shell type:

mount /dev/sda1 /boot/efi
grub-install --target=x86_64-efi --efi-directory=/boot/efi
exit

When returned to the Purple Rescue Mode menu, choose Reboot system.

 

Advertisement

V2V RHEV to vSphere

To convert a virtualmachine from Red Hat Enterprise Virtualization (RHEV) 3.4.1 to vSphere you can just export the VM to a (must already be assigned) Export volume.

rhev-export

This volume was exported thru NFS so it could be reached from an ESXi server.

However the files created by this export are not consumable by vSphere 6.5:

someGUID                   (GUID of the RHEV Domain)
 |-dom_md
 |-images
 | |-someGUID              (Contains 1 disk + descriptorfile)
 | |-someOtherGUID         (Contains 1 disk + descriptorfile)
 |-master
   |-tasks
   |-vms              
     |- VirtualMachineGUID (Contains .ovf file)

The disk files have no extension, and are accompanied by a .meta file.

Meta file looks something like:

DOMAIN=a1b2c3d4-e5f6-g7h8-1a2b-3c4d5e6f7g8h
VOLTYPE=LEAF
CTIME=1497337066
FORMAT=COW
IMAGE=aaaabbbb-aabb-ccdd-eeff-gghh11223344
DISKTYPE=2
PUUID=00000000-0000-0000-0000-000000000000
LEGALITY=LEGAL
MTIME=1497337138
POOL_UUID=
SIZE=104857600
TYPE=SPARSE
DESCRIPTION=
EOF

This doesn’t give a nice pointer to the diskname luckely the .ovf does:

<Section xsi:type="ovf:DiskSection_Type">
   <Info>List of Virtual Disks</Info> 
   <Disk ovf:size="60" 
         ovf:wipe-after-delete="false"
         ovf:disk-alias="myvm_Disk2"
         ovf:boot="false"
         ovf:disk-interface="VirtIO"
         ovf:volume-type="Preallocated"
         ovf:volume-format="RAW"
         ovf:format="http://www.vmware.com/specifications/vmdk.html#sparse"
         ovf:fileRef="ed4a3bd4-3e69-4cb0-b47d-b099aa867523/3a06f6ac-1879-4419-b23c-ad6f375b80d5"
         ovf:parentRef=""
         ovf:vm_snapshot_id="b7976804-3839-4d72-aa07-15fa6dccd4d7"
         ovf:actual_size="60"
         ovf:diskId="3a04e63c-1879-4419-b23c-ad6f2aeb80d5"/>
   <Disk ovf:size="40" 
         ovf:wipe-after-delete="true"
         ovf:disk-alias="myvm_Disk1"
         ovf:boot="true"
         ovf:disk-interface="VirtIO"
         ovf:volume-type="Preallocated"
         ovf:volume-format="RAW"
         ovf:format="http://www.vmware.com/specifications/vmdk.html#sparse"
         ovf:fileRef="f2c52dda-a1b1-44e7-8d9e-5216c234a3a6/c86e7cda-fd38-4b83-80cc-26de0fc81871"
         ovf:parentRef=""
         ovf:vm_snapshot_id="b7909804-3839-4d72-aa07-15ff6dccd4d7"
         ovf:actual_size="40"
         ovf:diskId="c86e7cda-fd38-4b83-80cc-26de0fc81871"/>
   <Disk ovf:size="60" ovf:wipe-after-delete="false" 
         ovf:disk-alias="myvm_Disk3"
         ovf:boot="false"
         ovf:disk-interface="VirtIO"
         ovf:volume-type="Preallocated"
         ovf:volume-format="RAW"
         ovf:format="http://www.vmware.com/specifications/vmdk.html#sparse"
         ovf:fileRef="d605aa54-5672-4a9d-ba61-fddb66427445/b4ea338d-aadd-4b15-83b3-67b74272d5a8"
         ovf:parentRef="" 
         ovf:vm_snapshot_id="b7a09804-3839-4d7a-aa07-15ffadccd4d7"
         ovf:actual_size="60" 
         ovf:diskId="b4e0a38d-aada-4b15-83a3-67b7427ad5a8"/>
</Section>

So this gives the relation between a GUID (both directory and filename) and the disk number. All thats needed is the information form the ovf:disk-alias and ovf:fileRef tags.

Under RHEVDomainGUID/images/
myvm_Disk1: f2c52dda-a1b1-44e7-8d9e-5216c234a3a6/c86e7cda-fd38-4b83-80cc-26de0fc81871
myvm_Disk2: ed4a3bd4-3e69-4cb0-b47d-b099aa867523/3a06f6ac-1879-4419-b23c-ad6f375b80d5
myvm_Disk3: d605aa54-5672-4a9d-ba61-fddb66427445/b4ea338d-aadd-4b15-83b3-67b74272d5a8

Now the filenames are known the conversion can be done.

To convert these files to .vmdk files I used the qemu-img tool with the following commandline:

qemu-img convert ./f2c52dda-a1b1-44e7-8d9e-5216c234a3a6/c86e7cda-fd38-4b83-80cc-26de0fc81871 –O vmdk ./myvm_Disk1.vmdk –p
-o output format (VMDK)
-p show progress

Sadly the vmdk file that is the result of this convert is not consumable by ESXi just yet.

Get the file somewhere the ESXi server can read it, and use vmkfstools to convert it again.

vmkfstools -i myvm_Disk1.vmdk -d thin myvm-Disk1.vmdk

Now the file can be added to a new vSphere VM.