Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-71347

virsh vol-delete should not delete an in-use and opened volume

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • No
    • None
    • rhel-virt-core-libvirt-1
    • ssg_virtualization
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • 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

      1. start a vm with a test disk attached
      2. delete the test disk via "virsh vol-delete <testdisk> <pool>"
      3. from the vm, read/write something (it will succeeds)
      4. stop the vm
      5. 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.

              virt-maint virt-maint
              g.danti@assyoma.it Gionatan Danti (Inactive)
              virt-maint virt-maint
              Meina Li Meina Li
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: