Ask Your Question
0

Libvirt/KVM snapshot only in RAW image format ?

asked 2011-08-08 10:06:09 -0500

ethuleau gravatar image

When I create an image from a running instance with the Libvirt driver, nova-compute create a copy of the QCOW2 running image in RAW image format. Why it converts the QCOW2 image to RAW image ?

I try to change the qemu-img convert command (in method 'snapshot' of class 'LibvirtConnection') to create snapshot in QCOW2 format. The image is correctly created but nova fails to boot the new image. I can see in nova-compute logs a warning about it cannot inject key into image. I check if I can manually boot with KVM this image and it works nicely.

edit retag flag offensive close merge delete

5 answers

Sort by ยป oldest newest most voted
0

answered 2011-08-10 14:07:46 -0500

ethuleau gravatar image

Ok, I made a mistake. It works nicely if I change the command 'qemu-img convert' by : qemu_img_cmd = (FLAGS.qemu_img, 'convert', '-f', 'qcow2', '-O', 'qcow2', '-s', snapshot_name, disk_path, out_path) in method 'snapshot' of class 'LibvirtConnection'. The new converted QCow2 file doesn't depend on the backing file.

Do you think it's interesting to implement that. How I can propose this patch ? Through a wishlist bug ?

edit flag offensive delete link more
0

answered 2011-08-08 16:44:39 -0500

vishvananda gravatar image

The qcow images used in the instances directory are copy-on-write images. If you modified the original command, you may be getting a copy-on-write image as well. That is the only reason i can think that it wouldn't boot. QCow2 images should boot fine as long as they don't have a backing file. Perhaps change the snapshot command to still create a raw image but then convert it into a qcow2 before uploading it?

Vish

On Aug 8, 2011, at 3:11 AM, Edouard Thuleau wrote:

New question #167301 on OpenStack Compute (nova): https://answers.launchpad.net/nova/+q...

When I create an image from a running instance with the Libvirt driver, nova-compute create a copy of the QCOW2 running image in RAW image format. Why it converts the QCOW2 image to RAW image ?

I try to change the qemu-img convert command (in method 'snapshot' of class 'LibvirtConnection') to create snapshot in QCOW2 format. The image is correctly created but nova fails to boot the new image. I can see in nova-compute logs a warning about it cannot inject key into image. I check if I can manually boot with KVM this image and it works nicely.


You received this question notification because you are a member of Nova Core, which is an answer contact for OpenStack Compute (nova).

edit flag offensive delete link more
0

answered 2011-08-08 14:05:19 -0500

blamar gravatar image

Can you provide the relevant nova-compute logs? I suspect the way we're currently injecting information into disks does not work with non-raw image, but failure information would help with debugging. What you're doing is possible, so hopefully it's just a matter of figuring out exactly what is failing and going from there.

edit flag offensive delete link more
0

answered 2011-08-31 08:11:06 -0500

ethuleau gravatar image

Ok, done : https://bugs.launchpad.net/nova/+bug/824433 (https://bugs.launchpad.net/nova/+bug/...)

edit flag offensive delete link more
0

answered 2011-08-10 18:14:25 -0500

vishvananda gravatar image

You can go ahead and make a bug and propose it. Probably it should be a flag, only because people may want their snapshots as raw images for compatibility with other hypervisors.

Vish

On Aug 10, 2011, at 7:11 AM, Edouard Thuleau wrote:

Question #167301 on OpenStack Compute (nova) changed: https://answers.launchpad.net/nova/+q...

Status: Answered => Open

Edouard Thuleau is still having a problem: Ok, I made a mistake. It works nicely if I change the command 'qemu-img convert' by : qemu_img_cmd = (FLAGS.qemu_img, 'convert', '-f', 'qcow2', '-O', 'qcow2', '-s', snapshot_name, disk_path, out_path) in method 'snapshot' of class 'LibvirtConnection'. The new converted QCow2 file doesn't depend on the backing file.

Do you think it's interesting to implement that. How I can propose this patch ? Through a wishlist bug ?


You received this question notification because you are a member of Nova Core, which is an answer contact for OpenStack Compute (nova).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-08-08 10:06:09 -0500

Seen: 1,064 times

Last updated: Aug 31 '11