From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BD2061FF144 for ; Tue, 10 Mar 2026 13:23:11 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 617A71C436; Tue, 10 Mar 2026 13:23:04 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 10 Mar 2026 13:22:58 +0100 Message-Id: Subject: Re: [pve-devel] [PATCH qemu-server] migration: prohibit renaming cloud-init drive From: "Daniel Kral" To: "Proxmox VE development discussion" , "Fiona Ebner" X-Mailer: aerc 0.21.0-38-g7088c3642f2c-dirty References: <20251201135345.125993-1-f.ebner@proxmox.com> In-Reply-To: <20251201135345.125993-1-f.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773145344788 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.031 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 2LAFFOGGYB7546YYD2GNWAQJV63YZHC5 X-Message-ID-Hash: 2LAFFOGGYB7546YYD2GNWAQJV63YZHC5 X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 > --- > 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); > =20 > $local_volumes->{$volid}->{is_vmstate} =3D $attr->{is_vmstat= e} ? 1 : 0; > + $local_volumes->{$volid}->{is_cloudinit} =3D $attr->{is_clou= dinit} ? 1 : 0; > =20 > $local_volumes->{$volid}->{drivename} =3D $attr->{drivename} > if $attr->{drivename}; > @@ -725,11 +726,14 @@ sub sync_offline_local_volumes { > my $bwlimit =3D $local_volumes->{$volid}->{bwlimit}; > $bwlimit =3D $bwlimit * 1024 if defined($bwlimit); # storage= _migrate uses bps > =20 > + my $preserve_name =3D > + $local_volumes->{$volid}->{is_vmstate} || $local_volumes= ->{$volid}->{is_cloudinit}; > + > my $storage_migrate_opts =3D { > 'ratelimit_bps' =3D> $bwlimit, > 'insecure' =3D> $opts->{migration_type} eq 'insecure', > 'with_snapshots' =3D> $local_volumes->{$volid}->{snapsho= ts}, > - 'allow_rename' =3D> !$local_volumes->{$volid}->{is_vmsta= te}, > + 'allow_rename' =3D> !$preserve_name, > }; > =20 > my $logfunc =3D 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} //=3D 1; > $volhash->{$volid}->{cdrom} =3D 0 if !drive_is_cdrom($drive); > =20 > + $volhash->{$volid}->{is_cloudinit} //=3D 0; > + $volhash->{$volid}->{is_cloudinit} =3D 1 if drive_is_cloudinit($= drive); > + > my $replicate =3D $drive->{replicate} // 1; > $volhash->{$volid}->{replicate} //=3D 0; > $volhash->{$volid}->{replicate} =3D 1 if $replicate;