public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Friedrich Weber <f.weber@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Hannes Duerr <h.duerr@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server 1/1] fix 1734: clone VM: if deactivation fails demote error to warning
Date: Wed, 6 Mar 2024 15:04:10 +0100	[thread overview]
Message-ID: <5a2c2cae-1974-4f45-8a58-30ff7792a8f7@proxmox.com> (raw)
In-Reply-To: <f5e14f69-54d3-4ed7-a42e-11f7241ce659@proxmox.com>

Am 06.03.24 um 14:14 schrieb Friedrich Weber:
> On 06/03/2024 13:40, Fiona Ebner wrote:
>> Am 06.03.24 um 11:47 schrieb Hannes Duerr:
>>> @@ -3820,7 +3821,13 @@ __PACKAGE__->register_method({
>>>  
>>>  		if ($target) {
>>>  		    # always deactivate volumes - avoid lvm LVs to be active on several nodes
>>> -		    PVE::Storage::deactivate_volumes($storecfg, $vollist, $snapname) if !$running;
>>> +		    eval {
>>> +			PVE::Storage::deactivate_volumes($storecfg, $vollist, $snapname) if !$running;
>>> +		    };
>>> +		    my $err = $@;
>>> +		    if ($err) {
>>> +			log_warn("$err\n");
>>> +		    }
>>>  		    PVE::Storage::deactivate_volumes($storecfg, $newvollist);
>>
>> We might also want to catch errors here. Otherwise, the whole clone
>> operation (which might've taken hours) can still fail just because of a
>> deactivation error. But when failing here, we shouldn't move the config
>> file (or the LV can get active on multiple nodes more easily).
> 
> I think succeeding but not moving the config file when deactivating
> $newvollist fails sounds like it could lead to unexpected behavior.
> Right now, when running `qm clone 101 [...] --target node2` on node1
> succeeds, one can be sure there will be an VM 101 on node2. But if we
> cannot deactivate $newvollist and thus don't move the config file, the
> command succeeds but VM 101 instead exists on node1 (correct me if I'm
> wrong), which may be confusing e.g. if the clone is automated.
> 

Yes, but the question is what is worse: Needing to re-do the clone or
having the VM config on the wrong node?

> To avoid that, I'd lean towards keeping the behavior of failing the task
> if deactivating $newvollist fails. After all, at least in case of LVM
> not being able to deactivate because the device is in use, we just
> created $newvollist so hopefully nobody else should be accessing it.

Fine by me. Yes, it's unlikely to fail. And we can still adapt later if
users ever complain about it.




  reply	other threads:[~2024-03-06 14:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 10:47 Hannes Duerr
2024-03-06 11:37 ` Friedrich Weber
2024-03-06 12:31   ` Fiona Ebner
2024-03-06 12:40 ` Fiona Ebner
2024-03-06 13:14   ` Friedrich Weber
2024-03-06 14:04     ` Fiona Ebner [this message]
2024-03-06 14:19       ` Hannes Dürr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a2c2cae-1974-4f45-8a58-30ff7792a8f7@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=f.weber@proxmox.com \
    --cc=h.duerr@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal