Skip to content

API for no/default/custom NICs on instance create #1003

@david-crespo

Description

@david-crespo

Moved from #960 (comment)

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelated to the API.networkingRelated to the networking.nexusRelated to nexus

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions