[pve-devel] [PATCH v2 manager 2/2] Allow setting no target storage and make it default

Fabian Ebner f.ebner at proxmox.com
Mon May 4 10:50:40 CEST 2020


so the current disk locations can be preserved even if
there are multiple local disks. And users don't have to
manually select the current storage if there is only one
local disk.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 www/manager6/window/Migrate.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index 42a54246..d97dd589 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -126,8 +126,9 @@ Ext.define('PVE.window.Migrate', {
 	    if (vm.get('migration.with-local-disks')) {
 		params['with-local-disks'] = 1;
 	    }
-	    //only submit targetstorage if vm is running, storage migration to different storage is only possible online
-	    if (vm.get('migration.with-local-disks') && vm.get('running')) {
+	    //offline migration to a different storage currently might fail at a late stage
+	    //(i.e. after some disks have been moved), so don't expose it yet in the GUI
+	    if (vm.get('migration.with-local-disks') && vm.get('running') && values.targetstorage) {
 		params.targetstorage = values.targetstorage;
 	    }
 
@@ -352,6 +353,9 @@ Ext.define('PVE.window.Migrate', {
 			    name: 'targetstorage',
 			    fieldLabel: gettext('Target storage'),
 			    storageContent: 'images',
+			    allowBlank: true,
+			    autoSelect: false,
+			    emptyText: 'use current layout',
 			    bind: {
 				hidden: '{setStorageselectorHidden}'
 			    }
-- 
2.20.1





More information about the pve-devel mailing list