Bootable volume creation failed with glance image of 'ISO' format

Bug #1705407 reported by Vivek Soni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Eric Harney

Bug Description

Steps to reproduce :-
------------------------
1)Created glance image 'my_ISO' with 'ubuntu-16.04.2-server-amd64.iso'

stack@bld7064:/opt/stack/cinder$ glance image-list
+--------------------------------------+--------------------------+
| ID | Name |
+--------------------------------------+--------------------------+
| da3a58bf-c540-4a58-aa58-2fdde9667a58 | cirros-0.3.5-x86_64-disk |
| c600081c-6544-45fe-9851-f601dc8946bd | my_ISO |
+--------------------------------------+--------------------------+

2)Create bootable volume from that glance image

stack@bld7064:/opt/stack/cinder$ cinder create --image-id c600081c-6544-45fe-9851-f601dc8946bd --name volume1 --volume-type lvmdriver-1 10

stack@bld7064:/opt/stack/cinder$ cinder list
+--------------------------------------+--------+---------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+--------+---------+------+-------------+----------+-------------+
| 7d133b6b-e0d5-424e-a24d-42f07897787b | error | volume1 | 10 | lvmdriver-1 | false | |
+--------------------------------------+--------+---------+------+-------------+----------+-------------+

Error Log :-
-------------------

Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf qemu-img convert -t none -f iso -O raw /opt/stack/data/cinder/conversion/tmpEIQ4Uvworker2@lvmdriver-1 /dev/mapper/stack--volumes--lvmdriver--1-volume--7d133b6b--e0d5--424e--a24d--42f07897787b
Exit code: 1
Stdout: u''
Stderr: u"qemu-img: Could not open '/opt/stack/data/cinder/conversion/tmpEIQ4Uvworker2@lvmdriver-1': Unknown driver 'iso'\n"
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00mTraceback (most recent call last):
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/volume/flows/manager/create_volume.py", line 550, in _copy_image_to_volume
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m context, volume, image_service, image_id)
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/volume/drivers/lvm.py", line 487, in copy_image_to_volume
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m size=volume['size'])
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/image/image_utils.py", line 331, in fetch_to_raw
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m run_as_root=run_as_root)
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/image/image_utils.py", line 421, in fetch_to_volume_format
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m run_as_root=run_as_root)
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/image/image_utils.py", line 198, in convert_image
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m run_as_root=run_as_root)
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/image/image_utils.py", line 158, in _convert_image
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m utils.execute(*cmd, run_as_root=run_as_root)
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/utils.py", line 123, in execute
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m return processutils.execute(*cmd, **kwargs)
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py", line 400, in execute
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00m cmd=sanitized_cmd)
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00mProcessExecutionError: Unexpected error while running command.
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00mCommand: sudo cinder-rootwrap /etc/cinder/rootwrap.conf qemu-img convert -t none -f iso -O raw /opt/stack/data/cinder/conversion/tmpEIQ4Uvworker2@lvmdriver-1 /dev/mapper/stack--volumes--lvmdriver--1-volume--7d133b6b--e0d5--424e--a24d--42f07897787b
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00mExit code: 1
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00mStdout: u''
^[[01;31m2017-07-20 12:25:08.759 TRACE cinder.volume.flows.manager.create_volume ^[[01;35m^[[00mStderr: u"qemu-img: Could not open '/opt/stack/data/cinder/conversion/tmpEIQ4Uvworker2@lvmdriver-1': Unknown driver 'iso'\n"

Revision history for this message
Eric Harney (eharney) wrote :

sudo cinder-rootwrap /etc/cinder/rootwrap.conf qemu-img convert -t none -f iso -O raw /opt/stack/data/cinder/conversion/tmpEIQ4Uvworker2@lvmdriver-1 /dev/mapper/stack--volumes--lvmdriver--1-volume--7d133b6b--e0d5--424e--a24d--42f07897787b

"qemu-img: Could not open '/opt/stack/data/cinder/conversion/tmpEIQ4Uvworker2@lvmdriver-1': Unknown driver 'iso'\n"

This error is because qemu-img does not have support for performing "convert" on the iso format.

I think what's supposed to happen here is that the iso is just written to the volume without any conversion, leaving iso-formatted data on the new volume.

Changed in cinder:
assignee: nobody → Eric Harney (eharney)
Revision history for this message
Eric Harney (eharney) wrote :

This was likely introduced by my change here:

https://review.openstack.org/#/c/453341/

Changed in cinder:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/487584
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=a27465512c74678c498680c844e7e9d091785ca0
Submitter: Jenkins
Branch: master

commit a27465512c74678c498680c844e7e9d091785ca0
Author: Eric Harney <email address hidden>
Date: Wed Jul 26 16:13:58 2017 -0400

    Fix image download to volume for iso images

    After changes made in
      b1ebfa4f qemu_img_info: Don't autodetect source format

    ISO image downloads from Glance fail because Cinder
    calls "qemu-img convert -f iso" and "iso" is not a supported
    image format in qemu-img. These should be treated as raw
    images during the download process.

    This would also be true for any other image formats
    supported by Glance that qemu-img cannot convert, but that
    list does not seem to include anything that we previously
    supported with Cinder downloads. (aki/ari, ovf/ova, docker)

    Change-Id: Ifa427b6d9894febd80142f7fb9e2c5ba8bc72e4c
    Closes-Bug: #1705407
    Related-Bug: #1693926

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 11.0.0.0rc1

This issue was fixed in the openstack/cinder 11.0.0.0rc1 release candidate.

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.