do not activate LVM volumes with vgchange -aly
This commit is contained in:
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ RELEASE=2.0
|
|||||||
|
|
||||||
VERSION=2.0
|
VERSION=2.0
|
||||||
PACKAGE=libpve-storage-perl
|
PACKAGE=libpve-storage-perl
|
||||||
PKGREL=6
|
PKGREL=7
|
||||||
|
|
||||||
DESTDIR=
|
DESTDIR=
|
||||||
PREFIX=/usr
|
PREFIX=/usr
|
||||||
|
|||||||
@ -1877,8 +1877,8 @@ sub __activate_storage_full {
|
|||||||
warn $@ if $@;
|
warn $@ if $@;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $cmd = ['/sbin/vgchange', '-aly', $scfg->{vgname}];
|
# we do not acticate any volumes here ('vgchange -aly')
|
||||||
run_command ($cmd, outfunc => sub {});
|
# instead, volumes are activate individually later
|
||||||
|
|
||||||
} elsif ($type eq 'iscsi') {
|
} elsif ($type eq 'iscsi') {
|
||||||
|
|
||||||
@ -1931,7 +1931,11 @@ sub activate_storage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub activate_volumes {
|
sub activate_volumes {
|
||||||
my ($cfg, $vollist) = @_;
|
my ($cfg, $vollist, $exclusive) = @_;
|
||||||
|
|
||||||
|
return if !($vollist && scalar(@$vollist));
|
||||||
|
|
||||||
|
my $lvm_activate_mode = $exclusive ? 'ey' : 'ly';
|
||||||
|
|
||||||
my $storagehash = {};
|
my $storagehash = {};
|
||||||
foreach my $volid (@$vollist) {
|
foreach my $volid (@$vollist) {
|
||||||
@ -1949,9 +1953,8 @@ sub activate_volumes {
|
|||||||
my $path = path ($cfg, $volid);
|
my $path = path ($cfg, $volid);
|
||||||
|
|
||||||
if ($scfg->{type} eq 'lvm') {
|
if ($scfg->{type} eq 'lvm') {
|
||||||
my $cmd = ['/sbin/lvchange', '-aly', $path];
|
my $cmd = ['/sbin/lvchange', "-a$lvm_activate_mode", $path];
|
||||||
eval { run_command ($cmd); };
|
run_command($cmd, errmsg => "can't activate LV '$volid'");
|
||||||
warn $@ if $@;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# check is volume exists
|
# check is volume exists
|
||||||
@ -1966,8 +1969,11 @@ sub activate_volumes {
|
|||||||
sub deactivate_volumes {
|
sub deactivate_volumes {
|
||||||
my ($cfg, $vollist) = @_;
|
my ($cfg, $vollist) = @_;
|
||||||
|
|
||||||
|
return if !($vollist && scalar(@$vollist));
|
||||||
|
|
||||||
my $lvs = lvm_lvs ();
|
my $lvs = lvm_lvs ();
|
||||||
|
|
||||||
|
my @errlist = ();
|
||||||
foreach my $volid (@$vollist) {
|
foreach my $volid (@$vollist) {
|
||||||
my ($storeid, $volname) = parse_volume_id ($volid);
|
my ($storeid, $volname) = parse_volume_id ($volid);
|
||||||
|
|
||||||
@ -1979,11 +1985,17 @@ sub deactivate_volumes {
|
|||||||
if ($lvs->{$scfg->{vgname}}->{$name}) {
|
if ($lvs->{$scfg->{vgname}}->{$name}) {
|
||||||
my $path = path ($cfg, $volid);
|
my $path = path ($cfg, $volid);
|
||||||
my $cmd = ['/sbin/lvchange', '-aln', $path];
|
my $cmd = ['/sbin/lvchange', '-aln', $path];
|
||||||
eval { run_command ($cmd); };
|
eval { run_command ($cmd, errmsg => "can't deactivate LV '$volid'"); };
|
||||||
warn $@ if $@;
|
if (my $err = $@) {
|
||||||
|
warn $err;
|
||||||
|
push @errlist, $volid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
die "volume deativation failed: " . join(' ', @errlist)
|
||||||
|
if scalar(@errlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub deactivate_storage {
|
sub deactivate_storage {
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
libpve-storage-perl (2.0-7) unstable; urgency=low
|
||||||
|
|
||||||
|
* improve error messages
|
||||||
|
|
||||||
|
* do not activate LVM volumes with 'vgchange -aly'
|
||||||
|
|
||||||
|
-- Proxmox Support Team <support@proxmox.com> Fri, 25 Nov 2011 07:25:58 +0100
|
||||||
|
|
||||||
libpve-storage-perl (2.0-6) unstable; urgency=low
|
libpve-storage-perl (2.0-6) unstable; urgency=low
|
||||||
|
|
||||||
* improved container support
|
* improved container support
|
||||||
|
|||||||
Reference in New Issue
Block a user