[pve-devel] [PATCH container 2/2] Also free unused volumes owned by a container on removal

Fabian Ebner f.ebner at proxmox.com
Tue Apr 14 14:02:18 CEST 2020


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

This is the behavior VMs have. Check for the owner and
if it's a volume happens in delete_mountpoint_volume.

 src/PVE/LXC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 9adb366..fbe736e 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -832,7 +832,7 @@ sub delete_mountpoint_volume {
 sub destroy_lxc_container {
     my ($storage_cfg, $vmid, $conf, $replacement_conf) = @_;
 
-    PVE::LXC::Config->foreach_volume($conf, sub {
+    PVE::LXC::Config->foreach_volume_full($conf, {include_unused => 1}, sub {
 	my ($ms, $mountpoint) = @_;
 	delete_mountpoint_volume($storage_cfg, $vmid, $mountpoint->{volume});
     });
-- 
2.20.1





More information about the pve-devel mailing list