Deleting a machine from a KVM pod doesn't delete its disk image

Bug #1741165 reported by Michael Iatrou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Newell Jensen
2.3
Fix Released
High
Newell Jensen

Bug Description

Repro steps:
1. On a KVM pod, compose a new machine.
2. Deploy an OS on the composed machine.
3. Release the machine.
4. Delete the composed machine.
5. Observe that:
   a. The machine is no longer listed in the pod
   b. The disk image of the machine still exists under /var/lib/libvirt/images

Related branches

Revision history for this message
Michael Iatrou (michael.iatrou) wrote :

dpkg -l | grep maas
ii maas 2.3.0-6434-g all "Metal as a Service" is a physica
ii maas-cli 2.3.0-6434-g all MAAS client and command-line inte
ii maas-common 2.3.0-6434-g all MAAS server common files
ii maas-dhcp 2.3.0-6434-g all MAAS DHCP server
ii maas-dns 2.3.0-6434-g all MAAS DNS server
ii maas-proxy 2.3.0-6434-g all MAAS Caching Proxy
ii maas-rack-cont 2.3.0-6434-g all Rack Controller for MAAS
ii maas-region-ap 2.3.0-6434-g all Region controller API service for
ii maas-region-co 2.3.0-6434-g all Region Controller for MAAS
ii python3-maas-c 2.3.0-6434-g all MAAS python API client (Python 3)
ii python3-maas-p 2.3.0-6434-g all MAAS server provisioning librarie

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Does virsh still list the volume?

Changed in maas:
status: New → Incomplete
Revision history for this message
Michael Iatrou (michael.iatrou) wrote :

Yes it does.

Changed in maas:
status: Incomplete → Triaged
importance: Undecided → High
milestone: none → 2.4.0alpha1
Changed in maas:
milestone: 2.4.0alpha1 → 2.4.0alpha2
Revision history for this message
Newell Jensen (newell-jensen) wrote :

The virsh command executed in MAAS fails with Virsh as well:

$ virsh undefine strong-oriole --remove-all-storage --delete-snapshots --managed-save
Domain strong-oriole has been undefined
error: Failed to remove storage volume 'vda'(/var/lib/libvirt/images/e0f3203e-4872-4111-8ad3-91d1b27fc6e3)
error: unsupported flags (0x2) in function virStorageBackendVolDeleteLocal

This is the reason the storage volumes are not being removed.

Revision history for this message
Newell Jensen (newell-jensen) wrote :

Taking out the --delete-snapshots flag allows the command to succeed:

$ virsh undefine apt-prawn --managed-save --remove-all-storage
Domain apt-prawn has been undefined
Volume 'vda'(/var/lib/libvirt/images/824fb9c8-5d9c-4223-83b6-faa2e8218fb5) removed.

Revision history for this message
Newell Jensen (newell-jensen) wrote :

This seems to be a bug with virsh but for a workaround by removing the --delete-snapshots flag.

Changed in maas:
assignee: nobody → Newell Jensen (newell-jensen)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.