Orphaned disks after deleting a VPS created by an ISO https://www.softaculous.com/board/index.php?tid=16864 <![CDATA[Orphaned disks after deleting a VPS created by an ISO]]> https://www.softaculous.com/board/index.php?tid=16864&tpg=1#p50351
When using an LVM backed storage system with the KVM hypervisor this appears to be a known issue.  Upon further determination that two unrelated VMs could coincidentally use the same LVM Volume Group during installation which leads to conflicts on the host's LVM table led me to the answer for the description of the first.  Solution is to apply an LVM global filter under /etc/lvm/lvm.conf to prevent the host system from scanning guest devices that may inadvertently use LVM-based storage themselves which could lead to conflict in the host table between VMs using matching VG names or even conflicting VG names with the host-based system itself.  This ultimately leads to the inability to remove the user's disks upon VM termination and in some cases, errors on the host's LVM table.

There are different ways the filtering can be implemented, but as I am able to accurately predict which devices are utilized for LVM backed storage on the host system, I've chosen to accept only specific devices and exclude all others.

Additional information can be found here - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/logical_volume_manager_administration/lvm_filters

/etc/lvm/lvm.conf

Code
global_filter = [ "a|^/dev/md[123-127]+|", "a|/dev/nvme.*|", "r|.*/|" ]

]]>
Thu, 23 Jul 2020 23:52:54 GMT https://www.softaculous.com/board/index.php?tid=16864&tpg=1#p50351
<![CDATA[]]> https://www.softaculous.com/board/index.php?tid=16864&tpg=0#p50326
Description:  Upon deletion of a VPS that has been installed using a Linux ISO with an LVM partition during initial setup results in an orphaned disk being present on the host system's LVM table once the VPS has been successfully deleted from the Virtual Server list.  Attempts to delete the orphaned disk result in the immediate error, "Error deleting disk(s)", which no associated errors listed in Tasks.  To remove the orphaned disk, reboot of the hardware host is necessary which subsequently allows the orphaned disk to be removed after.

LVM configuration is currently a Thin LVM (RAW) storage pool.
Using latest Virtualizor version 3.0.3p7.  Kernel 3.10.0-1127.13.1.el7.x86_64

I suspect the behavior of LVM and KVM, not necessarily Thin LVM or pool in this particular case.  Creating an LVM partitioned VPS appears to modify the host LVM tables and creates an associated LVM physical volume, volume group and logical volume.  Upon deletion of the VPS, all three storage paths remain until reboot of the host which results in the PV and VG objects being removed automatically which subsequently allows the LV orphaned disk to be deleted.

While I'm under the impression that modification of the hosts LVM table by KVM for an LVM-based VPS is expected, rebooting a production hardware node each time a client re-installs which ultimately would exhaust the storage pool as disks continue to persist could be problematic.  Ideally I would prefer a way to avoid this, or at least determine a workaround that could be used to clean up the storage over a period of time.

Thanks]]>
Wed, 22 Jul 2020 03:29:27 GMT https://www.softaculous.com/board/index.php?tid=16864&tpg=0#p50326