From 73272365bf195c070a093649b8432ce8b68cac5e Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 29 Jan 2014 06:44:06 +0100 Subject: [PATCH] deactivate volume after clone To avoid lvm LVs to be active on several nodes. --- PVE/API2/Qemu.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index b2c8908a..b7c9d3ef 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -2387,6 +2387,13 @@ __PACKAGE__->register_method({ PVE::QemuServer::add_unused_volume($conf, $old_volid) if !$param->{delete}; PVE::QemuServer::update_config_nolock($vmid, $conf, 1); + + eval { + # try to deactivate volumes - avoid lvm LVs to be active on several nodes + PVE::Storage::deactivate_volumes($storecfg, [ $newdrive->{file} ]) + if !$running; + }; + warn $@ if $@; }; if (my $err = $@) { -- 2.39.5