Repository navigation
Aviz ONES network plugin - #14902
Open
Ashok-Aviz wants to merge 1 commit into
Open
Aviz ONES network plugin#14902Ashok-Aviz wants to merge 1 commit into
Ashok-Aviz wants to merge 1 commit into
Conversation
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. - 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. - 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, more than 256 ports in one port forward). 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. 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. Tests - 116 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.
|
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)
|
Contributor
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
Comment on lines
+130
to
+132
| for (FirewallRule r : cmd.getFirewallRules()) { | ||
| putFirewallRule(tenant, r); | ||
| wantedRules.add(r.getName()); |
Comment on lines
+406
to
+408
| } catch (Exception e) { | ||
| LOG.error("Failed to assign {}: {}", what, e.getMessage()); | ||
| return new Answer(cmd, e); |
Comment on lines
+241
to
+242
| wanted.putIfAbsent("permit " + cidr + " " + dst + " " + t.protocol + " " + t.localPort, | ||
| new String[]{"permit", cidr, dst, t.protocol, String.valueOf(t.localPort)}); |
Comment on lines
+683
to
+698
| protected void removeEdge(final Network network) { | ||
| String tenant = networkDetailsDao.findDetail(network.getId(), DETAIL_TENANT_NAME) != null ? getTenantName(network) : null; | ||
| if (tenant == null || !hasEdge(network)) { | ||
| return; | ||
| } | ||
| OnesProviderVO device = findProviderOrThrow(network); | ||
| if (!gatewayConfigured(device)) { | ||
| return; | ||
| } | ||
| RemoveOnesEdgeCommand cmd = new RemoveOnesEdgeCommand(tenant); | ||
| cmd.setWait(EDGE_WAIT_S); | ||
| Answer answer = agentMgr.easySend(device.getHostId(), cmd); | ||
| if (answer == null || !answer.getResult()) { | ||
| logger.warn("Could not remove the Aviz Gateway edge of network {}: {}", network, answer != null ? answer.getDetails() : "no answer"); | ||
| } | ||
| } |
Comment on lines
+193
to
+194
| PENDING.put(subnet, t); | ||
| PENDING_NAMES.put(subnet, tenantName); |
Comment on lines
+347
to
+349
| } catch (Exception e) { | ||
| LOG.error("Failed to {}: {}", what, e.getMessage()); | ||
| return new CreateOnesTenantAnswer(cmd, e); |
| throw new CloudRuntimeException("The Aviz ONES provider of physical network " + physicalNetworkId | ||
| + " has no Aviz Gateway (set gatewayurl and gatewaytoken with updateOnesProvider)"); | ||
| } | ||
| return new AvizGatewayClient(provider.getGatewayUrl(), provider.getGatewayToken(), provider.getGatewayCaCertPath()); |
Comment on lines
+636
to
+658
| if (getAllocatedHosts(network.getId()).isEmpty()) { | ||
| return null; | ||
| } | ||
| OnesProviderVO device = findProviderOrThrow(network); | ||
| if (!gatewayConfigured(device)) { | ||
| return "the network uses Aviz ONES edge services but its provider has no Aviz Gateway (updateOnesProvider gatewayurl, gatewaytoken)"; | ||
| } | ||
| String[] error = new String[1]; | ||
| try { | ||
| boolean locked = underLock("ones.edge." + network.getId(), () -> { | ||
| ConfigureOnesEdgeCommand cmd = edgeBuilder().build(network, getTenantName(network), canHandle(network, Service.SourceNat), | ||
| canHandle(network, Service.PortForwarding), canHandle(network, Service.Lb), canHandle(network, Service.Firewall)); | ||
| cmd.setWait(EDGE_WAIT_S); | ||
| Answer answer = agentMgr.easySend(device.getHostId(), cmd); | ||
| if (answer == null || !answer.getResult()) { | ||
| error[0] = answer != null ? answer.getDetails() : "no answer from the Aviz ONES resource"; | ||
| } | ||
| return true; | ||
| }); | ||
| return locked ? error[0] : "could not lock the network's edge"; | ||
| } catch (CloudRuntimeException e) { | ||
| return e.getMessage(); | ||
| } |
| 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; |
| * twice as many usable addresses, i.e. a /27 or bigger); a smaller pool is used from .1. | ||
| */ | ||
| String freeAddress(final Network network, final String pool) throws InsufficientAddressCapacityException { | ||
| Set<String> used = new HashSet<>(_nicDao.listIpAddressInNetwork(network.getId())); |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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
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.