Ashok-Aviz opened a new pull request, #14902:
URL: https://github.com/apache/cloudstack/pull/14902

   ### Description
   
   This PR adds a network plugin for **Aviz ONES**, 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 is one ONES **tenant**. ONES 
isolates the tenant on the fabric (its own VRF, VXLAN VNIs and north-south 
VLAN) and chooses its subnet. CloudStack runs the instances and the virtual 
router on it. Optionally, the network's edge (source NAT, port forwarding, load 
balancing and ingress firewall rules) runs on the **Aviz Gateway** that the 
tenant uses to leave the fabric.
   
   #### Network lifecycle
   
   | Network event | What the plugin does in ONES |
   |---|---|
   | create (guru `design`) | creates the tenant; the network takes its CIDR 
and gateway from ONES. If a later step fails, the tenant is deleted again |
   | `implement` | puts the network on `vlan://<tenant VLAN>`, the VLAN ONES 
trunks to the hypervisors' leaf ports |
   | NIC allocation | assigns addresses from the tenant's compute pool only |
   | element `prepare` | adds the instance's host to the tenant as a shared 
server (one hypervisor carries many tenants). On a host behind a DPU, also 
assigns the tenant one of the DPU's VFs |
   | `shutdown` | takes the hosts out of the tenant, releasing their VFs |
   | `trash` | deletes the tenant |
   
   #### Edge on the Aviz Gateway (optional)
   
   Each of SourceNat, PortForwarding, Lb and Firewall can be added to an 
offering on its own, provided by `AvizOnes`:
   
   - **Desired state, sent whole.** Whenever a public address or rule changes, 
or the network's first host joins the tenant, the element works out the 
tenant's whole edge from CloudStack's records and sends it as one command 
through the provider's resource.
   - **Public addresses are CloudStack's own.** Outbound traffic is translated 
onto the network's source NAT address; port forwards and VIPs use the network's 
other public IPs.
   - **Load balancing.** A load-balancer rule becomes a gateway VIP with every 
member as a backend: round robin, TCP or UDP, `SourceBased` stickiness.
   - **Ingress firewall rules are enforced.** The gateway filters after address 
translation, so every mapped instance address and port gets a deny for any 
source and a permit for each allowed CIDR.
   - **Only plugin-made objects are touched.** VIPs and firewall rules created 
on the gateway by an operator are left alone.
   - **Refused up front, with a clear error:**
     - a VIP on the source NAT address;
     - an instance port behind a VIP that is also port forwarded, or behind a 
second VIP (the gateway maps replies back by backend port);
     - more than 256 ports in one port forward.
   
   #### Controller and API
   
   - **Registration.** The ONES controller is registered per physical network 
(isolation method `ONES`) as a device represented by a pseudo-host of type 
`L2Networking`, as in the other SDN provider plugins.
   - **All external calls go through the agent framework.** Every call to ONES 
and to the gateway goes through `OnesResource` and Command/Answer.
   - **API.** New commands `addOnesProvider`, `updateOnesProvider`, 
`deleteOnesProvider` and `listOnesProviders`, and a new table `ones_providers`. 
Passwords and tokens are stored encrypted. TLS is always verified, optionally 
with a client certificate.
   - **ONES client behaviour.** It logs in with a ONES user (again after a 
401). Every change is sent asynchronously and the operation is polled until it 
ends.
   
   #### Outside the plugin
   
   Only the registration every plugin needs: `client/pom.xml`, 
`plugins/pom.xml`, the `ones_providers` table in `schema-42300to2400.sql`, and 
a category for the new commands in `tools/apidoc/gen_toc.py`.
   
   CloudStack asks for `gateway`/`netmask` when an isolated network is created 
from an offering without SourceNat, before ONES has chosen the subnet. For such 
offerings a placeholder is passed: a gateway outside the subnet ONES assigns is 
ignored, and the network takes ONES's subnet and gateway. A gateway inside that 
subnet is used as given.
   
   #### Known limitations of this version
   
   - Live migration does not add the destination host to the tenant yet: an 
instance migrated to a host with no other instance of its network loses 
connectivity.
   - Instances of one network should be deployed one at a time: parallel 
deploys can pick the same address.
   - The ONES login and controller settings cannot be changed after the 
provider is added.
   - Hosts leave a tenant only when the network shuts down; a network spans at 
most about 40 hosts.
   - The gateway edge services are experimental: gateway firewall rules are 
named by their position in the rule set.
   
   #### Points we would like reviewers' views on
   
   - **Enable switch.** Unlike NSX and Netris, the plugin has no global setting 
to enable it; it is active once the provider is added to a physical network. We 
can add `ones.plugin.enable` if that is preferred.
   - **UI.** There are no UI changes; configuration is through the API and 
`cmk` for now.
   - **Placeholder gateway.** Isolation-only offerings need a placeholder 
`gateway`/`netmask` because core requires one for an isolated network without 
SourceNat. A Connectivity capability letting a provider assign the guest CIDR 
would remove that; we can propose it separately.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [X] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] Build/CI
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [X] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   **Unit tests**
   - 116 tests in `plugins/network-elements/aviz-ones`:
     - the ONES and gateway REST clients against fake servers over TLS, with 
throwaway certificates;
     - the guest network guru, element, resource and edge builder, with mocks.
   - Checkstyle is clean.
   
   **Live**
   
   Environment:
   - management server built from this branch, upgraded from 4.22.1.1;
   - ONES 4.4.0 managing a leaf-spine fabric;
   - four KVM hosts on different racks;
   - an Aviz Gateway (0.1.0) with a BGP uplink to an ISP router.
   
   Results:
   - **Networks.** Networks take ONES's subnet, VLAN and pool; with a 
placeholder gateway (isolation-only offering) or none (SourceNat offering).
   - **Datapath.** Instances on four racks: same-network instances reach each 
other across racks, instances of different networks cannot reach each other, 
and instances reach the internet through the gateway's NAT on the network's 
source NAT address.
   - **Hosts join.** Hosts are added to the tenant as instances land on them.
   - **Clean delete.** Deleting the network deletes the tenant, and its VLAN is 
gone from the leaves.
   - **Edge from outside.** Seen from the ISP side of the gateway:
     - outbound NAT works on the network's source NAT address;
     - a port forward and a two-member VIP answer, with both members in the 
VIP's pool. They were not health-checked: in this setup ONES gives the tenant 
no loopback on the gateway, which the gateway's probes need, and the plugin 
then asks for no checks.
   - **Firewall.** After changing an ingress rule to another source CIDR, the 
port forward refuses the ISP's address while the VIP still answers.
   - **Edge cleanup.** Deleting the network leaves no internet access, VIP or 
plugin firewall rule of the tenant on the gateway.
   
   #### How did you try to break this feature and the system with this change?
   
   - **Admin-only APIs.** A non-admin user's call to `listOnesProviders` is 
refused.
   - **Concurrency and provider delete.** Host-list updates are serialised per 
network; deleting the provider is refused while any network (including a 
shut-down one) still has a tenant (unit tests).
   - **ONES failures** during create, add host and remove host (no VLAN or pool 
returned, refused allocation, no answer, failed async operations):
     - the deployment fails cleanly;
     - no orphan tenant remains;
     - host membership is recorded only after ONES accepted it.
   - **Management server restart.** The controller's resource is re-created 
after a restart, and the ONES login and gateway token are read from the 
encrypted provider row (they are not in `host_details`).
   - **Expired ONES session.** The client logs in again once on a 401 and does 
not loop on a persistent 401.
   - **Gateway refusals** (invalid rule, apply failure, wrong token, tenant not 
yet on the gateway): the rule operation fails with the gateway's reason. An 
earlier version returned `false`, which CloudStack reads as "not this 
provider's", and the rule showed `Active`.
   - **Conflicting rules:**
     - adding a port-forwarded instance port to a load balancer is refused;
     - a load balancer on the source NAT address is refused;
     - a port forward wider than 256 ports is refused.
   - **Operator objects on the gateway.** VIPs and firewall rules created by 
hand stay untouched through updates and network delete (unit tests against the 
fake gateway).
   - **DPU lookups.** A failed VF listing fails the host allocation instead of 
reporting success, and a VF that cannot be released keeps the host recorded 
(unit tests).
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to