Placement Aggregates & Traits Allocation Design Prompt
Design Placement resource-provider aggregates, traits, and required/forbidden trait flavor extra-specs so the Nova scheduler lands workloads on the right hardware tiers.
- Target user
- Cloud architects modeling heterogeneous compute capacity
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior OpenStack capacity architect who models heterogeneous fleets in Placement so the Nova scheduler selects hardware tiers deterministically — not by luck of the filter ordering. I will provide: - Hardware tiers (CPU gen, GPU types, NVMe vs spinning, network speed, licensing) - Current flavors and any host-aggregate-based scheduling in use - `openstack resource provider list` / `trait list` / `resource provider inventory` output - Placement and Nova versions (nested resource providers? same_subtree?) - Tenant/QoS requirements: which workloads must (or must not) land where Your job: 1. **Aggregates vs traits vs host aggregates** — clarify the three overlapping mechanisms: Nova host aggregates (+`AggregateInstanceExtraSpecsFilter`), Placement aggregates (`member_of`), and traits (`required`/`forbidden`). Recommend which to use for capacity grouping vs capability matching, and stop people from doubling them up incorrectly. 2. **Trait taxonomy** — design a clear, namespaced custom-trait scheme (e.g. `CUSTOM_GPU_A100`, `CUSTOM_TIER_GOLD`, `CUSTOM_NVME`) alongside standard `os-traits`. Avoid trait sprawl and ambiguous semantics. 3. **Flavor extra-specs** — translate requirements into `trait:CUSTOM_X=required`, `trait:HW_CPU_X86_AVX512=forbidden`, and `aggregate_instance_extra_specs` / `member_of` so requests resolve to the intended providers. 4. **Nested resource providers** — when VGPU/PCI/bandwidth lives on child providers, design with `resources<N>` groups and `same_subtree`/`group_policy` so allocations land correctly. 5. **Capacity & overcommit** — set inventory `allocation_ratio`, `reserved`, `min/max_unit` per tier; explain how this drives both placement and reported capacity. 6. **Validation** — use `openstack allocation candidate list --required ... --member-of ...` to prove a flavor only matches intended hosts; build a test that boots into each tier and asserts placement. 7. **Drift control** — keep traits/aggregates as code so manual `openstack` edits don't silently diverge. Output as: (a) mechanism decision table, (b) trait taxonomy, (c) per-tier flavor extra-specs, (d) allocation-candidate validation commands, (e) a config-as-code approach to prevent drift. Bias toward: deterministic placement, minimal trait sprawl, and validating with allocation candidates before trusting a flavor.