From 7495f9d267b1af79a4cb20281fed9b8b759d6d0f Mon Sep 17 00:00:00 2001 From: Francesco Torchia Date: Tue, 24 Sep 2024 11:12:00 +0200 Subject: [PATCH 1/2] Fix Node list in VMs Migrate dialog Signed-off-by: Francesco Torchia --- pkg/harvester/dialog/HarvesterMigrationDialog.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/harvester/dialog/HarvesterMigrationDialog.vue b/pkg/harvester/dialog/HarvesterMigrationDialog.vue index 9fe8811ca6e..0a16793bc88 100644 --- a/pkg/harvester/dialog/HarvesterMigrationDialog.vue +++ b/pkg/harvester/dialog/HarvesterMigrationDialog.vue @@ -74,7 +74,8 @@ export default { return nodes.filter((n) => { const isNotSelfNode = !!this.availableNodes.includes(n.id); const isNotWitnessNode = n.isEtcd !== 'true'; // do not allow to migrate to self node and witness node - const matchingCpuManagerConfig = n.isCPUManagerEnabled; // If cpu-pinning is enabled, filter-out non-enabled CPU manager nodes. + const isCpuPinning = this.actionResource?.spec?.template?.spec?.domain?.cpu?.dedicatedCpuPlacement; + const matchingCpuManagerConfig = !isCpuPinning || n.isCPUManagerEnabled; // If cpu-pinning is enabled, filter-out non-enabled CPU manager nodes. return isNotSelfNode && isNotWitnessNode && matchingCpuManagerConfig; }).map((n) => { From 1d16e2fe2e8119ead7c122ce8e112bfbbdcce179 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Wed, 25 Sep 2024 11:19:41 +0800 Subject: [PATCH 2/2] add warning banner for cpu pinning VM in migration dialog Signed-off-by: andy.lee --- pkg/harvester/dialog/HarvesterMigrationDialog.vue | 8 ++++++-- pkg/harvester/l10n/en-us.yaml | 1 + pkg/harvester/models/kubevirt.io.virtualmachine.js | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/harvester/dialog/HarvesterMigrationDialog.vue b/pkg/harvester/dialog/HarvesterMigrationDialog.vue index 0a16793bc88..e141ce0ba92 100644 --- a/pkg/harvester/dialog/HarvesterMigrationDialog.vue +++ b/pkg/harvester/dialog/HarvesterMigrationDialog.vue @@ -68,13 +68,17 @@ export default { return resource; }, + cpuPinningAlertMessage() { + return this.t('harvester.virtualMachine.cpuPinning.migrationMessage'); + }, + nodeNameList() { const nodes = this.$store.getters['harvester/all'](NODE); return nodes.filter((n) => { const isNotSelfNode = !!this.availableNodes.includes(n.id); const isNotWitnessNode = n.isEtcd !== 'true'; // do not allow to migrate to self node and witness node - const isCpuPinning = this.actionResource?.spec?.template?.spec?.domain?.cpu?.dedicatedCpuPlacement; + const isCpuPinning = this.actionResource?.isCpuPinning; const matchingCpuManagerConfig = !isCpuPinning || n.isCPUManagerEnabled; // If cpu-pinning is enabled, filter-out non-enabled CPU manager nodes. return isNotSelfNode && isNotWitnessNode && matchingCpuManagerConfig; @@ -144,6 +148,7 @@ export default {