[pve-devel] [PATCH pve-storage 2/5] Proper check if VM/CT is running

Michael Rasmussen mir at datanom.net
Fri Jun 16 03:10:29 CEST 2017


Signed-off-by: Michael Rasmussen <mir at datanom.net>
---
 PVE/Storage/FreeNASPlugin.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/Storage/FreeNASPlugin.pm b/PVE/Storage/FreeNASPlugin.pm
index 771061e..c438519 100644
--- a/PVE/Storage/FreeNASPlugin.pm
+++ b/PVE/Storage/FreeNASPlugin.pm
@@ -1072,8 +1072,13 @@ sub free_image {
 sub volume_resize {
     my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
 
+    my $run = PVE::QemuServer::check_running($vmid);
+    if (!$run) {
+        $run = PVE::LXC::check_running($vmid);
+    }
+    
     die 'mode failure - unable to resize disk(s) on a running system due to FreeNAS bug.<br />
-		 See bug report: <a href="https://bugs.freenas.org/issues/24432" target="_blank">#24432</a><br />' 		if $running;
+		 See bug report: <a href="https://bugs.freenas.org/issues/24432" target="_blank">#24432</a><br />' 		if $run;
     
     my ($vtype, $name, $vmid) = $class->parse_volname($volname);
 
-- 
2.11.0




More information about the pve-devel mailing list