* [PATCH manager] partially fix #4012: ui: migrate: mention snapshots referencing a local CD/DVD
@ 2026-10-12 12:52 Michal Fox
0 siblings, 0 replies; only message in thread
From: Michal Fox @ 2026-10-12 12:52 UTC (permalink / raw)
To: pve-devel
When a VM has no local CD/DVD attached anymore, but one of its
snapshots still references it, the migrate window only shows:
Cannot migrate VM with local CD/DVD
which does not tell where the CD/DVD is coming from, since it is not
visible in the current configuration of the VM.
The migration precondition API already returns the 'is_attached' and
'referenced_in_snapshot' attributes for each local disk. Use them to
mention the volume and the snapshots referencing it in that case, and
that removing these snapshots allows migration. This matches the hint
in the migration task log since qemu-server commit a4efa5f9ad2a
("partially fix #4012: migrate: mention snapshots referencing a local
ISO image"). The plain message is kept if the CD/DVD is still
attached, like in the backend.
Signed-off-by: Michal Fox <me@dualfroz.com>
---
www/manager6/window/Migrate.js | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index 8cac54ea..b5067d7b 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -366,11 +366,22 @@ Ext.define('PVE.window.Migrate', {
migrateStats.local_disks.forEach(function (disk) {
if (disk.cdrom && disk.cdrom === 1) {
if (!disk.volid.includes('vm-' + vm.get('vmid') + '-cloudinit')) {
+ let text = gettext('Cannot migrate VM with local CD/DVD');
+ let snapshots = Object.keys(disk.referenced_in_snapshot ?? {}).sort();
+ if (!disk.is_attached && snapshots.length) {
+ text = Ext.String.format(
+ ngettext(
+ 'Cannot migrate VM with local CD/DVD ({0}) referenced in snapshot {1}. Remove the snapshot to allow migration.',
+ 'Cannot migrate VM with local CD/DVD ({0}) referenced in snapshots {1}. Remove the snapshots to allow migration.',
+ snapshots.length,
+ ),
+ disk.volid,
+ snapshots.join(', '),
+ );
+ }
+
migration.possible = false;
- migration.preconditions.push({
- text: gettext('Cannot migrate VM with local CD/DVD'),
- severity: 'error',
- });
+ migration.preconditions.push({ text, severity: 'error' });
}
} else {
let size = disk.size
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-12 12:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 12:52 [PATCH manager] partially fix #4012: ui: migrate: mention snapshots referencing a local CD/DVD Michal Fox
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.