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.
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