Skip to content

Aviz ONES network plugin - #14902

Open
Ashok-Aviz wants to merge 1 commit into
apache:mainfrom
AvizNetworks:aviz-ones-plugin
Open

Ashok-Aviz wants to merge 1 commit into
apache:mainfrom
AvizNetworks:aviz-ones-plugin

Conversation

@Ashok-Aviz

@Ashok-Aviz Ashok-Aviz commented Nov 29, 2026 •

Copy link
Copy Markdown

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

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)
  • 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

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

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.
Copilot AI balanced review requested due to automatic review settings November 29, 2026 04:37
@boring-cyborg

boring-cyborg Bot commented Nov 29, 2026

Copy link
Copy Markdown

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)
Here are some useful points:

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants