Repository navigation
Aviz ONES network plugin - #14902
Aviz ONES network plugin#14902Ashok-Aviz wants to merge 1 commit into
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical findings can bypass address-pool and firewall restrictions, misassociate concurrent tenant provisioning, and leave allocations or gateway rules behind without reliable cleanup.
12 open issues
Preserve firewall guards until mapping updates succeed · New Roll back partial host and VF allocations on failure · New Prevent port-forward aliases from merging ingress policies · New Propagate gateway cleanup failures during teardown · New Key pending tenant data by a unique provisioning identity · New Enforce compute-pool limits for all instance addresses · New Abort tenant deletion while host allocations remain · New Clean up tenants when post-create retrieval fails · New Close or reuse gateway HTTP connection pools · New Validate edge rules before deferring gateway application · New Clean up tenants when network creation fails after design · New Include all network reservations in the used-address set · New
What changed in this PR
Adds Aviz ONES as a CloudStack network provider for Spectrum-X GPU fabrics. Isolated guest networks map to ONES tenants, with optional edge services on the Aviz Gateway.
Changes:
- Implements tenant lifecycle, host membership, DPU VF allocation, and compute-pool addressing.
- Adds provider administration APIs and gateway NAT, port forwarding, load balancing, and firewall integration.
- Registers the plugin, adds encrypted provider storage, and includes documentation and unit tests.
| File | Description |
|---|---|
| tools/apidoc/gen_toc.py | Categorizes ONES provider APIs. |
| plugins/pom.xml | Adds the plugin module. |
| plugins/network-elements/aviz-ones/src/test/java/org/apache/cloudstack/network/ones/service/OnesGuestNetworkGuruTest.java | Tests tenant lifecycle and address selection. |
| plugins/network-elements/aviz-ones/src/test/java/org/apache/cloudstack/network/ones/service/OnesElementTest.java | Tests provider services and host membership. |
| plugins/network-elements/aviz-ones/src/test/java/org/apache/cloudstack/network/ones/service/OnesEdgeBuilderTest.java | Tests edge-state construction and validation. |
| plugins/network-elements/aviz-ones/src/test/java/org/apache/cloudstack/network/ones/resource/OnesResourceTest.java | Tests command dispatch and credential recovery. |
| plugins/network-elements/aviz-ones/src/test/java/org/apache/cloudstack/network/ones/client/TestCertificates.java | Generates TLS test certificates. |
| plugins/network-elements/aviz-ones/src/test/java/org/apache/cloudstack/network/ones/client/AvizGatewayClientTest.java | Tests gateway operations against a TLS server. |
| plugins/network-elements/aviz-ones/src/main/resources/META-INF/cloudstack/ones/spring-ones-context.xml | Registers plugin components. |
| plugins/network-elements/aviz-ones/src/main/resources/META-INF/cloudstack/ones/module.properties | Declares the network module. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/service/OnesGuestNetworkGuru.java | Maps guest networks to ONES tenants. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/service/OnesElementService.java | Defines provider administration operations. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/service/OnesEdgeBuilder.java | Builds desired gateway state. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/resource/OnesResource.java | Dispatches agent commands to REST clients. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/dao/OnesProviderVO.java | Models provider settings and encrypted secrets. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/dao/OnesProviderDaoImpl.java | Implements physical-network provider lookup. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/dao/OnesProviderDao.java | Defines provider persistence access. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/client/OnesApiClientImpl.java | Implements ONES authentication and fabric operations. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/client/OnesApiClient.java | Defines the ONES client contract. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/client/AvizGatewayClient.java | Reconciles gateway edge configuration. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/api/response/OnesProviderResponse.java | Exposes non-secret provider details. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/api/command/UpdateOnesProviderCmd.java | Adds gateway configuration updates. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/api/command/ListOnesProvidersCmd.java | Adds provider listing. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/api/command/DeleteOnesProviderCmd.java | Adds provider deletion. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/api/command/AddOnesProviderCmd.java | Adds controller registration. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/agent/api/StartupOnesCommand.java | Identifies the controller as an L2 networking host. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/agent/api/RemoveOnesEdgeCommand.java | Requests gateway edge cleanup. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/agent/api/DeleteOnesTenantCommand.java | Requests tenant deletion. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/agent/api/DeallocateOnesServersCommand.java | Requests host removal from a tenant. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/agent/api/CreateOnesTenantCommand.java | Requests tenant creation. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/agent/api/CreateOnesTenantAnswer.java | Returns tenant addressing and isolation data. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/agent/api/ConfigureOnesEdgeCommand.java | Carries complete desired edge configuration. |
| plugins/network-elements/aviz-ones/src/main/java/org/apache/cloudstack/network/ones/agent/api/AllocateOnesServersCommand.java | Requests shared host membership. |
| plugins/network-elements/aviz-ones/README.md | Documents setup, architecture, and limitations. |
| plugins/network-elements/aviz-ones/pom.xml | Defines the plugin artifact and test dependency. |
| engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql | Creates the provider storage table. |
| client/pom.xml | Includes the plugin in the management server. |
Review effort: Balanced
| PENDING_NAMES.put(subnet, tenantName); | ||
| logger.info("ONES tenant {} for network {}: vlan {}, subnet {}, pool {}, gateway {}, l3vni {}", tenantName, name, | ||
| t.getVlanId(), subnet, t.getIpPool(), gateway, t.getL3Vni()); | ||
| return network; |
There was a problem hiding this comment.
Agreed that this can happen, and the plugin alone cannot fully close it. The tenant has to exist in design() because the network takes its CIDR and gateway from ONES when it is created. If persisting the network then fails, core does not call the guru back (setup() is not reached and trash() is never called). A real fix needs a core hook, or a way to create the network before its CIDR is known; we kept this PR plugin-only, so it is now a documented limitation (README, docs and the PR description). Meanwhile the tenant name is logged when it is created, and the tenant's description names the network, so an operator can find and delete it in ONES. We would be glad to propose a small core hook (for example a guru callback when setupNetwork fails after design) in a separate PR if maintainers think that is the right direction.
New network plugin for Aviz ONES, the fabric manager of leaf-spine fabrics for GPU clusters on the NVIDIA Spectrum-X reference architecture. An isolated guest network is one ONES tenant: ONES isolates it on the fabric (its own VRF, VXLAN VNIs and north-south VLAN) and chooses its subnet; CloudStack runs the VMs and the virtual router on it. Optionally the network's edge (NAT, port forwarding, load balancing, ingress firewall) runs on the Aviz Gateway the tenant leaves the fabric through. The change is confined to the plugin, apart from its registration (poms, the ones_providers table, the apidoc category). Network lifecycle (OnesGuestNetworkGuru, OnesElement) - design: creates the tenant in ONES and takes the network's CIDR and gateway from it; if anything fails afterwards the tenant is deleted again. The network is put on vlan://<tenant VLAN>, the VLAN ONES trunks to the hypervisors' leaf ports. - CloudStack asks for gateway/netmask on an isolated network without SourceNat before ONES has chosen the subnet: a gateway outside the subnet ONES assigns is taken as a placeholder and ONES's gateway is used; one inside it is used as given. - NIC addresses come from the tenant's compute pool only, requested ones included. - prepare: adds the VM's host to the tenant as a shared server (one hypervisor carries many tenants), under a per-network lock; on a host behind a DPU it also assigns the tenant one of the DPU's VFs. - shutdown: takes the hosts out of the tenant (releasing their VFs; a VF that cannot be released keeps the host recorded); trash: deletes the tenant. Edge on the Aviz Gateway (SourceNat, PortForwarding, Lb, Firewall) - The element works out the tenant's whole edge from CloudStack's records whenever an address or rule changes, or the first host joins the tenant, and sends it as one command; shutdown and destroy remove it. Public addresses are CloudStack's own. - A load-balancer rule is a gateway VIP with every member (round robin, tcp or udp, SourceBased stickiness). - Ingress firewall rules are enforced: the gateway filters after translation, so each mapped VM address:port gets a deny for any source and a permit per allowed CIDR. Gateway rules are named after what they do; a change puts denies, then permits, then mappings on the gateway and removes stale rules last. - Only objects the plugin created on the gateway are changed or removed. Combinations the gateway cannot serve are refused up front (a VIP on the source NAT address, a VM port behind a VIP that is also port forwarded or behind a second VIP, two port forwards to one VM port allowing different sources, more than 256 ports in one port forward), also before the network's first VM runs. - A gateway that cannot remove the edge fails shutdown and destroy, so CloudStack keeps the network and retries. Controller and API - The ONES controller is registered per physical network (one per physical network) as a device with a pseudo-host (L2Networking); every call to ONES and to the gateway goes through OnesResource and the agent Command/Answer framework. - addOnesProvider, updateOnesProvider, deleteOnesProvider, listOnesProviders, for root admins; table ones_providers. Passwords and tokens are stored encrypted and kept out of error messages; TLS is always verified, optionally with a client certificate. - deleteOnesProvider is refused while a network still has a tenant. - The ONES client logs in with a ONES user (again on a 401) and sends every change asynchronously, polling the operation until it ends. A failed DPU VF lookup fails the host allocation; a host whose VF cannot be assigned is taken out of the tenant again, and a tenant that cannot be read back after its creation is deleted again. Known limitations of this version: live migration does not add the destination host to the tenant; VMs of one network should be deployed one at a time; ONES credentials cannot be changed after the provider is added; hosts leave a tenant only when the network shuts down; a tenant stays in ONES if CloudStack fails to store its network after creating it. Tests - 133 unit tests in the plugin: the ONES and gateway REST clients against fake servers over TLS, the guru, element, resource and edge builder with mocks. - Run live against a ONES-managed leaf-spine fabric with KVM hosts on four racks: networks and VMs across racks, isolation between tenants, outbound NAT, a port forward and a two-member VIP reachable from outside, ingress rules enforced, admin-only APIs, and delete leaving nothing behind in ONES, on the leaves or on the gateway.
d4c4bc8 to
4a1aef6
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects allow out-of-pool IP allocation, premature gateway success reports, and host/VF lifecycle failures that can orphan membership or disconnect VMs.
7 open issues
Reject blocked or nonconverged apply reports · New Reconcile accepted ONES adds when polling fails · New Wire DPU VFs into KVM or reject unsupported hosts · New Restrict guest IP allocation to the compute pool CIDR · New Propagate VF release failures before shutting down · New Reject port mappings without a source NAT address · New Clean up tenants when network creation fails after design
11 resolved since last review
Abort tenant deletion while host allocations remain Enforce compute-pool limits for all instance addresses Key pending tenant data by a unique provisioning identity Propagate gateway cleanup failures during teardown Prevent port-forward aliases from merging ingress policies Roll back partial host and VF allocations on failure Preserve firewall guards until mapping updates succeed Include all network reservations in the used-address set Validate edge rules before deferring gateway application Close or reuse gateway HTTP connection pools Clean up tenants when post-create retrieval fails
Review effort: Balanced
| if (root != null && root.isJsonObject() && root.getAsJsonObject().has("failed") | ||
| && root.getAsJsonObject().get("failed").isJsonPrimitive() && root.getAsJsonObject().get("failed").getAsInt() > 0) { | ||
| throw new IOException(what + ": the gateway could not apply it: " + abbreviate(r.body)); | ||
| } |
| if (!added.getResult()) { | ||
| return added; |
| assignDpuVf(cmd.getFabricName(), server, cmd.getTenantName()); | ||
| } | ||
| return added; |
| network.setCidr(subnet); | ||
| network.setNetworkCidr(null); |
| String tenantName = detail(profile.getId(), OnesElement.DETAIL_TENANT_NAME); | ||
| if (tenantName != null) { | ||
| OnesProviderVO device = findProviderOrThrow(profile.getPhysicalNetworkId()); | ||
| removeHosts(profile.getId(), device, tenantName); |
| final boolean withPortForwarding, final boolean withLb, final boolean withFirewall) { | ||
| long id = network.getId(); | ||
| String sourceNat = withSourceNat ? sourceNatAddress(id) : null; | ||
| List<PortMapping> mappings = portMappings(id, withPortForwarding); |


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.
Documentation: apache/cloudstack-documentation#706
Network lifecycle
design)implementvlan://<tenant VLAN>, the VLAN ONES trunks to the hypervisors' leaf portsprepareshutdowntrashEdge on the Aviz Gateway (optional)
Each of SourceNat, PortForwarding, Lb and Firewall can be added to an offering on its own, provided by
AvizOnes:SourceBasedstickiness.Controller and API
ONES) as a device represented by a pseudo-host of typeL2Networking, as in the other SDN provider plugins.OnesResourceand Command/Answer.addOnesProvider,updateOnesProvider,deleteOnesProviderandlistOnesProviders, and a new tableones_providers. Passwords and tokens are stored encrypted. TLS is always verified, optionally with a client certificate.Outside the plugin
Only the registration every plugin needs:
client/pom.xml,plugins/pom.xml, theones_providerstable inschema-42300to2400.sql, and a category for the new commands intools/apidoc/gen_toc.py.CloudStack asks for
gateway/netmaskwhen 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
design(), before CloudStack stores the network. If storing it fails, core does not call the guru back, so the tenant stays in ONES (its name is logged, and its description names the network) and has to be deleted there.Points we would like reviewers' views on
ones.plugin.enableif that is preferred.cmkfor now.gateway/netmaskbecause 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
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Unit tests
plugins/network-elements/aviz-ones:Live
Environment:
Results:
How did you try to break this feature and the system with this change?
listOnesProvidersis refused.host_details).false, which CloudStack reads as "not this provider's", and the rule showedActive.