[pve-devel] [PATCH] clone_vm : only deactivate sources volume if source vm if offline

Alexandre Derumier aderumier at odiso.com
Wed Feb 24 12:00:32 CET 2016


We can clone online a running vm, we don't have to deactive source vm volume
if the source vm is running

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/API2/Qemu.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 226e597..bf6f6fd 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2300,7 +2300,7 @@ __PACKAGE__->register_method({
 
                     if ($target) {
 			# always deactivate volumes - avoid lvm LVs to be active on several nodes
-			PVE::Storage::deactivate_volumes($storecfg, $vollist, $snapname);
+			PVE::Storage::deactivate_volumes($storecfg, $vollist, $snapname) if !$running;
 
 			my $newconffile = PVE::QemuServer::config_file($newid, $target);
 			die "Failed to move config to node '$target' - rename failed: $!\n"
-- 
2.1.4




More information about the pve-devel mailing list