oxidecomputer / oxidecomputer/omicron
Tracking: Instance Lifecycle Overhaul
Open
Nobody has claimed this yet.
nexus
Sled Agent
virtualization
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
- Updating Instance State Information within Nexus
- "Sled Agent registering itself with Nexus" should also transfer information about "Here are the instances the sled agent knows about". It can start as an empty set. See https://github.com/oxidecomputer/omicron/issues/3633 for a lot more detail here.
- The Sled Agent should refuse to handle instance requests until it successfully registers itself with Nexus. This would help avoid race conditions where: Nexus sends a request to a rebooting sled, at the same time as the sled registers with nexus and identifies that "all instances are dead now", inadvertently marking a very new instance as failed.
- Nexus should look up all instances that should have been running on the sled and mark them failed.
- Later Nexus can use an RPW to look for instances that are marked as "failed + auto_boot_on_fault", and re-provision them in the background.
- Idea: We could plausible update the "normal" instance provisioning workflow to rely on this RPW for provisioning, too. This would let "instance create" return much faster, and leave the work of "finding an appropriate sled and starting the instance" to a background task that could tolerate slower APIs to the backend.
- Ensuring metric registration: As part of the above RPW, one would like to also ensure that running instances have an assignment to an
oximetercollector recorded in theomicron.public.metric_producertable. When instances are stopped, that assignment needs to be removed by the cleanup-portion of that RPW.
- Instances without Sleds
- We need to make it possible for Instances to not have a propolis ID / sled ID, in the case that they are stopped.
- We also have the cleanup to do, ensuring that the virtual resources consumed by instances are no longer consumed in the case when an instance is stopped, but not deleted.
- Handling Failed Instances
- Confirm that instances can be forcefully deleted after being marked failed
- Plumb through the sled agent API @gjcolombo mentioned to "force-stop an instance" through the public-facing API for this failed case, to ensure that the instance is truly destroyed.
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
No files or tests are named in the issue. Start with the unchecked lifecycle items and the linked issue #3633, then trace the Sled Agent registration and public-facing force-stop API entry points. Done means the remaining instance-state, registration, and failed-instance handling requirements are implemented and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100