bhouse-nexthop commented on PR #14112: URL: https://github.com/apache/cloudstack/pull/14112#issuecomment-7139624210
Rebased onto current main and squashed into one commit (28ca1dae26). The only conflict was in `ConfigurationManagerImplTest`, where main's new `updateConfiguration` tests and this PR's ratio-validation tests sit at the same place. Both are kept. Another review pass found a few holes, now fixed in the same commit: | case | before | now | |---|---|---| | live migration, or a start retried, into a cluster with another ratio | the VM's ratio detail is rewritten before the old host is released, so the release didn't match the charge until the next capacity recalculation | the start/stop charge and release depend only on the offering and the host's cluster, the same scaling the allocator uses, so a release always matches its charge | | live scale to an offering with another ratio | the host check asked for the raw size change, and the charge and min memory/speed used the old ratio | all three use the new offering's ratio | | `cpuOvercommitRatio=NaN` or `Infinity` | accepted, so the VM was charged zero | rejected when the offering is created, and ignored at start and placement | | a domain admin setting a ratio on an offering | allowed through the API (the UI only shows the fields to root admins) | root admin only; a clone may keep the source's ratio unchanged | | the ratio key in another case, e.g. `MemoryOvercommitRatio` | stored as given, and read by the VM side but not by capacity | stored under the canonical name | | `memoryReclaimDisabled` VM detail | shown to users | hidden detail, set again at every start | Tests: `VirtualMachineManagerOverCommitTest`, `VirtualMachineManagerImplTest`, `CapacityManagerImplTest`, `ConfigurationManagerImplTest`, `DeploymentPlanningManagerImplTest` and `UserVmManagerImplTest` pass. `LibvirtVMDefTest` and `LibvirtComputingResourceTest` passed after the rebase; the fixes don't touch KVM. Known limits: - Some capacity checks still use the offering's raw size: the planner's cluster/pod ordering, the cluster disable-threshold check, rolling maintenance, DRS and the CKS pre-checks. For a VM that inherits its cluster's ratio, that is unchanged from today. For an offering with its own ratio, they are an approximation. The host allocator check and the charge itself are exact. - If a cluster's ratio is changed under running VMs, the periodic recalculation (which scales by the ratio each VM started under) and a stop's release can differ until the next recalculation. - A live scale that changes the memory exemption only takes effect on the domain at the next start. - Cloning an offering and clearing a ratio field still copies the source's ratio. That is how `cloneServiceOffering` treats details it isn't given. @DaanHoogland your test-file and functional points are answered in my comment of 2026-11-13. @weizhouapache @sureshanaparti @NuxRo a look at the functional side would still help, if you have time. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
