Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Snapshot is supported for rbd image, but currently libvirt has
not concept of snapshot. Once snapshot is created outside libvirt
, libvirt can not delete this image any more. It's better to support
to delete snapshots for rbd volume at least.
Version-Release number of selected component (if applicable):
libvirt-1.2.17-13.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Create a rbd image
#rbd create rbd/rbd1.img --size 5120
2. Create a snapshot for the image
#rbd snap create rbd/rbd1.img@sn1
# rbd snap ls rbd/rbd1.img
SNAPID NAME SIZE
2 sn1 5070 MB
3. Create a rbd pool
# cat rbd-pool.xml
<pool type='rbd'>
<name>rbd</name>
<source>
<host name='10.66.x.x' port='6789'/>
<host name='10.66.x.x' port='6789'/>
<name>rbd</name>
</source>
</pool>
# virsh pool-define rbd-pool.xml
Pool rbd defined from rbd-pool.xml
# virsh pool-start rbd
Pool rbd started
# virsh vol-list rbd
Name Path
------------------------------------------------------------------------------
rbd1.img rbd/rbd1.img
yy2.img rbd/yy2.img
yy3.img rbd/yy3.img
4. delete volume - rbd1.img
# virsh vol-delete rbd1.img rbd
error: Failed to delete vol rbd1.img
error: failed to remove volume 'rbd/rbd1.img': Directory not empty
Actual results:
Libvirt cannot delete rbd snapshot
Expected results:
It's better to support to delete snapshots for rbd volume
Additional info:
Comment 2Jaroslav Suchanek
2015-11-27 11:41:44 UTC
Might be already supported in API by?
commit 3c7590e0a435d833895fc7b5be489e53e223ad95
Author: Wido den Hollander <wido>
Date: Tue Oct 27 15:16:34 2015 +0100
rbd: Remove snapshots if the DELETE_WITH_SNAPSHOTS flag has been provided
When a RBD volume has snapshots it can not be removed.
This patch introduces a new flag to force volume removal,
VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS.
With this flag any existing snapshots will be removed prior to
removing the volume.
No existing mechanism in libvirt allowed us to pass such information,
so that's why a new flag was introduced.
Signed-off-by: Wido den Hollander <wido>
Turns out the above commit was a "start", but not nearly complete enough for a general solution. It's one of those "hidden" options that one could pass a flag via the API, but it's not documented.
I'll use this bz to work through those issues.
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, 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://rhn.redhat.com/errata/RHSA-2016-2577.html
Description of problem: Snapshot is supported for rbd image, but currently libvirt has not concept of snapshot. Once snapshot is created outside libvirt , libvirt can not delete this image any more. It's better to support to delete snapshots for rbd volume at least. Version-Release number of selected component (if applicable): libvirt-1.2.17-13.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Create a rbd image #rbd create rbd/rbd1.img --size 5120 2. Create a snapshot for the image #rbd snap create rbd/rbd1.img@sn1 # rbd snap ls rbd/rbd1.img SNAPID NAME SIZE 2 sn1 5070 MB 3. Create a rbd pool # cat rbd-pool.xml <pool type='rbd'> <name>rbd</name> <source> <host name='10.66.x.x' port='6789'/> <host name='10.66.x.x' port='6789'/> <name>rbd</name> </source> </pool> # virsh pool-define rbd-pool.xml Pool rbd defined from rbd-pool.xml # virsh pool-start rbd Pool rbd started # virsh vol-list rbd Name Path ------------------------------------------------------------------------------ rbd1.img rbd/rbd1.img yy2.img rbd/yy2.img yy3.img rbd/yy3.img 4. delete volume - rbd1.img # virsh vol-delete rbd1.img rbd error: Failed to delete vol rbd1.img error: failed to remove volume 'rbd/rbd1.img': Directory not empty Actual results: Libvirt cannot delete rbd snapshot Expected results: It's better to support to delete snapshots for rbd volume Additional info: