[SRU] It's not possible to upload a volume that was build from an image back to glance, if multistore (glance) is enabled.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Medium
|
Unassigned | ||
Ubuntu Cloud Archive |
Fix Released
|
Undecided
|
Unassigned | ||
Yoga |
Fix Released
|
High
|
Unassigned | ||
Zed |
Fix Released
|
High
|
Unassigned | ||
cinder (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
High
|
Unassigned | ||
Kinetic |
Fix Released
|
High
|
Unassigned |
Bug Description
* SRU TEMPLATE AT THE BOTTOM *
Brief description:
Cinder (including Wallaby release) is not able to upload a volume that was build from an image back to glance, if multistore (glance) is enabled.
Details:
After enabling glance multistore there will be two extra properties with every image. Those are `os_glance_
If cinder creates a volume from an imageRef it will store all image_metadata with that volume, including `os_glance_
Using the cinder action `volume_
INFO cinder.volume.api [req-321adb05-
INFO cinder.volume.api [req-321adb05-
DEBUG glanceclient.
ERROR cinder.volume.api [req-321adb05-
ERROR cinder.volume.api Traceback (most recent call last):
ERROR cinder.volume.api File "/var/lib/
ERROR cinder.volume.api context, self.image_
ERROR cinder.volume.api File "/var/lib/
ERROR cinder.volume.api **sent_
ERROR cinder.volume.api File "/var/lib/
ERROR cinder.volume.api return getattr(controller, method)(*args, **kwargs)
ERROR cinder.volume.api File "/var/lib/
ERROR cinder.volume.api return RequestIdProxy(
ERROR cinder.volume.api File "/var/lib/
ERROR cinder.volume.api resp, body = self.http_
ERROR cinder.volume.api File "/var/lib/
ERROR cinder.volume.api return self.request(url, 'POST', **kwargs)
ERROR cinder.volume.api File "/var/lib/
ERROR cinder.volume.api return self._handle_
ERROR cinder.volume.api File "/var/lib/
ERROR cinder.volume.api raise exc.from_
ERROR cinder.volume.api HTTPForbidden: 403 Forbidden: Access was denied to this resource.: Attribute 'os_
ERROR cinder.volume.api
INFO cinder.
INFO cinder.
This issue is known by Nova and was fixed in Nova with:
https:/
It looks like the issue is still unknown in cinder?
Howto reproduce:
1. Install devstack stable/wallaby
2. Change glance to enable multistore:
#######
*** /etc/glance/
--- /etc/glance/
*************** image_cache_dir = /opt/stack/
*** 11,16 ****
--- 11,20 ----
use_syslog = False
debug = True
+ enabled_backends = az1:file, az2:file
+ show_multiple_
+ show_image_
+
[database]
connection = mysql+pymysql:
*************** auth_type = password
*** 35,42 ****
--- 39,58 ----
[oslo_
driver = messagingv2
+ [os_glance_
+ filesystem_
+
+ [os_glance_
+ filesystem_
+
[glance_store]
+ default_backend = az1
+
+ [az1]
filesystem_
+ [az2]
+ filesystem_
+
[cors]
allowed_origin = http://
#######
mkdir /opt/stack/
mkdir /opt/stack/
mkdir /opt/stack/
systemctl restart <email address hidden>
3. Copy image to second store:
glance image-import --stores az2 --import-method copy-image $(openstack image show cirros-
4. Create a volume from an image:
openstack volume create --size 1 --image cirros-
5. Try to upload that volume to glance:
openstack image create --volume testvol --disk-format raw image-from-
This will result in a 403:
HTTP 403 Forbidden: Access was denied to this resource.: Attribute 'os_
Fix: Best would be to not store os_glance* properties with a volume but we should also remove those properties when a volume is uploaded to glance.
============
SRU TEMPLATE
============
[Impact]
The issue impacts workflows when downloading an image from glance and then uploading it back to glance, because of the extra metadata. The easy workaround is to manually delete the metadata for every image downloaded from glance prior to uploading the volumes. The fix changed code only on the upload-
[TestCase]
1. Setting up env
1a. Deploy an environment with more than 1 store for glance, such as ceph + swift
1b. Upload cirros image to glance
1c. Add the cirros image to swift store
glance image-import <image-id> --stores swift --import-method copy-image
1d. List images including store to confirm
glance image-list --include-store
1e. Create a volume using the image
openstack volume create --size 1 --image <image-id/name> testvol
1f. Confirm the "os_glance..." image metadata is in the volume
openstack volume show testvol
2. Reproducing the issue
openstack image create --volume testvol --disk-format raw image-from-
Result should be:
HTTP 403 Forbidden: Access was denied to this resource.: Attribute 'os_
3. Cleanup not needed
4. Install package that contains the fixed code
5. Adjust cinder.conf as a workaround to issue in comment #21
glance_
6. Restart cinder services if needed
7. Repeat command in (2), result should now succeed.
[Regression Potential]
Fix has been tested in the Upstream Cinder CI (not specific scenario) and through unit tests. Behavior is configurable through config option. In case the code for the upload-
Related branches
- Corey Bryant: Pending requested
-
Diff: 273 lines (+251/-0)3 files modifieddebian/changelog (+6/-0)
debian/patches/lp1945500.patch (+244/-0)
debian/patches/series (+1/-0)
- Corey Bryant: Pending requested
-
Diff: 269 lines (+247/-0)3 files modifieddebian/changelog (+6/-0)
debian/patches/lp1945500.patch (+240/-0)
debian/patches/series (+1/-0)
CVE References
description: | updated |
summary: |
- filter reserved image properties + [stable/wallaby] filter reserved image properties |
Changed in cinder: | |
status: | Incomplete → In Progress |
summary: |
- [stable/wallaby] filter reserved image properties + It's not possible to upload a volume that was build from an image back + to glance, if multistore (glance) is enabled. |
tags: | added: glance image multistore upload-to-image |
tags: | added: sts |
summary: |
- It's not possible to upload a volume that was build from an image back - to glance, if multistore (glance) is enabled. + [SRU] It's not possible to upload a volume that was build from an image + back to glance, if multistore (glance) is enabled. |
description: | updated |
tags: | added: sts-sru-needed |
Changed in cloud-archive: | |
status: | New → Fix Released |
Changed in cinder (Ubuntu): | |
status: | New → Fix Released |
Changed in cinder (Ubuntu Jammy): | |
importance: | Undecided → High |
Changed in cinder (Ubuntu Kinetic): | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in cinder (Ubuntu Jammy): | |
status: | New → Triaged |
Changed in cinder: | |
status: | Fix Released → Triaged |
tags: |
added: verification-failed verification-failed-jammy verification-failed-kinetic verification-yoga-failed verification-zed-failed removed: verification-needed verification-needed-jammy verification-needed-kinetic verification-yoga-needed verification-zed-needed |
description: | updated |
tags: |
added: verification-failed verification-failed-jammy verification-failed-kinetic verification-yoga-failed verification-zed-failed removed: verification-needed verification-needed-jammy verification-needed-kinetic verification-yoga-needed verification-zed-needed |
Could anybody please confirm this is a bug?