Commit d5e8052
authored
(5/5) [nexus] Implement Affinity/Anti-Affinity Groups in external API (#7447)
Pulled out of #7076
This PR is a partial implementation of RFD 522
It adds:
- Affinity and Anti-Affinity groups, contained within projects. These
groups are configured with a **policy** and **failure domain** can
currently contain zero or more **members**. Affinity groups attempt to
co-locate members, anti-affinity groups attempt to avoid co-locating
members.
- **Policy** describes "what to do if we cannot fulfill the co-location
request". Currently, these options are "fail" (reject the request) or
"allow" (continue with provisioning of the group member regardless).
- **Failure Domain** describes the scope of what is considered
"co-located". In this PR, the only option is "sled", but in the future,
this may be expanded to e.g. "rack".
- **Members** describe what can be added to affinity/anti-affinity
groups. In this PR, the only option is "instance". RFD 522 describes how
"anti-affinity groups may also contain affinity groups" -- which is why
this "member" terminology is introduced -- but it is not yet
implemented.
- (anti-)Affinity groups are exposed by the API, through a CRUD
interface
- (anti-)Affinity groups are considered during "sled reservation", where
instances are placed on a sled. This is most significantly implemented
(and tested) within `nexus/db-queries/src/db/datastore/sled.rs`, within
#7446
Fixes #17051 parent a7b7c09 commit d5e8052
File tree
11 files changed
+2056
-77
lines changed- common/src/api/external
- nexus
- src
- app
- external_api
- test-utils/src
- tests
- integration_tests
- output
11 files changed
+2056
-77
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
315 | 328 | | |
316 | 329 | | |
317 | 330 | | |
| |||
0 commit comments