Skip to content

OPTE integration #247

Description

@smklein

What follows is an overview of planned OPTE integration, after a conversation with @rzezeski. This also builds on top of functionality created by @bnaecker.

Initialization

  • The Sled Agent is responsible for consuming requests from Nexus, and allocating instances. Currently, this includes allocation of VNICs using a particular representation of a NetworkInterface object.
    • In the long-term, this allocation should likely be replaced with an API to directly allocate VNICs from OPTE.
    • In the short-term, we'll continue allocating VNICs via the current mechanism (dladm create-vnic), but we'll use the ioctl-based interface from OPTE to perform operations like setting IP configuration and firewall rules.
  • OPTE exposes a library interface for interacting with OPTE ports - the open_port invocation takes a VNIC name as input, and should return a connection to an OpteAdm object allowing for further configuration.
    • Note: The OpteAdm object is a bit overloaded; it may be split into more fine-grained objects as a result of OpteADM: Overloaded? opte#14
    • When Nexus communicates with the Sled agent to allocate an instance, it sends an object called InstanceHardware, representing the hardware which should be initialized for the instance. This includes a representation of the aforementioned NetworkInterface objects, which themselves contain "VPC ID", "Subnet ID", "Mac address", and "IP address". Although this representation is sufficient for the external API, as well as (probably?) storage in the database, it doesn't really work for shoving data into OPTE - at the point that this info is ready to be thrown at OPTE, it needs to be expanded (as an example: OPTE has no idea what the UUID of a VPC means. It needs to know all the information about that VPC which should be applied, since it won't be making upcalls to Nexus for further lookups).
    • Soooo once we get a more expanded InstanceHardware representation piped down to the Sled Agent, we can expand the VNIC representation to create an OpteAdm handle after the VNIC has been created, and make the necessary calls (likely set_ip_config and add_firewall_rules) using the information from Nexus.

Update

@rzezeski had a discussion about "should OPTE be notified for updated data (push model)" or "should OPTE be requesting data, so it accesses fresh copies (pull model)"?

Section 8 of RFD 63 suggests that there exists:

A control plane oriented agent that handles things like:

  • Asking the control plane for the appropriate transformations for an instance and updating them as appropriate.
  • Handling non-trivial actions such as translating DNS and metadata requests into the corresponding control plane calls.

Although that phrasing suggests some sort of mechanisms for making requests from OPTE -> The broader control plane, we're going to aim for an initial integration where control messages flow the opposite direction (namely, from the Sled Agent -> OPTE).

When VPC, Subnet, or Network interface objects are updated in Nexus, we'll need to perform a join-based query in the database to identify:

  • Given a particular network resource being updated (VPC, subnet, whatever) ...
  • ... what NetworkInterface objects are a part of this network...
  • ... which Instance objects are they attached to...
  • ... and for those Instance objects, which Sleds are they on?

Nexus can begin sending request to each sled, updating the live representation of all NetworkInterface objects. These will ultimately result in calls made to the OpteAdm object held by the SledAgent (mentioned in the "Initialization" section of this issue) for each interface. This process could potentially be updated to "one request per sled" if the Sled Agent held a mapping of "VPC -> Vnic" and "Subnet -> Vnic", and could internally identify all NICs needing updates after seeing a request to update a VPC/Subnet.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Sled AgentRelated to the Per-Sled Configuration and ManagementnetworkingRelated to the networking.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions