[pve-devel] [PATCH] improve free_image with deactivate_volumes

Wolfgang Link w.link at proxmox.com
Tue Sep 8 12:23:53 CEST 2015


this is necessary to pervent aa error by trying to remove a mapped volume.
---
 PVE/Storage/RBDPlugin.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 329fd23..feb8bfc 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -407,6 +407,10 @@ sub free_image {
 	}
     }
 
+    eval {
+	$class->deactivate_volume($storeid, $scfg, $volname);
+    };
+
     my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'purge',  $name);
     run_rbd_command($cmd, errmsg => "rbd snap purge '$volname' error");
 
-- 
2.1.4





More information about the pve-devel mailing list