Skip to content

Aviz ONES network plugin (internal review) - #1

Open
Ashok-Aviz wants to merge 3 commits into
mainfrom
aviz-ones-network-plugin
Open

Ashok-Aviz wants to merge 3 commits into
mainfrom
aviz-ones-network-plugin

Conversation

@Ashok-Aviz

Copy link
Copy Markdown

Internal review only. Please don't merge. The fork's main stays an exact mirror of apache/cloudstack main. When this is approved, the upstream PR to apache/cloudstack is raised from this same branch, linked here, and this PR is closed.

What this adds

A new network element plugin, plugins/network-elements/aviz-ones. It maps a CloudStack isolated guest network 1:1 to an Aviz ONES tenant on a Spectrum-X fabric.

CloudStack event What the plugin does in ONES
addOnesProvider Registers the ONES Fabric Manager for a physical network, as an L2Networking pseudo-host driven through the agent Command/Answer framework (the same pattern as NiciraNvp, BigSwitch and Netris)
Network create (guru design) Creates the tenant (async, polls /operations/{id}). The network takes its CIDR, gateway and VLAN (vlan://<vlanId>) from ONES
VM placement (element prepare) Adds the VM's hypervisor host to the tenant, shared (one host carries many tenants)
Network shutdown Takes the network's hosts out of the tenant
Network delete (guru trash) Deletes the tenant

Other parts:

  • API: add, update, delete and listOnesProviders.
  • Schema: the ones_providers table, added to schema-42300to2400.sql.
  • Auth: a ONES user login with re-login on 401. The password is stored encrypted in ones_providers and never in host_details.
  • TLS: mTLS is optional.

The design is described in the plugin's README.

Commits

  1. Aviz ONES network plugin. The 4.22.1.1 lab port, rebased onto main (24.0.0-SNAPSHOT) and wired into plugins/pom.xml and client/pom.xml.
  2. Unit tests. 71 tests:
    • The REST client runs against a fake ONES over mutual TLS: login, 401 handling, async operations, and TLS failures.
    • Mockito tests for the guru, the element and the resource.
  3. Fixes. The client now honours AllocateOnesServersCommand.isShared(). Tenant pools of /29 or smaller can now give out addresses: before, they reported "full" on the first VM.

How to build and test

JDK 17, as in upstream CI:

mvn -P developer -Dnoredist -pl plugins/network-elements/aviz-ones -am install

That includes checkstyle and the tests. Apache RAT passes with apache-rat:check.

Status and open points (feedback welcome)

  • Lab-only parts: OnesEdge, AvizGatewayClient, tenant_gateway_suffix and public_ips give a tenant internet access through the Aviz Gateway in the lab. Should they be made general or removed before going upstream?
  • Orphan tenant: a tenant created in design() is orphaned in ONES if CloudStack fails after that step.
  • publicips size: the range isn't size-limited.
  • End-to-end run: so far it has only run on 4.22.1.1. It still needs a run against main in the lab.
  • UI and docs: the provider in the CloudStack UI, and a docs PR to apache/cloudstack-documentation.
  • Before the upstream PR: the Apache contributor agreement (CCLA or software grant) and a dev@cloudstack.apache.org discussion.

Review asks

  • Design: does the 1:1 network↔tenant mapping, and creating the tenant at design(), fit how we want customers to use it?
  • The ONES API contract in OnesApiClientImpl: endpoints, payloads, and async handling.
  • Anything Aviz-internal that shouldn't go upstream.

New network element plugin (plugins/network-elements/aviz-ones) that maps a
CloudStack isolated guest network 1:1 to an Aviz ONES tenant on a Spectrum-X
fabric:

- addOnesProvider / updateOnesProvider / deleteOnesProvider / listOnesProviders
  register the ONES Fabric Manager per physical network, as an L2Networking
  pseudo-host driven through the agent Command/Answer framework.
- OnesGuestNetworkGuru creates the ONES tenant at network design, takes the
  network's CIDR, gateway and VLAN from ONES, and deletes the tenant on trash.
- OnesElement allocates the destination hypervisor host to the tenant on VM
  placement and releases hosts on network shutdown.
- ONES API: user login with re-login on 401, Prefer: respond-async with
  operation polling.
- Schema: ones_providers table in the 4.23 -> 24.0 upgrade.
66 tests across the plugin's four moving parts:

- OnesApiClientImplTest (16): runs the REST client against a fake ONES
  (UI login + Fabric Manager tenant API) over mutual TLS with throwaway
  certificates. Covers login and token reuse, re-login and a single retry
  on 401, no loop on a persistent 401, a failed login, async create /
  delete / PATCH with operation polling to SUCCESS and to FAILED, a
  synchronous FM reply, an existing tenant, a missing tenant, shared
  server allocation, and TLS failure in both directions.
- OnesGuestNetworkGuruTest (25): canHandle, design taking subnet, gateway
  and VLAN from ONES (requested gateway inside or outside the subnet,
  provider gateway suffix), deleting the tenant again when no usable
  gateway or VLAN comes back, tenant name format, setup details,
  implement on vlan://<id>, NIC addresses from the pool, shutdown
  releasing hosts and trash deleting the tenant.
- OnesElementTest (14): prepare adding a host to the tenant once and
  shared, failures, other providers, and provider API validation.
- OnesResourceTest (11): configure validation, command dispatch, and the
  lazy client built from ones_providers after a restart.
- The client ignored AllocateOnesServersCommand.isShared() and always
  sent "shared": true. It now sends the command's value. Deallocation
  stays shared, which is how OnesElement adds hosts (it always asks for
  shared), so behaviour on a real fabric is unchanged.
- NIC addresses started at the pool's 10th address, so a tenant pool of
  /29 or smaller could never give out an address ("pool is full" on the
  first VM). The bottom nine are now left to the operator only in a pool
  with at least twice that many usable addresses (a /27 or bigger); a
  smaller pool is used from .1. Large pools behave as before.

Tests: shared=false reaches ONES and deallocation is shared; /27 still
starts at .10; /28, /29 and /30 start at .1, skip the gateway and used
addresses, and report full correctly.
@Ashok-Aviz
Ashok-Aviz requested a balanced review from Copilot November 14, 2026 18:13
@Ashok-Aviz
Ashok-Aviz removed the request for review from Copilot November 14, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant