From 429ce91253b9995a1bf68079b94dc6e1f04b4d69 Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Sun, 11 Oct 2026 13:13:26 +0200 Subject: [PATCH] partially fix #4012: ui: migrate: mention snapshots referencing a local CD/DVD 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 --- 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 8cac54e..b5067d7 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