kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.09k stars 365 forks source link

Kimchi does not care about deleting storage from non-kimchi VMs and migrated VMs #851

Open danielhb opened 8 years ago

danielhb commented 8 years ago

Steps to reproduce using virsh:

We'll notice that the VM disks will remain untouched after the VM delete. This happens because the code that deletes a VM removes the storage that Kimchi is aware of, using storagepools/storagevolumes objects, instead of going through the VM XML and delete all the disks.

This was a minor issue when only VMs created outside of Kimchi were affected, but after Live Migration we can re-create this same scenario inside Kimchi:

I believe that this can be fixed by verifying the VM XML after deleting all the storage Kimchi knows about and see if there's anything left to be erased. We just need to be careful not to erase any CD-ROM image declared as well.

I believe we can further enhance how Kimchi delete works but I'll create a separated issue about it.

alinefm commented 8 years ago

Hi @danielhb!

In a discussion in the ML, @pvital suggested to ask user to delete or not the disks files.

So basically, the DELETE /plugins/kimchi/vms/ will only remove the VM from the libvirt perspective and keep the disks there.

If user wants to remove the disks, he/she needs to use DELETE /plugins/kimchi/storagepools//storagevolume/ API with an additional parameter 'wipe: true|false' or something like that.

If you agree, we can use this issue for this feature as all scenarios you described will be also covered.