Skip to content

ui: clarify the MAC address switch in the VM import form - #14532

Open
andrijapanicsb wants to merge 1 commit into
apache:mainfrom
andrijapanicsb:import-mac-switch-label
Open

andrijapanicsb wants to merge 1 commit into
apache:mainfrom
andrijapanicsb:import-mac-switch-label

Conversation

@andrijapanicsb

Copy link
Copy Markdown
Contributor

Description

In short: the VM import form has a switch that decides what happens when an imported NIC's MAC address is already used on the selected network. Its label and tooltip did not say that. This PR renames it to "Generate new MAC address if already in use", gives it a plain tooltip, and hides it where it has no effect. UI only.

Why it matters: an operator importing a VMware VM into KVM sees a switch called "Allow duplicate MAC addresses". Turning it on does the opposite: CloudStack replaces the conflicting MAC with a new one. On the other import screens the same switch is just called "Force". On remote KVM and QCOW2 disk imports it does nothing, because the server always generates a new MAC there.

Import screen Before After
VMware → KVM (cold and warm) "Allow duplicate MAC addresses" (wrong: it replaces the MAC) "Generate new MAC address if already in use"
KVM unmanaged, VMware unmanaged "Force" "Generate new MAC address if already in use"
Remote KVM "Force", ignored by the server Hidden
QCOW2 from local/shared storage "Force", ignored by the server Hidden

New tooltip on every screen where the switch is shown:

If a NIC's MAC address is already used by another NIC on the selected network, CloudStack assigns a new MAC address to the imported NIC and the import continues. When this is off, the import fails instead. Guest network settings or licenses tied to the old MAC address may stop working.

No API or backend change. Where the switch is still shown, the forced parameter is sent exactly as before. On the two screens where it is now hidden, the server already ignored it.

Details
  • ui/public/locales/en.json: two new keys, label.generate.new.mac.if.in.use and message.generate.new.mac.if.in.use.
  • ui/src/views/tools/ImportUnmanagedInstance.vue: both forced switches use the new label and tooltip. The tooltip now comes from a UI string instead of the forced API parameter description. The switch in the non-VMware row is hidden when isExternalImport or isDiskImport is true.
  • Server code that ignores forced on the hidden screens, in UnmanagedVMsManagerImpl:
    • remote KVM: importExternalKvmVirtualMachine calls importNic(..., true)
    • disk import: importKvmVirtualMachineFromDisk calls networkOrchestrationService.importNic(..., true)
  • label.allow.duplicate.macaddresses and label.forced are left in place; label.forced is used by other forms.
  • Other languages fall back to English for the two new keys.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  • ESLint on ImportUnmanagedInstance.vue: no errors.
  • en.json parses and has no duplicate keys.
  • Label and tooltip rendered with the same Ant Design Vue version (3.2.20) at the form widths of 1920, 1366, 1024 and 768 px screens. The label always fits on one line. On a ~1024 px screen, in the KVM row, it moves below "Migrate allowed" instead of sitting next to it.
  • Not yet checked on a running management server.

The switch that decides what happens when an imported NIC's MAC address
is already used on the selected network was labelled "Allow duplicate
MAC addresses" on the VMware to KVM form, which is the opposite of what
it does, and just "Force" on the other import forms.

Label it "Generate new MAC address if already in use", give it a plain
tooltip, and hide it for remote KVM and disk imports, where the server
always generates a new MAC address and ignores the switch.
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.76%. Comparing base (b9b5436) to head (1e39136).

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #14532   +/-   ##
=========================================
  Coverage     20.75%   20.76%           
- Complexity    21901    21904    +3     
=========================================
  Files          6496     6496           
  Lines        591602   591602           
  Branches      72583    72583           
=========================================
+ Hits         122814   122835   +21     
+ Misses       455456   455429   -27     
- Partials      13332    13338    +6     
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.07% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andrijapanicsb andrijapanicsb added this to the 24.0 milestone Oct 30, 2026
@andrijapanicsb

Copy link
Copy Markdown
Contributor Author

@blueorangutan UI

1 similar comment
@andrijapanicsb

Copy link
Copy Markdown
Contributor Author

@blueorangutan UI

@andrijapanicsb

Copy link
Copy Markdown
Contributor Author

fkcn BO... @Pearl1594 can you try to kick just UI building?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant