From 7e0a9dcd80bb45d8c3b131df070376b1a28cbe50 Mon Sep 17 00:00:00 2001 From: Yiya Chen Date: Fri, 31 Oct 2025 16:49:31 +0800 Subject: [PATCH] feat: add kubevirt migration setting (#577) Signed-off-by: Yi-Ya Chen --- .../settings/kubevirt-migration.vue | 154 ++++++++++++++++++ pkg/harvester/config/feature-flags.js | 3 +- pkg/harvester/config/settings.ts | 6 +- .../edit/harvesterhci.io.setting.vue | 5 + pkg/harvester/l10n/en-us.yaml | 16 ++ 5 files changed, 182 insertions(+), 2 deletions(-) create mode 100644 pkg/harvester/components/settings/kubevirt-migration.vue diff --git a/pkg/harvester/components/settings/kubevirt-migration.vue b/pkg/harvester/components/settings/kubevirt-migration.vue new file mode 100644 index 00000000..f9e111a9 --- /dev/null +++ b/pkg/harvester/components/settings/kubevirt-migration.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/pkg/harvester/config/feature-flags.js b/pkg/harvester/config/feature-flags.js index 9ba57746..906e6f0f 100644 --- a/pkg/harvester/config/feature-flags.js +++ b/pkg/harvester/config/feature-flags.js @@ -52,7 +52,8 @@ const FEATURE_FLAGS = { 'v1.7.0': [ 'vmMachineTypeAuto', 'lhV2VolExpansion', - 'l2VlanTrunkMode' + 'l2VlanTrunkMode', + 'kubevirtMigration' ] }; diff --git a/pkg/harvester/config/settings.ts b/pkg/harvester/config/settings.ts index 63ccede2..6d513e27 100644 --- a/pkg/harvester/config/settings.ts +++ b/pkg/harvester/config/settings.ts @@ -37,7 +37,8 @@ export const HCI_SETTING = { UPGRADE_CONFIG: 'upgrade-config', VM_MIGRATION_NETWORK: 'vm-migration-network', RANCHER_CLUSTER: 'rancher-cluster', - MAX_HOTPLUG_RATIO: 'max-hotplug-ratio' + MAX_HOTPLUG_RATIO: 'max-hotplug-ratio', + KUBEVIRT_MIGRATION: 'kubevirt-migration' }; export const HCI_ALLOWED_SETTINGS = { @@ -115,6 +116,9 @@ export const HCI_ALLOWED_SETTINGS = { [HCI_SETTING.VM_MIGRATION_NETWORK]: { kind: 'json', from: 'import', canReset: true, featureFlag: 'vmNetworkMigration', }, + [HCI_SETTING.KUBEVIRT_MIGRATION]: { + kind: 'json', from: 'import', canReset: true, featureFlag: 'kubevirtMigration', + } }; export const HCI_SINGLE_CLUSTER_ALLOWED_SETTING = { diff --git a/pkg/harvester/edit/harvesterhci.io.setting.vue b/pkg/harvester/edit/harvesterhci.io.setting.vue index 4b53d5c8..9401f372 100644 --- a/pkg/harvester/edit/harvesterhci.io.setting.vue +++ b/pkg/harvester/edit/harvesterhci.io.setting.vue @@ -296,4 +296,9 @@ export default { :deep() .edit-help code { padding: 1px 5px; } + +::v-deep(.banner__content.closable) { + white-space: normal; + word-break: break-word; +} diff --git a/pkg/harvester/l10n/en-us.yaml b/pkg/harvester/l10n/en-us.yaml index c4609d21..cd7ce789 100644 --- a/pkg/harvester/l10n/en-us.yaml +++ b/pkg/harvester/l10n/en-us.yaml @@ -1268,6 +1268,21 @@ harvester: ntpServers: isNotIPV4: The address you entered is not IPv4 or host. Please enter a valid IPv4 address or a host address. isDuplicate: There are duplicate NTP server configurations. + kubevirtMigration: + parseError: "Failed to parse configuration: {error}" + parallelMigrationsPerCluster: "Parallel Migrations Per Cluster" + parallelOutboundMigrationsPerNode: "Parallel Outbound Migrations Per Node" + bandwidthPerMigration: "Bandwidth Per Migration" + bandwidthPerMigrationTooltip: '0 is KubeVirt default, representing unlimited bandwidth' + completionTimeoutPerGiB: "Completion Timeout Per GiB" + progressTimeout: "Progress Timeout" + allowAutoConverge: "Allow Auto Converge" + allowPostCopy: "Allow Post Copy" + unsafeMigrationOverride: "Unsafe Migration Override" + allowWorkloadDisruption: "Allow Workload Disruption" + disableTLS: "Disable TLS" + matchSELinuxLevelOnMigration: "Match SELinux Level On Migration" + cloudTemplate: label: Cloud Configuration Templates templateType: Template Type @@ -1782,6 +1797,7 @@ advancedSettings: 'harv-vm-migration-network': 'Segregated network for VM migration traffic.' 'harv-rancher-cluster': 'Configure Rancher cluster integration settings for guest cluster management.' 'harv-max-hotplug-ratio': 'The ratio for kubevirt to limit the maximum CPU and memory that can be hotplugged to a VM. The value could be an integer between 1 and 20, default to 4.' + 'harv-kubevirt-migration': 'Configure cluster-wide KubeVirt live migration parameters.' typeLabel: kubevirt.io.virtualmachine: |-