Created
November 14, 2021 17:17
-
-
Save aderumier/2ebfe372d1ee8be1cc4eb6e8ff95ec23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub activate_volume { | |
my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_; | |
my $vg = $scfg->{vgname}; | |
# only snapshot volumes needs activation | |
if ($snapname) { | |
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 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment