-
Epic
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
[RFE] Support for image import on openstack cli
-
False
-
False
Description of problem:
Image conversion is enabled by default on RHOSP, for example when using Ceph as backend storage [1]. However, image conversion can only be achieved when importing an image, not when uploading it [2].
The openstack cli does not yet support importing an image, therefore cannot be used to convert it on the fly. This feature is available upstream and should be backported to the openstack cli included in RHOSP.
Version-Release number of selected component (if applicable):
$ openstack --version
openstack 4.0.1
$ rpm -qf /usr/bin/openstack
python3-openstackclient-4.0.1-1.20210719133309.bff556c.el8ost.noarch
How reproducible:
Always reproducible when uploading images on RHOSP environments with Ceph storage backend and using the openstack cli.
Steps to Reproduce:
1. Download an image
$ wget -q http://download.cirros-cloud.net/0.5.2/cirros-0.5.2-x86_64-disk.img
2. Check image format
$ file cirros-0.5.2-x86_64-disk.img
cirros-0.5.2-x86_64-disk.img: QEMU QCOW Image (v3), 117440512 bytes
3. Upload image to overcloud using openstack cli:
$ openstack image create \
> --disk-format qcow2 \
> --container-format bare \
> --file ./cirros-0.5.2-x86_64-disk.img cirros-0.5.2-uploaded > /dev/null
Actual results:
Image is stored in original format.
$ openstack image show cirros-0.5.2-uploaded -c disk_format -f value
qcow2
$ openstack image save cirros-0.5.2-uploaded --file ./cirros-0.5.2-uploaded
$ file cirros-0.5.2-uploaded
cirros-0.5.2-uploaded: QEMU QCOW Image (v3), 117440512 bytes
Expected results:
An "--import" parameter should be available in order to use the import task-flow, as it is the case when using the glance cli:
$ glance image-create-via-import \
> --disk-format qcow2 \
> --container-format bare \
> --import-method web-download \
> --uri http://download.cirros-cloud.net/0.5.2/cirros-0.5.2-x86_64-disk.img \
> --name cirros-0.5.2-imported > /dev/null
$ openstack image show cirros-0.5.2-imported -c disk_format -f value
raw
Additional info:
Without this feature, customers using Ceph are forced to use glance cli (as documented on [2]), which is against the idea of using the unified command line. On top of that, unless the customer explicitly sets an upload restriction to qcow formats, could run into the performance penalty described on [4].
[1] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html-single/creating_and_managing_images/index#enabling-image-conversion
[2] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html-single/creating_and_managing_images/index#section-image-conversion
[3] https://review.opendev.org/c/openstack/python-openstackclient/+/737625
[4] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html-single/creating_and_managing_images/index#section-convert-image
- external trackers