Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/reservations/committed-resource-reservations.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ The `Reservation` controller watches `Reservation` CRDs and `Hypervisor` CRDs. `
**Allocation Verification** — tracks VM lifecycle on reservations. The controller uses the Hypervisor CRD as the sole source of truth, with two triggers:
- New VMs (within `committedResourceAllocationGracePeriod`, default: 15 min): verification deferred — VM may still be spawning; requeued every `committedResourceRequeueIntervalGracePeriod` (default: 1 min)
- Established VMs: verified reactively when the Hypervisor CRD changes (VM appeared or disappeared in `Status.Instances`), with `committedResourceRequeueIntervalActive` (default: 5 min) as a safety-net fallback
- Missing VMs: removed from `Spec.Allocations` when not found on the Hypervisor CRD after the grace period
- Missing unconfirmed VMs (in `Spec.Allocations` only): removed from `Spec.Allocations` when not found on the Hypervisor CRD after the grace period
- Missing confirmed VMs (already present in `Status.Allocations`): bypass the grace period entirely — their disappearance from the Hypervisor CRD is treated as authoritative and they are removed immediately

**Reservation migration is not supported yet.**

Expand Down
17 changes: 9 additions & 8 deletions docs/reservations/failover-reservations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ The failover reservation system ensures VMs have pre-reserved capacity on altern
## File Structure

```text
internal/scheduling/reservations/failover/
├── config.go # Configuration struct (intervals, flavor requirements)
├── controller.go # Handles lifecycle of Reservation CRD of type failover
├── vm_source.go # VM data source (reads from Nova DB via postgres)
├── reservation_eligibility.go # Checks if a VM can use a failover reservation from a HA perspective (independent of normal scheduling constraints)
├── reservation_scheduling.go # Scheduling (new and reusing) of failover reservations via our scheduling pipeline
└── helpers.go # Utility functions for reservation manipulation
internal/scheduling/reservations/
├── vm_source.go # Shared VM data source interface (used by failover, commitments, and quota controllers)
└── failover/
├── config.go # Configuration struct (intervals, flavor requirements)
├── controller.go # Handles lifecycle of Reservation CRD of type failover
├── reservation_eligibility.go # Checks if a VM can use a failover reservation from a HA perspective (independent of normal scheduling constraints)
├── reservation_scheduling.go # Scheduling (new and reusing) of failover reservations via our scheduling pipeline
└── helpers.go # Utility functions for reservation manipulation
```

## Reconciliation Flow
Expand Down Expand Up @@ -114,7 +115,7 @@ The main orchestrator with dual reconciliation:

### 2. VM Source (`vm_source.go`)

Interface `VMSource` with `DBVMSource` implementation:
Shared interface `VMSource` (located at `internal/scheduling/reservations/vm_source.go`) used by failover, commitments, and quota controllers:
- Reads VMs from Nova postgres database (servers + flavors join)
- Can trust either postgres (`OSEXTSRVATTRHost`) or Hypervisor CRD for VM location
- Returns `VM` structs with UUID, flavor, resources, extra specs, AZ
Expand Down