Skip non-candidate hypervisors in nova filters and weighers - #1117
Merged
Conversation
Signed-off-by: Philipp Matthes <p.matthes@sap.com>
PhilippMatthes
requested review from
SoWieMarkus,
auhlig,
juliusclausnitzer,
mblos and
umswmayj
as code owners
August 4, 2026 12:36
📝 WalkthroughWalkthroughChangesActive host scheduling
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant filter_capabilities
participant FilterPipelineEvents
participant PrometheusAlert
filter_capabilities->>FilterPipelineEvents: record unknown hypervisor type event
FilterPipelineEvents->>PrometheusAlert: expose event labels and rate
PrometheusAlert->>PrometheusAlert: alert after 0.1 rate for 15 minutes
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/scheduling/nova/plugins/filters/filter_capabilities_test.go`:
- Around line 695-698: Update the label assertions in the event verification
loop over expectedEvent.Labels to capture the map lookup’s existence result
before comparing values. Fail when an expected label key is absent, including
when its expected value is empty, while preserving the existing value comparison
for present labels.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0e2a42ce-f5b2-4bef-943a-79c8361688db
📒 Files selected for processing (16)
helm/bundles/cortex-nova/templates/alerts.yamlhelm/bundles/cortex-nova/templates/pipelines_kvm.yamlinternal/scheduling/nova/plugins/filters/filter_aggregate_metadata.gointernal/scheduling/nova/plugins/filters/filter_allowed_projects.gointernal/scheduling/nova/plugins/filters/filter_capabilities.gointernal/scheduling/nova/plugins/filters/filter_capabilities_test.gointernal/scheduling/nova/plugins/filters/filter_correct_az.gointernal/scheduling/nova/plugins/filters/filter_external_customer.gointernal/scheduling/nova/plugins/filters/filter_has_accelerators.gointernal/scheduling/nova/plugins/filters/filter_has_enough_capacity.gointernal/scheduling/nova/plugins/filters/filter_has_requested_traits.gointernal/scheduling/nova/plugins/filters/filter_instance_group_anti_affinity.gointernal/scheduling/nova/plugins/filters/filter_requested_destination.gointernal/scheduling/nova/plugins/filters/filter_status_conditions.gointernal/scheduling/nova/plugins/weighers/kvm_binpack.gointernal/scheduling/nova/plugins/weighers/kvm_instance_group_soft_affinity.go
Contributor
Test Coverage ReportTest Coverage 📊: 70.5% |
juliusclausnitzer
approved these changes
Aug 4, 2026
Merged
SoWieMarkus
added a commit
that referenced
this pull request
Aug 10, 2026
## Release cortex v0.3.6 ### New features - **Implement in-flight reservations controller** — adds a new controller that tracks reservations currently being fulfilled by monitoring VM creation state via Nova API, transitioning reservations through their lifecycle stages and cleaning up stale in-flight reservations ([#957](#957)) - **Add KPI that tracks CR count per configured cluster** — introduces the `MulticlusterObjectCountKPI` plugin which counts custom resource objects per cluster and exposes them as Prometheus metrics ([#1054](#1054)) - **Follow VM live migration in CR reservation reconciler** — the committed resource reservation controller now detects when a VM has been live-migrated to a different host and updates the reservation's target host accordingly ([#1048](#1048)) ### Bug fixes - **Subtract reservation CPU blocks when counting placeable slots** — the capacity accounting now correctly deducts reserved CPU blocks from available capacity before calculating how many new instances can be placed ([#1118](#1118)) ### Non-breaking changes - Skip non-candidate hypervisors in nova filters and weighers ([#1117](#1117)) - Add dynamic labels to pipeline step event metrics ([#1108](#1108)) - Update `go.xyrillian.de/gg` to v1.13.2 ([#1111](#1111), [#1122](#1122)) - Update `github.com/sapcc/go-bits` ([#1124](#1124)) - Update `kube-prometheus-stack` to v88.1.5 ([#1112](#1112), [#1119](#1119), [#1121](#1121)) - Update `debian:trixie-slim` Docker digest ([#1120](#1120)) ### Chart versions | Chart | Old | New | |-------|-----|-----| | cortex | 0.3.5 | 0.3.6 | | cortex-shim | 0.1.11 | 0.1.12 | | cortex-postgres | 0.6.11 | 0.6.12 | | cortex-nova | 0.0.85 | 0.0.86 | | cortex-cinder | 0.0.85 | 0.0.86 | | cortex-manila | 0.0.85 | 0.0.86 | | cortex-crds | 0.0.85 | 0.0.86 | | cortex-ironcore | 0.0.85 | 0.0.86 | | cortex-pods | 0.0.85 | 0.0.86 | | cortex-placement-shim | 0.1.11 | 0.1.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During onboarding or offboarding, hypervisor resources may have incomplete status fields like empty hypervisor type, missing capacity, or missing zone labels. With filter_status_conditions running first in every pipeline, subsequent filters and weighers should only inspect hosts that are still candidates. This change adds an early candidate guard to all nova filters and weighers that list Hypervisor CRs, so they skip hosts not present in result.Activations. It also emits a pipeline event when filter_capabilities encounters an unknown hypervisor type on a candidate host, and adds a matching Prometheus alert.
Assisted-by: Claude Code:thalamus/moonshotai/Kimi-K2.7-Code [Bash] [Read]