![Joe's picture Joe's picture](https://archive.virtualmin.com/sites/default/files/styles/thumbnail/public/pictures/picture-1-1452369194.png?itok=zngpmD9O)
The first time I attempt to delete a VM on srv3, it fals with this error:
Deleting c7d7.cloud.virtualmin.com .. .. failed : Logical volume vg_srv3/c7d7_cloud_virtualmin_com_swap is used by another device.
Deleting the VM a second time seems to successfully delete the swap file and the VM.
This may be related to Cloudmin being unable to ping the VM (I dunno if it's up or down, Cloudmin thinks it's down, but the error makes me think it's still up and network problems are preventing pings). The fact that it deletes on the second attempt further makes me think it's the VM itself hanging on to that file, and that something in the earlier delete attempt actually shut it down.
This may have something to do with something being borked on srv3, as I am not having much luck creating a functional VM. Doing more experimenting now.
Comments
Further information...if one doesn't attempt the second delete almost immediately, it will fail again. Then, if you follow up with an immediate second deletion, it will succeed. Seems very much like some sort of race condition. No idea to how to troubleshoot it beyond this point.
And, further still, the deletions of swap volumes don't actually happen, even though Cloudmin reports successful deletion on the second attempt and the VM is gone from the dropdown of managed servers.
OK, so it seems to be an issue of the underlying system. Using lvremove does report the volume is in use, even though it's not listed in /proc/mounts, mount, or lsof.
Rebooting the host system (srv3) does not alter the situation. Webmin's logical volume module and the lvremove command claim the VM is in use. So confusing.
Submitted by JamieCameron on Wed, 09/10/2014 - 20:31 Comment #4
I saw this on CentOS 7 as well - it is due to some mapper entries still existing and pointing to partitions within the LV. I'll look into it.
Oops, red herring. That was specific to one logical volume which was being mounted by the host system.
After reboot, volumes were removeable.
I found a ticket about that issue in the RHEL ticket tracker, it is allegedly fixed, though I think we're running the latest everything. Maybe it was borked from a prior boot and new ones won't have the problem.
Submitted by JamieCameron on Sat, 09/20/2014 - 12:31 Comment #7
Ok, the logical volume removal error will be fixed in the next Cloudmin release. Turns out that some /dev/mapper links need to be dmremove'd for the LV deletion to work.
Submitted by Issues on Sat, 10/04/2014 - 12:41 Comment #8
Automatically closed -- issue fixed for 2 weeks with no activity.