[RBD] Image is unusable if deletion fails

Bug #1954883 reported by Abhishek Kekane
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
glance_store
Fix Released
High
Abhishek Kekane

Bug Description

Recently cinder has added clone v2 support for its RBD backend, since then if you attempt to delete an image from glance that has a dependent volume, all future uses of that image will fail in error state. Despite the fact that image itself is still inside of Ceph/Glance. This issue is reproducible if you are using ceph client version greater than 'luminous'.

Envrionment details:
Devstack master with Ceph

How to reproduce:
1.Upload the image to Glance:

$ glance image-create-via-import --disk-format qcow2 --container-format bare --name centos7-base-116-ec8e22-thin --visibility public --import-method web-download --uri https://internal/centos7-base-116-ec8e22.qcow2 --property hw_scsi_model=virtio-scsi --property hw_disk_bus=scsi

2. Create a volume from this image:
$ cinder create --image <image-id-from-step-1> --name testvolume-abhi-1 1

3. Delete image
$ glance image-delete <image-id-from-step-1>
Unable to delete image '05fa6671-86f6-469b-8385-af27da2a275f' because it is in use.

4. Now lets try to create another volume from image
$ cinder create --image <image-id-from-step-1> --name testvolume-abhi-2 1

5. Volume goes into error state;

6. Try to download the image
$ glance image-download <image-id-from-step-1> --file download.raw
Image 3ca11fd5-fef1-4264-b2e9-e5d6e8b68639 has no data.

Note;
If you set the ceph client version to luminous then step 4 and 5 are working without any issue
set ceph client to luminous using;
$sudo ceph osd set-require-min-compat-client luminous

Expected output;
For all client versions of Ceph step 4 and 5 should work without any issue.

Changed in glance-store:
assignee: nobody → Abhishek Kekane (abhishek-kekane)
Changed in glance-store:
status: New → In Progress
Changed in glance-store:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (master)

Reviewed: https://review.opendev.org/c/openstack/glance_store/+/819481
Committed: https://opendev.org/openstack/glance_store/commit/3d221ec529862d43ab303644e74ee9ad6ce8cd40
Submitter: "Zuul (22348)"
Branch: master

commit 3d221ec529862d43ab303644e74ee9ad6ce8cd40
Author: Abhishek Kekane <email address hidden>
Date: Fri Nov 26 14:58:23 2021 +0000

    [RBD] Clone v2: Image is unusable if deletion fails

    Recently cinder has utilized Ceph clone v2 support for its
    RBD backend, since then if you attempt to delete an image from
    glance that has a dependent volume, all future uses of that
    image will fail in error state. Despite the fact that image
    itself is still inside of Ceph/Glance. This issue is reproducible
    if you are using ceph client version greater than 'luminous'

    To resolve this issue glance RBD driver now checks whether snapshot
    of original image has any external references before deleting/removing
    it's snapshot and returns 409 Conflict response if it has any.

    NOTE: To check this dependency glance osd needs 'read' access to
    cinder and nova side RBD pool.

    Closes-Bug: #1954883
    Depends-on: https://review.opendev.org/c/openstack/devstack-plugin-ceph/+/819476
    Change-Id: If30b7bd7acac148b6f89ce46abbe128c678c90e7

Changed in glance-store:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance_store 3.0.0

This issue was fixed in the openstack/glance_store 3.0.0 release.

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.