Repository navigation
Aviz ONES network plugin (internal review) - #1
Open
Ashok-Aviz wants to merge 3 commits into
Open
Ashok-Aviz wants to merge 3 commits into
Ashok-Aviz wants to merge 3 commits into
Conversation
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.
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.
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.addOnesProviderL2Networkingpseudo-host driven through the agent Command/Answer framework (the same pattern as NiciraNvp, BigSwitch and Netris)design)/operations/{id}). The network takes its CIDR, gateway and VLAN (vlan://<vlanId>) from ONESprepare)shared(one host carries many tenants)trash)Other parts:
add,update,deleteandlistOnesProviders.ones_providerstable, added toschema-42300to2400.sql.ones_providersand never inhost_details.The design is described in the plugin's README.
Commits
main(24.0.0-SNAPSHOT) and wired intoplugins/pom.xmlandclient/pom.xml.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:
That includes checkstyle and the tests. Apache RAT passes with
apache-rat:check.Status and open points (feedback welcome)
OnesEdge,AvizGatewayClient,tenant_gateway_suffixandpublic_ipsgive a tenant internet access through the Aviz Gateway in the lab. Should they be made general or removed before going upstream?design()is orphaned in ONES if CloudStack fails after that step.publicipssize: the range isn't size-limited.mainin the lab.apache/cloudstack-documentation.Review asks
design(), fit how we want customers to use it?OnesApiClientImpl: endpoints, payloads, and async handling.