API for no/default/custom NICs on instance create

Open
#1,003 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust

Research direction

Start with nexus/src/external_api/params.rs and the linked instance-create API definitions. Compare the None, Default, and Custom NIC representations, then read the original issue context and comments for a settled direction. Done means the project has agreed on the API shape and documented the resulting behavior.

Written by the indexing model from the issue text.

Description

api networking nexus

Moved from https://github.com/oxidecomputer/omicron/issues/960#issuecomment-1106880861

There's a related point here, which may deserve its own issue. The current API for creating NICs in Nexus allows clients to specify one of three kinds of data when creating an instance. That's defined here, where the variants have the following interpretations:

  • None: Give the instance no NICs at all
  • Default: Give the instance exactly on interface, the primary. It will be in the VPC and VPC Subnet both named "default", and it will have an auto-assigned IP.
  • Custom: Specify zero or more items of this type, giving full control over all the parameters of each NIC.

I originally made it this way when I thought we'd also support attaching an existing NIC, which is no longer the case. And the issue is that the last variant actually subsumes the others.

For example, if you want no NICs, use a list of size zero. We can use default values on the fields of the NetworkInterfaceCreate struct to make specifying the "default case" of getting just one primary interface pretty straightforward. I'm not sure if this is worth it though, so I'd love some feedback from others on whether this is worth pursuing. cc @david-crespo @zephraph Wondering if y'all have initial thoughts here?

Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oxidecomputer/omicron

All issues in oxidecomputer/omicron

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.