]> git.proxmox.com Git - pve-storage.git/commitdiff
lvmthin: activate base volumes
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 14 Mar 2016 15:21:39 +0000 (16:21 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 15 Mar 2016 05:48:59 +0000 (06:48 +0100)
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

index c8b48f0f8067bc9d52d8eda8050c50327d300536..c834a2272f98a903f0748d90e256a5d93e152a93 100644 (file)
@@ -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
     }