[pve-devel] [PATCH v5 14/15] ui: window/Migrate: allow mapped devices
Dominik Csapak
d.csapak at proxmox.com
Tue Jun 6 15:52:21 CEST 2023
if the migration is an offline migration and when the mapping on
the target node exists, otherwise not
this does not change the behaviour for 'raw' devices in the config
those can still be forced to be migrated, like before
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/window/Migrate.js | 50 +++++++++++++++++++++++++++-------
1 file changed, 40 insertions(+), 10 deletions(-)
diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index 1c23abb3..40590f22 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -219,36 +219,66 @@ Ext.define('PVE.window.Migrate', {
let target = me.lookup('pveNodeSelector').value;
if (target.length && !migrateStats.allowed_nodes.includes(target)) {
let disallowed = migrateStats.not_allowed_nodes[target];
- let missingStorages = disallowed.unavailable_storages.join(', ');
+ if (disallowed.unavailable_storages !== undefined) {
+ let missingStorages = disallowed.unavailable_storages.join(', ');
- migration.possible = false;
- migration.preconditions.push({
- text: 'Storage (' + missingStorages + ') not available on selected target. ' +
- 'Start VM to use live storage migration or select other target node',
- severity: 'error',
- });
+ migration.possible = false;
+ migration.preconditions.push({
+ text: 'Storage (' + missingStorages + ') not available on selected target. ' +
+ 'Start VM to use live storage migration or select other target node',
+ severity: 'error',
+ });
+ }
+
+ if (disallowed.unavailable_resources !== undefined) {
+ let missingResources = disallowed.unavailable_resources.join(', ');
+
+ migration.possible = false;
+ migration.preconditions.push({
+ text: 'Mapped Resources (' + missingResources + ') not available on selected target. ',
+ severity: 'error',
+ });
+ }
+ }
+ }
+
+ let blocking_resources = [];
+ for (const res of migrateStats.local_resources) {
+ if (migrateStats.mapped_resources.indexOf(res) === -1) {
+ blocking_resources.push(res);
}
}
- if (migrateStats.local_resources.length) {
+ if (blocking_resources.length) {
migration.hasLocalResources = true;
if (!migration.overwriteLocalResourceCheck || vm.get('running')) {
migration.possible = false;
migration.preconditions.push({
text: Ext.String.format('Can\'t migrate VM with local resources: {0}',
- migrateStats.local_resources.join(', ')),
+ blocking_resources.join(', ')),
severity: 'error',
});
} else {
migration.preconditions.push({
text: Ext.String.format('Migrate VM with local resources: {0}. ' +
'This might fail if resources aren\'t available on the target node.',
- migrateStats.local_resources.join(', ')),
+ blocking_resources.join(', ')),
severity: 'warning',
});
}
}
+ if (migrateStats.mapped_resources && migrateStats.mapped_resources.length) {
+ if (vm.get('running')) {
+ migration.possible = false;
+ migration.preconditions.push({
+ text: Ext.String.format('Can\'t migrate running VM with mapped resources: {0}',
+ migrateStats.mapped_resources.join(', ')),
+ severity: 'error',
+ });
+ }
+ }
+
if (migrateStats.local_disks.length) {
migrateStats.local_disks.forEach(function(disk) {
if (disk.cdrom && disk.cdrom === 1) {
--
2.30.2
More information about the pve-devel
mailing list