2

I'll have to migrate several computers from Hyper-V to VmWare. I would like to use qemu-img because is command line and I could create an script. Conversion works fine for Windows but is not working for Linux Red hat 7

Target vmware is an ESX

Note: Virtual machines are configured to use UEFI

I've tried several options..

1) With 'compat6' option
qemu-img convert -f vhdx RHEL7.6.VHDX -O vmdk -o adapter_type=lsilogic,compat6 rhel7.6.vmdk

2) with only 'lsilogic'
qemu-img convert -f vhdx RHEL7.6.VHDX -O vmdk -o adapter_type=lsilogic rhel7.6.vmdk

3) and without any option
qemu-img convert -f vhdx RHEL7.6.VHDX -O vmdk rhel7.6.vmdk

Once file is converted I use the vmkfstools to create a new file like to have vmdk header.

vmkfstools -i rhel7.6.vmdk -d thin final-rhel7.6.vmdk

Then I mount disk as SCSCI (when I transformed with 1 or 2 (above) commands), but It fails with a dracut timeout message.

The only transformation that is working is when I use the 3rd command, but Disk is configured as IDE.

Although IDE works I can't configure in this way, because is mandatory for us that Disks should be SCSI

Any idea, about how to convert an Hyper-v RHEL7 using qemu ?

Regards

Uh Trog
  • 103
  • 3
  • 10

1 Answers1

0

I thought that my problem was with the qemu conversion, but after some searches the problem was that target image doesn't contain the required drivers to boot.

I've wrote this short description with the method that I used to convert to ESXi using qemu, perhaps may help others.

First I've converted to 'vmdk' with this sentence

qemu-img convert -f vhdx RHEL7.6.VHDX -O vmdk -o adapter_type=lsilogic,compat6 temprhel7.6.vmdk

then I've uploaded to ESXi and used vmkfstools in this way, and I removed temporary conversion.

vmkfstools -i temprhel7.6.vmdk -d thin final-rhel7.6.vmdk 
rm temprhel7.6.vmdk

Note: The vmkfstools creates a new vmdk file header ror target disk.

Then on VmWare I've created an empty virtual machine and I've attached the "final-rhel7.6.vmdk". Virtual machine was configured to boot in UEFI, and scsi was set to "LSI Logic Sas"

On target virtual machine I've also attached an RHEL7 iso to boot with recovery disk. And I've followed the procedure to recreate initramfs using "dracut -f"

note: "dracut -f" may be used without options, but if you are using an specific version you must indicate it For example:

dracut -f /boot/initramfs-2.6.32-220.7.1.el6.x86_64.img 2.6.32-220.7.1.el6.x86_64

This recovery procedure was published at "https://access.redhat.com/solutions/1958" and also in others post.

I guess that drivers could be added before virtual machine conversion, but I'll have a basic knowledge on this area. But I guess that should be something similar to this recipe that I've found for SUSE enterprise dracut --force --add-drivers "vmw_pvscsi scsi_transport libsas mptbase mptspi" /boot/initramsfs....

Hope this helps to somebody

Uh Trog
  • 103
  • 3
  • 10