Bug 2277945 - mgr/dashboard: RBD snapshots cloned (format v2) and then deleted causes Not Found/404 in the source RBD Image
Summary: mgr/dashboard: RBD snapshots cloned (format v2) and then deleted causes Not F...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Ceph-Dashboard
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 7.1
Assignee: Ernesto Puerta
QA Contact: Sunil Angadi
Anjana Suparna Sriram
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-30 08:37 UTC by Ernesto Puerta
Modified: 2024-06-13 14:32 UTC (History)
6 users (show)

Fixed In Version: ceph-18.2.1-163.el9cp
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-13 14:32:25 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 65698 0 None None None 2024-04-30 08:37:35 UTC
Github ceph ceph pull 57151 0 None open mgr/dashboard: exclude cloned-deleted RBD snaps 2024-04-30 09:00:07 UTC
Red Hat Issue Tracker RHCEPH-8909 0 None None None 2024-04-30 08:45:26 UTC
Red Hat Issue Tracker RHCSDASH-1374 0 None None None 2024-04-30 08:45:30 UTC
Red Hat Product Errata RHSA-2024:3925 0 None None None 2024-06-13 14:32:29 UTC

Description Ernesto Puerta 2024-04-30 08:37:36 UTC
Starting with mimic/RBD clone format 2, snapshots don't require protection to be cloned. What it happens under the hood is that snapshot with clones, when deleted, are moved to the trash namespace (ID=2). However, these snapshots are still listed when using img.list_snaps().

Reproducer:
Update cluster setting: ceph osd set-require-min-compat-client mimic --yes-i-really-mean-it
Create RBD image: rbd create test_img --size 10G
Create RBD snapshot: rbd snap create test_img@test_snap
Create RBD clone (format 2): rbd clone test_img@test_snap test_clone
Delete snapshot: rbd snap rm test_img@test_snap
The following code:

import rados, rbd

cluster = rados.Rados(conffile = '/etc/ceph/ceph.conf', conf = dict (keyring = '/etc/ceph/ceph.keyring'))

cluster.connect()
ioctx = cluster.open_ioctx('rbd')

# Opening an RBD image with a cloned-and-then-deleted snapshot
img = rbd.Image(ioctx, 'test_img')

# This works
>>> for snap  in img.list_snaps(): print(snap)
{'id': 33, 'size': 1073741824, 'name': '0a0daa4f-092d-4784-98e5-a87921d45aba', 'namespace': 2, 'trash': {'original_name': 'test_snap'}}
{'id': 34, 'size': 1073741824, 'name': 'new_one', 'namespace': 0}

# This breaks
for snap  in img.list_snaps(): img.is_protected_snap(snap['name'])
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "rbd.pyx", line 2774, in rbd.requires_not_closed.wrapper
  File "rbd.pyx", line 3668, in rbd.Image.is_protected_snap
rbd.ImageNotFound: [errno 2] RBD image not found (error checking if snapshot b'test_snap'@b'0a0daa4f-092d-4784-98e5-a87921d45aba' is protected)
The solution proposed by Ilya is to filter out images belonging to namespace == RBD_SNAP_NAMESPACE_TYPE_TRASH.

Comment 8 errata-xmlrpc 2024-06-13 14:32:25 UTC
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 (Critical: Red Hat Ceph Storage 7.1 security, enhancements, and bug fix update), 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/RHSA-2024:3925


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