rbd: make activate_volume idempotent

This commit is contained in:
Dietmar Maurer
2015-09-10 11:10:35 +02:00
parent 5dbd11531f
commit 4f6a99d8c7
2 changed files with 6 additions and 0 deletions

View File

@ -494,6 +494,10 @@ sub activate_volume {
return 1 if !$scfg->{krbd};
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd';
my $path = "/dev/rbd/$pool/$name";
return if -b $path;
my $cmd = &$rbd_cmd($scfg, $storeid, 'map', $name);
run_rbd_command($cmd, errmsg => "can't mount rbd volume $name");

View File

@ -2,6 +2,8 @@ libpve-storage-perl (4.0-21) unstable; urgency=medium
* rbd: skip unmap if device is not mapped
* rbd: make activate_volume idempotent
-- Proxmox Support Team <support@proxmox.com> Thu, 10 Sep 2015 10:43:35 +0200
libpve-storage-perl (4.0-20) unstable; urgency=medium