.. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. The Aviz ONES Plugin ==================== Introduction ------------ The Aviz ONES plugin introduces Aviz ONES as a network service provider in CloudStack. Aviz ONES is the fabric manager of leaf-spine fabrics for GPU clusters built on the NVIDIA Spectrum-X reference architecture. With the plugin, an isolated guest network in CloudStack is one ONES **tenant**: ONES isolates the tenant on the fabric with its own VRF, VXLAN VNIs and north-south VLAN, and chooses its subnet; CloudStack runs the instances and the virtual router on it. The plugin orchestrates: - Tenant isolation on the fabric for each isolated guest network - The membership of hypervisor hosts in a tenant, as instances are placed on them, including the tenant's VF on a host's DPU where the hosts sit behind DPUs - The network's subnet and gateway, as ONES assigns them - Optionally, the network's edge on the Aviz Gateway the tenant leaves the fabric through: source NAT, port forwarding, load balancing and ingress firewall rules - CloudStack Virtual Router services (DHCP, DNS, UserData) Supported Versions ------------------ +--------------+----------------------+---------------+-------------------+ | Hypervisor | CloudStack Version | ONES Version | Aviz Gateway | +==============+======================+===============+===================+ | KVM | >= 24.0 | 4.4.0 | 0.1.0 (optional) | +--------------+----------------------+---------------+-------------------+ Table: Supported Versions How a network maps onto a tenant -------------------------------- ONES, not CloudStack, chooses everything about a tenant: its VLAN, VNIs, subnet, compute IP pool and gateway. The plugin creates the tenant when the network is created, and the network takes its addressing from ONES: +-------------------------+-------------------------------------------------------+ | Network | From ONES | +=========================+=======================================================+ | Broadcast URI | ``vlan://``: the VLAN ONES trunks to the | | | hypervisors' leaf ports and maps into the tenant VRF | +-------------------------+-------------------------------------------------------+ | CIDR | The tenant subnet | +-------------------------+-------------------------------------------------------+ | Gateway | The gateway ONES reports for the tenant | +-------------------------+-------------------------------------------------------+ | Instance addresses | Only from the tenant's compute IP pool, a part of the | | | subnet; the rest of the subnet belongs to the fabric | +-------------------------+-------------------------------------------------------+ Throughout the network's life: - **Create**: the tenant is created in ONES. If anything fails afterwards, the tenant is deleted again. - **Instance placed on a host**: the host is added to the tenant (once per host) as a shared server, since one hypervisor carries many tenants. On a host behind a DPU, the tenant also gets one free VF of that DPU. - **Shutdown**: the network's hosts are taken out of the tenant, releasing their VFs. - **Delete**: the tenant is deleted. In a compute pool of a /27 or bigger the first nine addresses are left unused for the operator; smaller pools are used from the first address. Configuration ------------- Prerequisites ~~~~~~~~~~~~~ - A fabric managed by Aviz ONES, with **tenant IPAM off**: CloudStack, not ONES, configures the hypervisors. - The ONES tenant gateway reported by ONES is the address the fabric routes the tenant on. - KVM hosts cabled to the fabric's leaves, with the guest traffic label of the physical network on the interfaces ONES trunks the tenant VLANs to. - **Each KVM host is named in CloudStack as its server is named in ONES**: the plugin adds hosts to tenants by name. - The management server reaches the ONES Fabric Manager API over HTTPS, and trusts its certificate (or is given a CA bundle for it). The host name in the URL must match the certificate; the default ONES certificate is issued for ``ones-fm``. Physical network ~~~~~~~~~~~~~~~~ Use the isolation method ``ONES`` for the physical network that carries the guest traffic, then add and enable the ``AvizOnes`` network service provider on it: .. parsed-literal:: cmk create physicalnetwork zoneid= name=pnet-ones isolationmethods=ONES cmk add networkserviceprovider name=AvizOnes physicalnetworkid= cmk update networkserviceprovider id= state=Enabled Registering the ONES controller ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Register the ONES Fabric Manager of the fabric with the physical network: .. parsed-literal:: cmk add onesprovider physicalnetworkid= name=ones1 \\ url=https://ones.example.com:8443 fabricname= \\ username= password= \\ cacertpath=/etc/cloudstack/management/ones-ca.pem +------------------------+-----------+----------------------------------------------------------+ | Parameter | Required | Description | +========================+===========+==========================================================+ | ``physicalnetworkid`` | yes | The physical network | +------------------------+-----------+----------------------------------------------------------+ | ``name`` | yes | Name of this provider | +------------------------+-----------+----------------------------------------------------------+ | ``url`` | yes | Base URL of the ONES Fabric Manager API; the host name | | | | must match the ONES server certificate | +------------------------+-----------+----------------------------------------------------------+ | ``fabricname`` | yes | The ONES fabric the provider manages tenants on | +------------------------+-----------+----------------------------------------------------------+ | ``username``, | yes | The ONES user the plugin logs in as. The password is | | ``password`` | | stored encrypted | +------------------------+-----------+----------------------------------------------------------+ | ``loginurl`` | no | The ONES login endpoint; by default | | | | ``https:///api/user/login``, i.e. the | | | | ONES UI on the default HTTPS port, not the Fabric | | | | Manager port of ``url`` | +------------------------+-----------+----------------------------------------------------------+ | ``cacertpath`` | no | CA bundle on the management server that verifies ONES; | | | | by default the JVM trust store | +------------------------+-----------+----------------------------------------------------------+ | ``clientcertpath``, | no | A TLS client certificate and key on the management | | ``clientkeypath`` | | server, for a ONES controller that requires one | +------------------------+-----------+----------------------------------------------------------+ The controller appears as a host of type ``L2Networking``. One ONES provider can be registered per physical network. Network offering ~~~~~~~~~~~~~~~~ An isolated network offering with ``Connectivity`` provided by ``AvizOnes``, and ``Dhcp``, ``Dns`` and ``UserData`` by the virtual router: .. parsed-literal:: cmk create networkoffering name="ONES Isolated" displaytext="One ONES tenant per network" \\ guestiptype=Isolated traffictype=GUEST supportedservices=Connectivity,Dhcp,Dns,UserData \\ serviceproviderlist[0].service=Connectivity serviceproviderlist[0].provider=AvizOnes \\ serviceproviderlist[1].service=Dhcp serviceproviderlist[1].provider=VirtualRouter \\ serviceproviderlist[2].service=Dns serviceproviderlist[2].provider=VirtualRouter \\ serviceproviderlist[3].service=UserData serviceproviderlist[3].provider=VirtualRouter cmk update networkoffering id= state=Enabled For the edge services on the Aviz Gateway, also add ``SourceNat``, ``PortForwarding``, ``Lb`` and ``Firewall``, each provided by ``AvizOnes`` (see :ref:`aviz-ones-edge`). Creating networks ~~~~~~~~~~~~~~~~~ ONES chooses the subnet of every network and the network takes it, with the gateway ONES reports. CloudStack asks for ``gateway`` and ``netmask`` when an isolated network is created from an offering without SourceNat, before ONES has chosen anything. For such an offering pass a placeholder: a gateway outside the subnet ONES assigns (any RFC 1918 address, for example ``10.255.255.1`` with ``netmask`` ``255.255.255.0``) is ignored, and the network takes ONES's subnet and gateway. A gateway inside that subnet is used as given. .. parsed-literal:: cmk create network zoneid= networkofferingid= name=tenant-a displaytext=tenant-a \\ gateway=10.255.255.1 netmask=255.255.255.0 With SourceNat in the offering (see :ref:`aviz-ones-edge`) leave ``gateway`` and ``netmask`` out. .. _aviz-ones-edge: Edge services on the Aviz Gateway --------------------------------- .. note:: The edge services are experimental in this version. A ONES tenant reaches the outside through an Aviz Gateway: ONES puts each tenant on the gateway once a server has joined the tenant. On top of that the plugin provides, by the ``AvizOnes`` provider: +-----------------+----------------------------------------------------------------------+ | Service | On the Aviz Gateway | +=================+======================================================================+ | SourceNat | The tenant's internet access: outbound traffic is translated onto | | | the network's source NAT address | +-----------------+----------------------------------------------------------------------+ | PortForwarding | One inbound mapping per port of each rule | +-----------------+----------------------------------------------------------------------+ | Lb | One VIP per load-balancer rule, with every member as a backend: | | | round robin, TCP or UDP, ``SourceBased`` stickiness | +-----------------+----------------------------------------------------------------------+ | Firewall | Ingress rules on the public addresses of port forwards and load | | | balancers | +-----------------+----------------------------------------------------------------------+ Only ``Connectivity`` is required in a ONES network offering; each edge service is optional: +-----------------+----------------------------------------------------------------------+ | Service | Needs | +=================+======================================================================+ | SourceNat | the Aviz Gateway configured on the provider | +-----------------+----------------------------------------------------------------------+ | PortForwarding | SourceNat (the gateway keeps port forwards in the tenant's internet | | | access) | +-----------------+----------------------------------------------------------------------+ | Lb | the Aviz Gateway configured on the provider | +-----------------+----------------------------------------------------------------------+ | Firewall | PortForwarding or Lb, to guard their ports. Without Firewall, | | | forwarded ports and load balancers are open to every source | +-----------------+----------------------------------------------------------------------+ All public addresses are CloudStack's own. Give the zone a public IP range that the gateway's uplink announces. The plugin works out the tenant's whole edge from CloudStack whenever a public address, port forwarding, load-balancer or firewall rule changes, and when the network's first host joins the tenant, and puts it on the gateway in one step. Whatever the plugin made on the gateway and is no longer wanted is removed; VIPs and firewall rules created on the gateway by an operator are never touched. Shutting the network down takes its edge off the gateway. Configuring the gateway ~~~~~~~~~~~~~~~~~~~~~~~ Create an API token of role ``operator`` for CloudStack on the gateway (``POST /api/v1/tokens``), and give it to the ONES provider: .. parsed-literal:: cmk update onesprovider id= gatewayurl=https://gateway.example.com:8090 \\ gatewaytoken= gatewaycacertpath=/etc/cloudstack/management/gateway-ca.pem +------------------------+----------------------------------------------------------+ | Parameter | Description | +========================+==========================================================+ | ``gatewayurl`` | The Aviz Gateway REST API; the host name must match the | | | gateway certificate | +------------------------+----------------------------------------------------------+ | ``gatewaytoken`` | A gateway API token of role ``operator``; stored | | | encrypted | +------------------------+----------------------------------------------------------+ | ``gatewaycacertpath`` | The certificate on the management server that verifies | | | the gateway | +------------------------+----------------------------------------------------------+ An empty value clears a setting. Firewall rules ~~~~~~~~~~~~~~ The gateway filters inbound traffic after address translation. For each instance address and port reached through a port forward or a load balancer, the plugin puts on the gateway a rule that denies every source, and a rule that permits each source CIDR an ingress firewall rule allows on the public address and port leading there. A port forward or load balancer that no ingress rule covers stays closed, as on any CloudStack network. Egress firewall rules are not supported. Edge limitations ~~~~~~~~~~~~~~~~ - Gateway firewall rules are named after their position in the network's rule set and rewritten as a whole on every change. - A load balancer cannot use the network's source NAT address: acquire another public IP for it. - An instance's private port can serve one load balancer only. It cannot also be the target of a port forward, or a member port of a second load balancer of the same protocol: give the second one its own private port. The gateway maps replies back by the member's address and port. - At most 256 ports in one port forwarding rule. - Load balancing is round robin only, over TCP or UDP. ``SourceBased`` is the only stickiness method. Health check policies are not offered: the gateway checks members itself when ONES has given the tenant a loopback address on the gateway; otherwise members are not health-checked. Limitations ----------- This first version of the plugin has the following limitations: - The provider APIs are for root administrators only. - **Live migration is not supported yet.** The destination host is not added to the tenant, so an instance migrated to a host with no other instance of its network loses connectivity. Host maintenance migrates instances too. - **Deploy the instances of one network one at a time.** Instances deployed in parallel can be given the same address, and all but one deployment fail. - The ONES login and controller settings cannot be changed after the provider is added; the provider has to be deleted and added again, which is refused while networks use it. - Hosts leave a tenant only when the network shuts down, not when their last instance of the network goes. - A network spans at most about 40 hosts. API reference ------------- +--------------------------+----------------------------------------------------------+ | API | Description | +==========================+==========================================================+ | ``addOnesProvider`` | Registers the ONES Fabric Manager of a physical network | +--------------------------+----------------------------------------------------------+ | ``updateOnesProvider`` | Sets or clears the provider's Aviz Gateway settings | +--------------------------+----------------------------------------------------------+ | ``listOnesProviders`` | Lists ONES providers, by physical network or ID | +--------------------------+----------------------------------------------------------+ | ``deleteOnesProvider`` | Removes a ONES provider and its controller host; refused | | | while guest networks still use it | +--------------------------+----------------------------------------------------------+