Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
This project is now read‑only. Starting Monday, February 2, please use https://ibm-ceph.atlassian.net/ for all bug tracking management.

Bug 2277945

Summary: mgr/dashboard: RBD snapshots cloned (format v2) and then deleted causes Not Found/404 in the source RBD Image
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Ernesto Puerta <epuertat>
Component: Ceph-DashboardAssignee: Ernesto Puerta <epuertat>
Status: CLOSED ERRATA QA Contact: Sunil Angadi <sangadi>
Severity: urgent Docs Contact: Anjana Suparna Sriram <asriram>
Priority: unspecified    
Version: 7.1CC: ceph-eng-bugs, cephqe-warriors, mgowri, nia, sangadi, tserlin
Target Milestone: ---   
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-18.2.1-163.el9cp Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-13 14:32:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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