Repository navigation
UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) - #14413
saurabhkushwaha438 wants to merge 1 commit into
Conversation
| this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue) | ||
| this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue) | ||
| this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue) | ||
| this.updateComputeMemory(this.memoryDisplayValue) |
There was a problem hiding this comment.
what happens when the memory isnt a round GiB value? an imported vm with 1500 MB shows as 1.46 GiB and gets sent back as 1495 without the user touching it
There was a problem hiding this comment.
nice catch , now i am confuse and would be great to get suggestion from you and others
There was a problem hiding this comment.
np. maybe, we can open it in MiB when the value isnt a whole number of GiB? then 1500 stays 1500. on load and on a unit switch, send the saved MiB value as is and only convert when the user changes the number.
There was a problem hiding this comment.
another option could be use GIB for display only because MIB is only state and single source of truth so in backend we will use actual MIB value
There was a problem hiding this comment.
that only works if the saved MiB is what gets sent.
There was a problem hiding this comment.
can we make sure 1500 goes back as 1500 unless the user changes the number?
Description
Fixes #14082
1. Conversion from MiB to GiB (Display & Rounding)
1 GiB = 1024 MiB).0.01(or smaller for sub-GiB offerings) with precision2.1with integer precision0.2. Conversion from GiB to MiB (Backend Value Emission)
minMemory/maxMemory), selecting the exact minimum or maximum bound in GiB directly maps to the exact integerminMemoryormaxMemoryin MiB to eliminate any potential off-by-one rounding discrepancies.💬 Feedback Needed: Fractional GiB to Integer MiB Rounding
1.51 GiB × 1024 = 1546.24 MiB).1546 MiB), which is then emitted in the API payload and consumed by backend hypervisor managers.Math.round) is acceptable, or if we should apply ceiling (Math.ceil) to guarantee the VM always receives at least the requested GiB amount.bandicam.2026-10-16.10-21-12-210.mp4