Converting raw to qcow2 - KVM

Soldato
Joined
18 May 2010
Posts
22,376
Location
London
Anyone have any experience converting KVM images from raw to qcow2?

I only found this guide after I made a small mistake.

Converting the image is easy, I'm having issues re importing to the vmhost.

So I shutdown vm, undefined it and then ran:

convert -f raw -O qcow2 vmtoconvert vmconverted.qcow2

The conversion goes fine, but when I reimport the vm it's inaccessible.

Logs say it's network related, but I assumed as it had been set up prior to conversion the IP settings would stick.

Seems not.

The guide above seems to make it sound easy, in that I just needed to edit the xml file to point to the new VM, but I think it's too late for that as I have removed/destroyed the vm since then.

"After the operation completes, you may wish to delete the original input file. You will need to update any configs that utilize the new image, such as through sudo virsh edit [VM ID] for KVM. E.g. change the type from rawto qcow2 and update the path."

How do I reimport the image using my qcow2 image?
 
Soldato
OP
Joined
18 May 2010
Posts
22,376
Location
London
OK..... I managed to sort out the importing part, but my issue is related to IP address.

If I login as root I can see the original ifcfg-eth0 file with setting but no mac address

The interface isn't coming up.

The internet seems to suggest deleting the /etc/udev/rules.d/70-persistent-net.rules and then rebooting but this file doesn't exist on my RHEL 6 system.

I seem to have an eth5 when I ran ip addr but there is no eth5 file in /etc/sysconfig/network-scripts/


----

Sorted it!! :D
 
Last edited:
Soldato
Joined
7 Apr 2008
Posts
2,655
Little late but there is no need to undefine the virtual machine, could just run virsh edit <VM> and change the corresponding disk entry :)
 
Last edited:
Back
Top Bottom