]> git.proxmox.com Git - pve-manager.git/commitdiff
fix #2364: allow offline migration with local cloudinit disk
authorMira Limbeck <m.limbeck@proxmox.com>
Mon, 7 Oct 2019 10:07:47 +0000 (12:07 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 19:49:05 +0000 (21:49 +0200)
As the cloudinit disk itself does not get copied on an offline
migration, just the config, there's no conflict. Ignore the local
cloudinit disk on offline migration. Also adds a useful message when
trying to live migrate with a local cloudinit disk.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
www/manager6/window/Migrate.js

index d8d9a7f347286627d1d8853a9a928a896f34a132..cfc1316de7a476728fdac1222232ad82f2cf3e56 100644 (file)
@@ -248,11 +248,23 @@ Ext.define('PVE.window.Migrate', {
 
                        migrateStats.local_disks.forEach(function (disk) {
                            if (disk.cdrom && disk.cdrom === 1) {
-                               migration.possible = false;
-                               migration.preconditions.push({
-                                   text: "Can't migrate VM with local CD/DVD",
-                                   severity: 'error'
-                               });
+                               if (disk.volid.includes('vm-'+vm.get('vmid')+'-cloudinit')) {
+                                   if (migrateStats.running) {
+                                       migration.possible = false;
+                                       migration.preconditions.push({
+                                            text: "Can't live migrate VM with local cloudinit disk, use shared storage instead",
+                                            severity: 'error'
+                                       });
+                                   } else {
+                                       return;
+                                   }
+                               } else {
+                                   migration.possible = false;
+                                   migration.preconditions.push({
+                                       text: "Can't migrate VM with local CD/DVD",
+                                       severity: 'error'
+                                   });
+                               }
 
                            } else if (!disk.referenced_in_config) {
                                migration.possible = false;