Fix cluster capacity accumulation for hostless/filtered vms#22997
Fix cluster capacity accumulation for hostless/filtered vms#22997NouemanKHAL wants to merge 3 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf59c7b5bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| self._process_hosts(cluster, vm_stats, cluster_name, pc_label) | ||
|
|
||
| # Add capacity from VMs without a host assignment | ||
| self._cluster_capacity.add_vm(self._hostless_vm_vcpus, self._hostless_vm_memory_bytes) |
There was a problem hiding this comment.
Scope hostless VM capacity to current cluster
The new hostless accumulation is global across all VMs (_build_vms_by_host_cache sums into _hostless_vm_* once) but then those totals are added inside each cluster loop, so every processed cluster receives the same hostless VM capacity. In environments with multiple clusters (or cluster filters), this overcounts capacity and can attribute hostless VMs from excluded/other clusters to the current cluster. Please bucket hostless capacity by vm.cluster.extId (or compute per-cluster) before adding it.
Useful? React with 👍 / 👎.
What does this PR do?
Secondary/Testing improvements:
Motivation
Review checklist (to be filled by reviewers)
qa/skip-qalabel if the PR doesn't need to be tested during QA.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged