feat(quota): track instance count (VM count) per project/AZ#837
Conversation
Add _instances resource tracking to the quota controller alongside the existing _ram and _cores resources. Each VM counts as 1 instance per project/AZ/flavorGroup. Changes: - computeTotalUsage: accumulate hw_version_<group>_instances (+1 per VM) - accumulateAddedVM: add instances delta (+1) for new VMs - accumulateRemovedVM: add instances decrement (-1) for deleted VMs - Add EnableHVDiff config flag (default: true) to disable incremental HV diff calculation when needed (e.g. for debugging or QA) - Update unit tests and integration tests with instances expectations Since there are no CommittedResources for instances, PaygUsage for instances naturally equals TotalUsage (no CR deduction needed). To disable the HV diff watcher, set enableHVDiff: false in the quota controller config. Only periodic full reconciles will update TotalUsage.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds instance count tracking to the quota controller as a third usage dimension alongside RAM and cores. A new ChangesInstance Count Tracking with HV Diff Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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 |
Test Coverage ReportTest Coverage 📊: 69.1% |
Add _instances resource tracking to the quota controller alongside the existing _ram and _cores resources. Each VM counts as 1 instance per project/AZ/flavorGroup.
Changes:
Since there are no CommittedResources for instances, PaygUsage for instances naturally equals TotalUsage (no CR deduction needed).
To disable the HV diff watcher, set enableHVDiff: false in the quota controller config. Only periodic full reconciles will update TotalUsage.