You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
KVM: deleting a volume with Ceph RBD-only snapshots takes 5 minutes and leaves the snapshots undeletable #14931
On KVM with Ceph RBD primary storage and snapshot.backup.to.secondary=false, a volume snapshot exists only as an RBD snapshot of the volume's image. Deleting such a volume, or expunging a VM whose ROOT volume has such snapshots:
takes about 5 minutes, and
leaves the snapshots listed as BackedUp. They cannot be used: creating a volume from one fails after another 5 minutes. They cannot be deleted either: every deleteSnapshot fails after 5 minutes with "Failed to delete snapshot chain". Only a database edit removes them.
Deleting the volume removes its RBD snapshots together with the image. The management server then deletes each of the volume's primary-only snapshots (VolumeServiceImpl.deleteKvmSnapshotOnPrimary), and the agent's KVMStorageProcessor.deleteSnapshot looks the image up through KVMStoragePoolManager.getPhysicalDisk. That call retries a missing volume 100 times, 3 seconds apart, because it waits for volumes created on another host to appear. After the retries the delete fails. deleteVolumeCallback logs and ignores the failure, so markVolumeSnapshotsAsDestroyed never runs.
versions
4.22 and main, KVM, Ceph RBD primary storage, snapshot.backup.to.secondary=false.
The steps to reproduce the bug
Set snapshot.backup.to.secondary=false and restart the management server.
Create a data volume on an RBD pool, attach it to a VM, take a volume snapshot, detach it.
deleteVolume: it returns after about 5 minutes. rbd ls shows the image is gone.
listSnapshots: the snapshot is still listed, BackedUp.
deleteSnapshot on it: fails after about 5 minutes, every time.
What to do about it?
A snapshot whose RBD image no longer exists has nothing left to remove. The agent should look the image up once, and answer the delete as successful when librbd reports the image as not found. That also makes snapshots already left behind this way deletable through the normal API.
Activity
kvm: treat an RBD snapshot whose image is gone as deleted
kvm: treat an RBD snapshot whose image is gone as deleted