improve error messages
This commit is contained in:
@ -1312,7 +1312,7 @@ sub vdisk_alloc {
|
||||
|
||||
my $cmd = ['/sbin/lvcreate', '-aly', '--addtag', "pve-vm-$vmid", '--size', "${size}k", '--name', $name, $vg];
|
||||
|
||||
run_command ($cmd);
|
||||
run_command($cmd, errmsg => "lvcreate '$vg/pve-vm-$vmid' error");
|
||||
|
||||
return "$storeid:$name";
|
||||
|
||||
@ -1350,7 +1350,7 @@ sub vdisk_free {
|
||||
|
||||
my $cmd = ['/sbin/lvremove', '-f', "$vg/$volname"];
|
||||
|
||||
run_command ($cmd);
|
||||
run_command($cmd, errmsg => "lvremove '$vg/$volname' error");
|
||||
} elsif ($scfg->{type} eq 'iscsi') {
|
||||
die "can't free space in iscsi storage\n";
|
||||
} else {
|
||||
@ -1428,12 +1428,12 @@ sub lvm_create_volume_group {
|
||||
# so pe_start is aligned on a 128k boundary (advantage for SSDs)
|
||||
my $cmd = ['/sbin/pvcreate', '--metadatasize', '250k', $device];
|
||||
|
||||
run_command ($cmd);
|
||||
run_command($cmd, errmsg => "pvcreate '$device' error");
|
||||
|
||||
$cmd = ['/sbin/vgcreate', $vgname, $device];
|
||||
# push @$cmd, '-c', 'y' if $shared; # we do not use this yet
|
||||
|
||||
run_command ($cmd);
|
||||
run_command($cmd, errmsg => "vgcreate $vgname $device error");
|
||||
}
|
||||
|
||||
sub lvm_vgs {
|
||||
@ -1771,7 +1771,7 @@ sub nfs_mount {
|
||||
push @$cmd, '-o', $options;
|
||||
}
|
||||
|
||||
run_command ($cmd);
|
||||
run_command($cmd, errmsg => "mount error");
|
||||
}
|
||||
|
||||
sub uevent_seqnum {
|
||||
@ -2017,10 +2017,12 @@ sub deactivate_storage {
|
||||
|
||||
my $cmd = ['/bin/umount', $path];
|
||||
|
||||
run_command ($cmd) if nfs_is_mounted ($server, $export, $path, $mountdata);
|
||||
run_command($cmd, errmsg => 'umount error')
|
||||
if nfs_is_mounted ($server, $export, $path, $mountdata);
|
||||
|
||||
} elsif ($type eq 'lvm') {
|
||||
my $cmd = ['/sbin/vgchange', '-aln', $scfg->{vgname}];
|
||||
run_command ($cmd);
|
||||
run_command($cmd, errmsg => "can't deactivate VG '$scfg->{vgname}'");
|
||||
} elsif ($type eq 'iscsi') {
|
||||
my $portal = $scfg->{portal};
|
||||
my $target = $scfg->{target};
|
||||
|
||||
Reference in New Issue
Block a user