From b50812f9418f088263f11a09d7c9d4b56d5c802f Mon Sep 17 00:00:00 2001 From: Wolfgang Link Date: Thu, 10 Sep 2015 10:29:10 +0200 Subject: [PATCH] rbd: skip unmap if device is not mapped --- PVE/Storage/RBDPlugin.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index ae6ed53..9e84266 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storage/RBDPlugin.pm @@ -510,6 +510,8 @@ sub deactivate_volume { my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd'; my $path = "/dev/rbd/$pool/$name"; + return if ! -b $path; + my $cmd = &$rbd_cmd($scfg, $storeid, 'unmap', $path); run_rbd_command($cmd, errmsg => "can't unmount rbd volume $name");