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

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Apr 15 09:11:35 CEST 2020


On April 14, 2020 2:02 pm, Fabian Ebner wrote:
> 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
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




More information about the pve-devel mailing list