-
Bug
-
Resolution: Won't Do
-
Undefined
-
None
-
rhel-9.5
-
No
-
None
-
rhel-virt-core-libvirt-1
-
ssg_virtualization
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
x86_64
-
None
What were you trying to do that didn't work?
Deleting a in-use volume via "virsh vol-delete" completes successfully even if the volume is open and in use by a running virtual machine. The virtual machine does not see anything wrong until it is stopped and restarted (which can happen weeks/months later) - at this point, the disk becomes inaccessible.
This is aggravated by the fact that any host filesystem-level snapshots successive to the delete operation, but prior to vm stop, will not contain the deleted file. In other words the running virtual machine can continue to accumulate new data for extended periods of time, which are bound to be immediately lost when the vm is stopped.
Before deleting a volume, "virsh vol-delete" should check if the volume really is inactive (eg: a write lock can be obtained) and stop otherwise, unless a "--force" option is given.
What is the impact of this issue to you?
See above
Please provide the package NVR for which the bug is seen:
libvirt-10.5.0-7.el9_5
How reproducible is this bug?:
Always
Steps to reproduce
- start a vm with a test disk attached
- delete the test disk via "virsh vol-delete <testdisk> <pool>"
- from the vm, read/write something (it will succeeds)
- stop the vm
- start the vm (it will fail)
Expected results
"virsh vol-delete" should not delete a volume which is in active use.
Actual results
"virsh vol-delete" currently deletes an in-use volume without further checking.