public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
	"Fiona Ebner" <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server] migration: prohibit renaming cloud-init drive
Date: Tue, 10 Mar 2026 13:22:58 +0100	[thread overview]
Message-ID: <DGZ3KTDM4V0S.3GU9KBRDW6HA5@proxmox.com> (raw)
In-Reply-To: <20251201135345.125993-1-f.ebner@proxmox.com>

On Mon Dec 1, 2025 at 2:51 PM CET, Fiona Ebner wrote:
> Usually, disks are allowed to be renamed during migration if there is
> a naming conflict caused by a left-over disk on the target. However,
> the type of the cloud-init disk is encoded in its name, so it must not
> be renamed or it cannot be recognized as a cloud-init disk anymore, as
> reported in the community forum [0].
>
> [0]: https://forum.proxmox.com/threads/167767/

A user in the community forum [1] reported that if a VM is moved to
another node during a fence recovery, the VM will fail to migrate back,
e.g., if a node affinity rule prioritizes the previous node.

This patch is correct to not allow renaming cloudinit images, but I
wonder if it would be a reasonable idea to allow overriding existing
cloudinit images on the target node as these are auto-generated?

That would probably need a `--allow-override` flag for pvesm, which
would require that the target host can understand the parameter though.

[1] https://forum.proxmox.com/threads/181516/

>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  src/PVE/QemuMigrate.pm | 6 +++++-
>  src/PVE/QemuServer.pm  | 3 +++
>  2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
> index 8fa84080..a1d7471c 100644
> --- a/src/PVE/QemuMigrate.pm
> +++ b/src/PVE/QemuMigrate.pm
> @@ -439,6 +439,7 @@ sub scan_local_volumes {
>                  PVE::Storage::volume_size_info($storecfg, $volid);
>  
>              $local_volumes->{$volid}->{is_vmstate} = $attr->{is_vmstate} ? 1 : 0;
> +            $local_volumes->{$volid}->{is_cloudinit} = $attr->{is_cloudinit} ? 1 : 0;
>  
>              $local_volumes->{$volid}->{drivename} = $attr->{drivename}
>                  if $attr->{drivename};
> @@ -725,11 +726,14 @@ sub sync_offline_local_volumes {
>              my $bwlimit = $local_volumes->{$volid}->{bwlimit};
>              $bwlimit = $bwlimit * 1024 if defined($bwlimit); # storage_migrate uses bps
>  
> +            my $preserve_name =
> +                $local_volumes->{$volid}->{is_vmstate} || $local_volumes->{$volid}->{is_cloudinit};
> +
>              my $storage_migrate_opts = {
>                  'ratelimit_bps' => $bwlimit,
>                  'insecure' => $opts->{migration_type} eq 'insecure',
>                  'with_snapshots' => $local_volumes->{$volid}->{snapshots},
> -                'allow_rename' => !$local_volumes->{$volid}->{is_vmstate},
> +                'allow_rename' => !$preserve_name,
>              };
>  
>              my $logfunc = sub { $self->log('info', $_[0]); };
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index a7fbec14..70faab62 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -4502,6 +4502,9 @@ sub foreach_volid {
>          $volhash->{$volid}->{cdrom} //= 1;
>          $volhash->{$volid}->{cdrom} = 0 if !drive_is_cdrom($drive);
>  
> +        $volhash->{$volid}->{is_cloudinit} //= 0;
> +        $volhash->{$volid}->{is_cloudinit} = 1 if drive_is_cloudinit($drive);
> +
>          my $replicate = $drive->{replicate} // 1;
>          $volhash->{$volid}->{replicate} //= 0;
>          $volhash->{$volid}->{replicate} = 1 if $replicate;





  parent reply	other threads:[~2026-03-10 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 13:51 Fiona Ebner
2026-01-20 17:21 ` [pve-devel] applied: " Thomas Lamprecht
2026-03-10 12:22 ` Daniel Kral [this message]
2026-03-10 12:31   ` [pve-devel] " Fiona Ebner
2026-03-10 12:38     ` Fiona Ebner
2026-03-10 14:11       ` Daniel Kral

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=DGZ3KTDM4V0S.3GU9KBRDW6HA5@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=f.ebner@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