Description of problem: Disable upload of non-RAW images when CEPH is used as a glance backend ; or get a feature for automatic image conversion to RAW for the PUT API call (then this BZ needs to be cloned for glance) For further details, see: https://access.redhat.com/solutions/2434691 Cloud administrators should prohibit the upload of non-raw images into glance: https://access.redhat.com/solutions/2158611 Note that in later versions of Red Hat OpenStack Platform, Glance image conversion is automatically turned on to convert QCOW2 images into RAW images but only when using the import feature. Topenstack image create uses the PUT call to http(s)://<URL>:9292/v2/images/<UUID>/file and thus will not convert images automatically: https://bugzilla.redhat.com/show_bug.cgi?id=1666529 https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.0/html-single/instances_and_images_guide/index#section-image-conversion https://docs.openstack.org/glance/rocky/admin/interoperable-image-import.html#the-image-conversion So we still don't have an automatic image conversion feature for the PUT call. However, the PUT call is what administrators use the most. The long-standing issue that we don't support anything other than RAW + CEPH, but that admins most of the time upload qcow2 images (because that's the format that they download their images in), has IMO still not been addressed properly. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
@Greg: I think this should be reassigned to someone who is familiar with Ceph THT. Who could that be?
(In reply to Cyril Roelandt from comment #11) > @Greg: I think this should be reassigned to someone who is familiar with > Ceph THT. Who could that be? I guess best would be to have a param in THT to list the accepted disk formats but as far as I understand ultimately we don't want to change the default list, not even when using Ceph
Given we have doc that shows how to do it with overrides i don't think we need a backport https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/13/html-single/instances_and_images_guide/index#section-convert-image What we can add is a link to this section in the ceph deployment guide(s)? https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/13/html-single/deploying_an_overcloud_with_containerized_red_hat_ceph/index#Configuring_Ceph_Storage_Cluster_Settings https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/13/html-single/integrating_an_overcloud_with_an_existing_red_hat_ceph_cluster/index#integrate-cluster
VERIFIED the below illustrates that a qcow2 disk format cannot be created when not specified in /etc/glance/glance-api.conf:disk-formats --> --- [root@titan31 ~]# ssh stack@undercloud-0 Activate the web console with: systemctl enable --now cockpit.socket This system is not registered to Red Hat Insights. See https://cloud.redhat.com/ To register this system, run: insights-client --register Last login: Wed Nov 25 06:08:47 2020 [stack@undercloud-0 ~]$ rhos-release -L Installed repositories (rhel-8.2): 16.1 ceph-4 ceph-osd-4 rhel-8.2 [stack@undercloud-0 ~]$ cat /var/lib/rhos-release/latest-installed 16.1 -p RHOS-16.1-RHEL-8-20201110.n.1 [stack@undercloud-0 ~]$ rpm -qa | grep -i openstack-tripleo-heat-templates openstack-tripleo-heat-templates-11.3.2-1.20200914170172.el8ost.noarch [stack@undercloud-0 ~]$ ssh -t heat-admin.24.50 "sudo podman exec -it -u root glance_api sh -c 'rpm -qa openstack-triple0-heat-templates'" Warning: Permanently added '192.168.24.50' (ECDSA) to the list of known hosts. Connection to 192.168.24.50 closed. [stack@undercloud-0 ~]$ ssh -t heat-admin.24.50 "sudo podman exec -it -u root glance_api sh -c 'rpm -qa puppet-glance'" Warning: Permanently added '192.168.24.50' (ECDSA) to the list of known hosts. puppet-glance-15.4.1-0.20200611153438.8ac5b13.el8ost.noarch Connection to 192.168.24.50 closed. [stack@undercloud-0 ~]$ . ./stackrc (undercloud) [stack@undercloud-0 ~]$ openstack server list +--------------------------------------+--------------+--------+------------------------+----------------+------------+ | ID | Name | Status | Networks | Image | Flavor | +--------------------------------------+--------------+--------+------------------------+----------------+------------+ | 2738d272-aa10-4af5-a99c-23d6c1186196 | controller-0 | ACTIVE | ctlplane=192.168.24.50 | overcloud-full | controller | | a371dd23-7e69-4764-8a62-63813d50fb1f | controller-2 | ACTIVE | ctlplane=192.168.24.48 | overcloud-full | controller | | 2298d0be-1aa0-4737-b36b-eaad7f9ddf5b | controller-1 | ACTIVE | ctlplane=192.168.24.22 | overcloud-full | controller | | 124993d7-1fdf-4699-99d1-70ac72a25978 | compute-0 | ACTIVE | ctlplane=192.168.24.35 | overcloud-full | compute | | e758e32e-5a4f-4e03-acf3-438ff5fa2c15 | compute-1 | ACTIVE | ctlplane=192.168.24.49 | overcloud-full | compute | | a1e9c61d-db11-431d-a14a-9eba2be8203e | ceph-0 | ACTIVE | ctlplane=192.168.24.40 | overcloud-full | ceph | | 45f897b1-d5bf-44ec-9eae-975d58e8ef3a | ceph-1 | ACTIVE | ctlplane=192.168.24.27 | overcloud-full | ceph | | daa62850-72ba-4af4-952f-806bbee63314 | ceph-2 | ACTIVE | ctlplane=192.168.24.39 | overcloud-full | ceph | +--------------------------------------+--------------+--------+------------------------+----------------+------------+ (undercloud) [stack@undercloud-0 ~]$ . ./overcloudrc (overcloud) [stack@undercloud-0 ~]$ ssh -t heat-admin.24.50 "sudo podman exec -it -u root glance_api sh -c 'grep ^disk_formats /etc/glance/glance-api.conf'" Warning: Permanently added '192.168.24.50' (ECDSA) to the list of known hosts. disk_formats=raw,iso,aki,ari,ami Connection to 192.168.24.50 closed. (overcloud) [stack@undercloud-0 ~]$ (overcloud) [stack@undercloud-0 ~]$ glance image-list +--------------------------------------+----------------------------------+ | ID | Name | +--------------------------------------+----------------------------------+ | 9f636e34-b7f6-426a-8d81-55e3f8a91724 | cirros-0.4.0-x86_64-disk.img | | 3bb86ebf-4493-44f7-b5ff-7330ef8d4e1d | cirros-0.4.0-x86_64-disk.img_alt | | 13b63020-73fc-4234-9742-1552f39e422a | manila-service-image-master | | efc5b709-62b0-46d8-94dc-7e7036018f30 | test-001 | +--------------------------------------+----------------------------------+ (overcloud) [stack@undercloud-0 ~]$ glance image-create-via-import --container-format ami --disk-format qcow2 --name test-002 --import-method web-download --uri http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img Unable to set 'disk_format' to 'qcow2'. Reason: 'qcow2' is not one of [None, 'raw', 'iso', 'aki', 'ari', 'ami'] Failed validating 'enum' in schema['properties']['disk_format']: {'description': 'Format of the disk', 'enum': [None, 'raw', 'iso', 'aki', 'ari', 'ami'], 'type': ['null', 'string']} On instance['disk_format']: 'qcow2' (overcloud) [stack@undercloud-0 ~]$ glance image-create-via-import --container-format ami --disk-format ami --name test-003 --import-method web-download --uri http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | None | | container_format | ami | | created_at | 2020-11-25T06:54:25Z | | disk_format | ami | | id | 7b0343c1-8b4a-48c0-b770-053057f1ea47 | | locations | [] | | min_disk | 0 | | min_ram | 0 | | name | test-003 | | os_hash_algo | None | | os_hash_value | None | | os_hidden | False | | owner | 2be9452c2e504cb0b8fe29d40eb17a82 | | protected | False | | size | None | | status | queued | | tags | [] | | updated_at | 2020-11-25T06:54:25Z | | virtual_size | Not available | | visibility | shared | +------------------+--------------------------------------+ (overcloud) [stack@undercloud-0 ~]$ glance image-show 7b0343c1-8b4a-48c0-b770-053057f1ea47 | grep status | status | active | (overcloud) [stack@undercloud-0 ~]$ ---
THT used: (undercloud) [stack@undercloud-0 ~]$ cat glance_disk_formats.yaml parameter_defaults: GlanceDiskFormats: - raw - iso - aki - ari - ami (undercloud) [stack@undercloud-0 ~]$ grep glance_disk_formats ./overcloud_deploy.sh -e /home/stack/glance_disk_formats.yaml \ (undercloud) [stack@undercloud-0 ~]$
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Red Hat OpenStack Platform 16.1.3 bug fix and enhancement advisory), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2020:5413