oxidecomputer / oxidecomputer/omicron
Nexus: Account for all storage on U.2s
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
In the context of the "Support Bundles" project, it is currently difficult for Nexus to answer the question "will a particular U.2 have enough space to store a support bundle of a particular size?".
More generally, Nexus may ask "If I provision a resource to a U.2, and I want it to have some minimum / maximum space, will it fit?
We need the following tools to answer this question:
- Nexus wants https://github.com/oxidecomputer/omicron/issues/6042 to request datasets explicitly, rather than implicitly. This should apply to all datasets (see: https://github.com/oxidecomputer/omicron/issues/6043)
- Nexus needs https://github.com/oxidecomputer/omicron/issues/6107 , to know that provisioned datasets won't overflow their expected capacities.
- Nexus would like to ensure that all storage usage within U.2s is tracked, to some degree. This depends on e.g. https://github.com/oxidecomputer/omicron/issues/6108, https://github.com/oxidecomputer/omicron/issues/6109
- Nexus needs to keep track of the expected quotas/reservations given to each U.2, and compare the usages of "all datasets on a zpool, so far" when making adjustments to the allocations.
It would also be extremely nice to have commands through omdb that can display these numbers, and give context on what they mean.
As prior art, the "region allocation" query for crucible accounts for some of this information: https://github.com/oxidecomputer/omicron/blob/main/nexus/db-queries/src/db/queries/region_allocation.rs
- It considers the "zpool size usage" to be "the sum of all datasets on that pool". This currently only considers other Crucibles, so it's not a true picture of the world, but an approximate one:
https://github.com/oxidecomputer/omicron/blob/89b998c1c24e26b9e1161acbbd1b236f40470bdd/nexus/db-queries/src/db/queries/region_allocation.rs#L121-L125 - It considers the "zpool capacity size" based on output from inventory, and checks that "old usage + proposed new usage <= total usage":
https://github.com/oxidecomputer/omicron/blob/89b998c1c24e26b9e1161acbbd1b236f40470bdd/nexus/db-queries/src/db/queries/region_allocation.rs#L175-L178
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with nexus/db-queries/src/db/queries/region_allocation.rs, especially its zpool usage and capacity queries, then review linked issues 6042, 6043, 6107, 6108, and 6109. Determine how Nexus should track all dataset usage and per-U.2 quotas, and what omdb commands should expose; done requires an agreed design and implementation covering those requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100