Make the post-if check for the target not already running more
prominent by using a full if block.
Also comment on why we ignore the error here, while the commit
changing that explained it well, this is one of the things that might
be better of with a in-code comment (as doing the deactivation is
described as important here, so one might wonder why the code
continues if that fails)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE::QemuServer::create_ifaces_ipams_ips($newconf, $newid);
if ($target) {
- # always deactivate volumes - avoid lvm LVs to be active on several nodes
- eval {
- PVE::Storage::deactivate_volumes($storecfg, $vollist, $snapname) if !$running;
- };
- log_warn($@) if ($@);
+ if (!$running) {
+ # always deactivate volumes – avoids that LVM LVs are active on several nodes
+ eval { PVE::Storage::deactivate_volumes($storecfg, $vollist, $snapname) };
+ # but only warn when that fails (e.g., parallel clones keeping them active)
+ log_warn($@) if $@;
+ }
PVE::Storage::deactivate_volumes($storecfg, $newvollist);