]> git.proxmox.com Git - qemu-server.git/commitdiff
clone_vm : only deactivate sources volume if source vm if offline
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 24 Feb 2016 11:00:32 +0000 (12:00 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 25 Feb 2016 07:48:12 +0000 (08:48 +0100)
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@odiso.com>
PVE/API2/Qemu.pm

index 226e597d899b6ea0d83b14439f9eb32e477b1585..bf6f6fd75d50c64a0dc5bdaab4867f4d045b24af 100644 (file)
@@ -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"