boot from iso doesn't work with snapshot with libvirt

Bug #1023492 reported by Yun Mao
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Mark McLoughlin
qemu-kvm
Unknown
Unknown

Bug Description

how to reproduce: boot from an iso image, then take a snapshot. error:

2012-07-11 11:48:39 TRACE nova.openstack.common.rpc.amqp Command: qemu-img convert -f qcow2 -O iso -s fb623355936c473fba1f805d097fb1db /opt/stack/nova/instances/instance-00000004/disk /opt/stack/nova/instances/snapshots/tmpBaLThN/fb623355936c473fba1f805d097fb1db
2012-07-11 11:48:39 TRACE nova.openstack.common.rpc.amqp Exit code: 1
2012-07-11 11:48:39 TRACE nova.openstack.common.rpc.amqp Stdout: ''
2012-07-11 11:48:39 TRACE nova.openstack.common.rpc.amqp Stderr: "qemu-img: Unknown file format 'iso'\n"
2012-07-11 11:48:39 TRACE nova.openstack.common.rpc.amqp

It tries to snapshot the root device which is the iso file.

Revision history for this message
Douglas A. Maske (doug-maske-r) wrote :
Download full text (4.5 KiB)

We are having the same issue right now, we built CentOS 6.2 64-bit from an ISO image, I try to snapshot it as a baseline image and I get the following:
2012-07-12 10:10:04 AUDIT nova.compute.manager [req-86422db7-f199-4870-a1b6-66cd26a27c43 b814182cb2ef4649add2f4194401cb8e 35dd40c123c74d90841c9802b1061229] instance 80aa96a7-405e-4231-a91a-ac8ca943541a: snapshotting
2012-07-12 10:11:09 WARNING nova.compute.manager [-] Found 1 in the database and 0 on the hypervisor.
2012-07-12 10:11:11 INFO nova.virt.libvirt.connection [-] Compute_service record updated for artim-cloud01.td.teradata.com
2012-07-12 10:11:11 INFO nova.compute.manager [-] Updating host status
2012-07-12 10:11:15 ERROR nova.rpc.amqp [req-86422db7-f199-4870-a1b6-66cd26a27c43 b814182cb2ef4649add2f4194401cb8e 35dd40c123c74d90841c9802b1061229] Exception during message handling
2012-07-12 10:11:15 TRACE nova.rpc.amqp Traceback (most recent call last):
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/rpc/amqp.py", line 253, in _process_data
2012-07-12 10:11:15 TRACE nova.rpc.amqp rval = node_func(context=ctxt, **node_args)
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/exception.py", line 114, in wrapped
2012-07-12 10:11:15 TRACE nova.rpc.amqp return f(*args, **kw)
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 183, in decorated_function
2012-07-12 10:11:15 TRACE nova.rpc.amqp sys.exc_info())
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-07-12 10:11:15 TRACE nova.rpc.amqp self.gen.next()
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 177, in decorated_function
2012-07-12 10:11:15 TRACE nova.rpc.amqp return function(self, context, instance_uuid, *args, **kwargs)
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 952, in snapshot_instance
2012-07-12 10:11:15 TRACE nova.rpc.amqp self.driver.snapshot(context, instance_ref, image_id)
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/exception.py", line 114, in wrapped
2012-07-12 10:11:15 TRACE nova.rpc.amqp return f(*args, **kw)
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/connection.py", line 708, in snapshot
2012-07-12 10:11:15 TRACE nova.rpc.amqp image_format)
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/utils.py", line 223, in extract_snapshot
2012-07-12 10:11:15 TRACE nova.rpc.amqp execute(*qemu_img_cmd)
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/utils.py", line 35, in execute
2012-07-12 10:11:15 TRACE nova.rpc.amqp return utils.execute(*args, **kwargs)
2012-07-12 10:11:15 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/utils.py", line 243, in execute
2012-07-12 10:11:15 TRACE nova.rpc.amqp cmd=' '.join(cmd))
2012-07-12 10:11:15 TRACE nova.rpc.amqp Proc...

Read more...

Changed in qemu-kvm:
importance: Undecided → Unknown
status: New → Unknown
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hi,

did you mean to mark this as affecting the qemu-kvm package, or the project? (To mark it as affecting qemu-kvm package, choose 'Also affects distribution' and pick distribution Ubuntu and project qemu-kvm).

However, since qemu-kvm does not support an 'iso' output format for snapshots, I'm not sure that was your intent (so I won't do it for you as I'd likely be doing the wrong thing :).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/10530

Changed in nova:
assignee: nobody → Mark McLoughlin (markmc)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/10530
Committed: http://github.com/openstack/nova/commit/af0651946010e6bcc966005aa9fc2a1f38d3748a
Submitter: Jenkins
Branch: master

commit af0651946010e6bcc966005aa9fc2a1f38d3748a
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
    we can only be extracting from a qcow2 image since snapshots
    only work where use_cow_images=True. See also #1030844.

    Change-Id: I21ff6db8ebb59a83d27f224283fb76f582c38a0e

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.