If you boot an instance from an image with disk_format=iso and then
attempt to snapshot (i.e. nova image-create) you currently get a
traceback because we do:
qemu-img convert -f qcow2 -O iso -s $snap $disk $out
and 'iso' is not a format that qemu-img knows anything about.
When booting the image, we use qemu-img to detect that the file is
a raw image so we avoid having to special case disk_format=iso
there. However, there's no way of avoiding the special casing when
extracting a snapshot.
Note 1 - it's not very clever to take a snapshot of a read-only
disk downloaded from glance and upload it back to glance again.
Adding such smarts would be a nice enhancement.
Note 2 - only the destination format is important here because
we can only be extracting from a qcow2 image since snapshots
only work where use_cow_images=True. See also #1030844.
Reviewed: https:/ /review. openstack. org/10530 github. com/openstack/ nova/commit/ af0651946010e6b cc966005aa9fc2a 1f38d3748a
Committed: http://
Submitter: Jenkins
Branch: master
commit af0651946010e6b cc966005aa9fc2a 1f38d3748a
Author: Mark McLoughlin <email address hidden>
Date: Mon Jul 30 13:03:39 2012 +0100
Avoid error during snapshot of ISO booted instance
Fixes bug #1023492
If you boot an instance from an image with disk_format=iso and then
attempt to snapshot (i.e. nova image-create) you currently get a
traceback because we do:
qemu-img convert -f qcow2 -O iso -s $snap $disk $out
and 'iso' is not a format that qemu-img knows anything about.
When booting the image, we use qemu-img to detect that the file is
a raw image so we avoid having to special case disk_format=iso
there. However, there's no way of avoiding the special casing when
extracting a snapshot.
Note 1 - it's not very clever to take a snapshot of a read-only
disk downloaded from glance and upload it back to glance again.
Adding such smarts would be a nice enhancement.
Note 2 - only the destination format is important here because images= True. See also #1030844.
we can only be extracting from a qcow2 image since snapshots
only work where use_cow_
Change-Id: I21ff6db8ebb59a 83d27f224283fb7 6f582c38a0e