From f44e50fed1baa31cd879e3e08d19eb71e611261c Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 14 Mar 2016 16:21:39 +0100 Subject: [PATCH] lvmthin: activate base volumes create_base() uses '-ky' to prevent base images from being activated by default, similar to snapshots. This means we need to activate them like snapshots with the '-K' option. --- PVE/Storage/LvmThinPlugin.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PVE/Storage/LvmThinPlugin.pm b/PVE/Storage/LvmThinPlugin.pm index c8b48f0..c834a22 100644 --- a/PVE/Storage/LvmThinPlugin.pm +++ b/PVE/Storage/LvmThinPlugin.pm @@ -209,6 +209,9 @@ sub activate_volume { my $snapvol = "snap_${volname}_$snapname"; my $cmd = ['/sbin/lvchange', '-ay', '-K', "$vg/$snapvol"]; run_command($cmd, errmsg => "activate_volume '$vg/$snapvol' error"); + } elsif ($volname =~ /^base-/) { + my $cmd = ['/sbin/lvchange', '-ay', '-K', "$vg/$volname"]; + run_command($cmd, errmsg => "activate_volume '$vg/$volname' error"); } else { # other volumes are active by default } @@ -224,6 +227,9 @@ sub deactivate_volume { my $snapvol = "snap_${volname}_$snapname"; my $cmd = ['/sbin/lvchange', '-an', "$vg/$snapvol"]; run_command($cmd, errmsg => "deactivate_volume '$vg/$snapvol' error"); + } elsif ($volname =~ /^base-/) { + my $cmd = ['/sbin/lvchange', '-an', "$vg/$volname"]; + run_command($cmd, errmsg => "deactivate_volume '$vg/$volname' error"); } else { # other volumes are kept active } -- 2.39.2