Skip to content

Prefill custom compute offering values for VMware import#13237

Open
andrijapanicsb wants to merge 1 commit into
apache:mainfrom
andrijapanicsb:import-custom-offering-prefill
Open

Prefill custom compute offering values for VMware import#13237
andrijapanicsb wants to merge 1 commit into
apache:mainfrom
andrijapanicsb:import-custom-offering-prefill

Conversation

@andrijapanicsb
Copy link
Copy Markdown
Contributor

@andrijapanicsb andrijapanicsb commented May 25, 2026

Summary

  • Fix unconstrained custom offering defaults during VMware import.
  • Keep constrained custom offering behavior intact, while making it explicit and consistent.
  • Default unknown CPU speed to 2000 MHz instead of showing/importing 0 MHz.

Problem

When importing a VMware VM and selecting a custom unconstrained compute offering, the UI could prefill the custom fields with generic fallback values instead of the discovered source VM sizing:

  • CPU cores: 1
  • CPU speed: 0 MHz
  • Memory: 32 MB

This happened even when the source VM details already showed useful sizing information, for example 3 CPU and 4096 MB memory.

Existing Behavior

  • Custom constrained offerings already behave correctly because the UI receives serviceofferingdetails with min/max CPU and memory bounds.
  • With those bounds present, the custom input component can initialize CPU and memory from values inside the allowed range.
image
  • Custom unconstrained offerings do not have those min/max bounds, so the UI falls back to generic defaults: 1 CPU, 0 MHz, and 32 MB.
image

New Behavior

  • Custom constrained offerings: continue to prefill from the discovered source VM sizing, clamped to the configured min/max range.
  • Custom unconstrained offerings: now also prefill from the discovered source VM sizing instead of using the generic fallback values.
  • Unknown source CPU speed: if VMware reports CPU speed as 0 or unknown, the UI now defaults the custom CPU speed field to 2000 MHz.
  • Selection refresh: the custom compute input row is recreated when the selected offering or discovered sizing values change, so stale custom values are not retained.
image

Testing

  • Ran git diff --check.
  • Verified the pull request diff only changes ui/src/views/tools/ImportUnmanagedInstance.vue.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.10%. Comparing base (a0aafe2) to head (765f166).

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #13237   +/-   ##
=========================================
  Coverage     18.10%   18.10%           
- Complexity    16746    16748    +2     
=========================================
  Files          6037     6037           
  Lines        542933   542945   +12     
  Branches      66487    66494    +7     
=========================================
+ Hits          98283    98292    +9     
- Misses       433602   433605    +3     
  Partials      11048    11048           
Flag Coverage Δ
uitests 3.51% <ø> (-0.01%) ⬇️
unittests 19.26% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Copy Markdown
Contributor Author

@blueorangutan UI

@andrijapanicsb
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@andrijapanicsb a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18023

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.

3 participants