all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Hannes Duerr <h.duerr@proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 qemu-server pve-storage 1/2] migration: secure and use source volume names for cleanup
Date: Thu, 14 Dec 2023 14:58:08 +0100	[thread overview]
Message-ID: <cf8f28a0-2a34-413e-99ce-80897b45b76b@proxmox.com> (raw)
In-Reply-To: <20231207091203.87763-2-h.duerr@proxmox.com>

Am 07.12.23 um 10:12 schrieb Hannes Duerr:
> During migration, the volume names may change if the name is already in
> use at the target location. We therefore want to save the original names
> before the migration so that we can clean up the original volumes
> afterwards.
> 

Good catch! I think 'cleanup' is not the best word in the title and
commit message. This is specifically for deactivation. E.g. removal of
local migrated volumes already works as expected.

> Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
> ---
>  PVE/QemuMigrate.pm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index b87e47a..6c9e762 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -632,6 +632,7 @@ sub sync_offline_local_volumes {
>  
>      my $local_volumes = $self->{local_volumes};
>      my @volids = $self->filter_local_volumes('offline', 0);
> +    $self->{source_volumes} = \@volids;
>  

We need to deactivate all volumes on the source node, not only the
offline migrated ones. Note that the comment below specifically mentions
shared LVM LVs.

>      my $storecfg = $self->{storecfg};
>      my $opts = $self->{opts};
> @@ -1584,10 +1585,10 @@ sub phase3_cleanup {
>  	$self->{errors} = 1;
>      }
>  
> +

Nit: extra blank should not be here

>      # always deactivate volumes - avoid lvm LVs to be active on several nodes
>      eval {
> -	my $vollist = PVE::QemuServer::get_vm_volumes($conf);
> -	PVE::Storage::deactivate_volumes($self->{storecfg}, $vollist);
> +	PVE::Storage::deactivate_volumes($self->{storecfg}, $self->{source_volumes});
>      };
>      if (my $err = $@) {
>  	$self->log('err', $err);




  reply	other threads:[~2023-12-14 13:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  9:12 [pve-devel] [PATCH v2 qemu-server pve-storage 0/2] fix #1611: implement import of base-images for LVM-thin Storage Hannes Duerr
2023-12-07  9:12 ` [pve-devel] [PATCH v2 qemu-server pve-storage 1/2] migration: secure and use source volume names for cleanup Hannes Duerr
2023-12-14 13:58   ` Fiona Ebner [this message]
2023-12-07  9:12 ` [pve-devel] [PATCH v2 qemu-server pve-storage 2/2] fix #1611: implement import of base-images for LVM-thin Storage Hannes Duerr
2023-12-14 14:23   ` Fiona Ebner
2023-12-14 14:31     ` Fiona Ebner
2023-12-18 12:02     ` Hannes Dürr
2023-12-18 13:07       ` Fiona Ebner

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=cf8f28a0-2a34-413e-99ce-80897b45b76b@proxmox.com \
    --to=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal