This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
Bug 2043165 - [RFE] Support for image import on openstack cli
Summary: [RFE] Support for image import on openstack cli
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-openstackclient
Version: 16.2 (Train)
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: OSP Team
QA Contact: Nobody
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-20 18:14 UTC by Eric Nothen
Modified: 2025-01-22 16:22 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2025-01-22 16:21:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 737625 0 None MERGED Expose flag for forcing use of import for images 2022-01-20 18:42:51 UTC
OpenStack gerrit 910218 0 None NEW Modified create_image 2024-12-19 16:30:31 UTC
Red Hat Issue Tracker   OSP-12229 0 None None None 2025-01-22 16:21:24 UTC
Red Hat Issue Tracker OSP-33525 0 None None None 2025-01-22 16:22:53 UTC

Description Eric Nothen 2022-01-20 18:14:08 UTC
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


Note You need to log in before you can comment on or make changes to this bug.