os-volume_upload_image action uses stale metadata

Bug #1844725 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Critical
Brian Rosmaita

Bug Description

Under some circumstances, the os-volume_upload_image action uses stale metadata. This can occur when the volume being uploaded has itself been created from an image. In this case, the volume will have the old properties stored in the volume_glance_metadata table, and these properties will be transferred to the new image being uploaded. In some flows, however, new values are assigned to image properties (for example, when the volume is encrypted). If these same image properties are present in the volume_glance_metadata table, the new values are overwritten with the stale properties in the table.

I'll put up a patch so you can see this in action before I post a patch with a fix.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/683235

Changed in cinder:
status: Triaged → In Progress
Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

https://review.opendev.org/#/c/683235/1 adds a new test that shows the bug (it fails, of course).

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

Latest patch contains the fix (and is passing).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/683235
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ecf7041adacde3764082de7fba5ae82f22d48309
Submitter: Zuul
Branch: master

commit ecf7041adacde3764082de7fba5ae82f22d48309
Author: Brian Rosmaita <email address hidden>
Date: Thu Sep 19 16:16:00 2019 -0400

    Make sure stale image metadata is not used

    When uploading a volume to an image, Cinder checks to see if there's
    any image metadata already present on the volume, and if so, it adds
    it to the image-create request so that Glance will persist these
    additional properties on the new image. If during upload preparation,
    Cinder wants to add specific metadata to the new image (for example,
    a new encryption key id), we need to ensure that the new value for
    this property is preferred to a value in the volume_glance_metadata
    table.

    Closes-bug: #1844725

    Change-Id: Iba3c5fa4db87641a84eb22a0fc93294dd55a3132

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

This issue was fixed in the openstack/cinder 15.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.