Repository navigation
feat(ironic): cisco_nxos follow-ups: endpoint URL, clearer errors, richer inspection - #2827
Merged
Merged
Conversation
cardoe
enabled auto-merge
November 30, 2026 19:38
driver_info nxos_address is now a URL, so a switch whose NX-API is not on 443 can be reached: the port goes in the URL. https is assumed when the scheme is missing, a bare IPv6 address is bracketed, and the path defaults to /ins (NX-API's endpoint) unless one is given. A bare address such as 192.0.2.20 still works as before. An address that is not an http or https URL, has an invalid port, or carries credentials, a query or a fragment fails validate(). The address is parsed with rfc3986, now a direct dependency (it was already installed through ironic). NxosClient now takes the endpoint URL rather than building it from the address. Also reword the nxos_address and components_from_show_version descriptions per review on #2825.
cardoe
force-pushed
the
cisco-nxos-review-followups
branch
from
November 30, 2026 20:00
c21acaf to
28c62ef
Compare
cardoe
force-pushed
the
cisco-nxos-review-followups
branch
from
November 30, 2026 22:51
f4903e5 to
f172fc4
Compare
A switch whose NX-API is disabled, on another port, in another VRF or
behind an ACL drops the connection rather than refusing it. With a
single 60s timeout, verify held the node's lock for a minute before
failing. Connecting now times out after 10s; reading still allows 60s,
since show commands on a large chassis can be slow.
The failure was reported as urllib3's retry wrapper
("HTTPSConnectionPool(...) Max retries exceeded ... at 0x..."). It is
now a short reason with a pointer to 'show nxapi' for connect timeouts
and refusals, the underlying cause for TLS failures, and the resolved
NX-API endpoint (with its port and path) rather than the raw
nxos_address.
show version reports the switch BIOS version as bios_ver_str alongside the NX-OS release. Record it as the bios firmware component, the name redfish uses for a server's BIOS, next to nxos. Each component is only recorded if the switch reports it, so a switch reporting only one of the two still gets that one.
Inspect now fills the inventory with what the switch reports about its
hardware, all read in the same single NX-API request:
- cpu: model_name from show version and count, the logical CPUs in
show system resources
- memory: total and physical_mb from show version (the memory NX-OS
sees, a little under what is installed), converted to an integer
where a release reports it as a string
- interfaces[].transceiver: type, vendor, part number, revision, serial
and, for Cisco-coded optics, the Cisco product ID, from
show interface transceiver
- components: the chassis, slots, power supplies and fans from
show inventory, with description, product, version ID and serial
- chassis_mac: the switch MAC, as its own key the way agent inspection
keeps bmc_mac, since it is not a port
Only show version and show interface are required; a switch that
cannot answer the rest is logged, not failed. interfaces is always in
the inventory, even when empty; the other keys are left out when not
reported.
system_vendor.product_name is now the bare model instead of show
version's chassis_id: the leading "cisco", "Chassis" and anything after
it, and the family when a model follows it, are dropped. So
"cisco Nexus9000 C93180YC-FX3 Chassis" is C93180YC-FX3, while a
platform with no separate model keeps its family name ("Nexus 5548
Chassis" is "Nexus 5548"). Inspection rules are now applied after the
data is stored, as redfish inspection does; before, rules never ran for
these nodes.
Inspect no longer creates or corrects baremetal ports; that is left to
an inspection hook working from the inventory's interfaces. It also no
longer writes properties['chassis_mac'] or reads show running-config
lldp. The plugin data is now empty: nxos_version duplicated the nxos
firmware component, and lldp_chassis_id was unused. NxosClient.show_text
and parse_lldp_chassis_id had no other callers and are removed.
Like [redfish] inspection_hooks: a comma-separated list of inspection hooks the cisco_nxos inspect interface loads at startup and runs on the data it collects, before storing it and applying inspection rules, in the same order as redfish inspection. It is empty by default because the standard hooks (such as ports) expect a server's inventory. This gives a ports hook for switches a place to be enabled once it exists.
When NX-API rejects a whole batch, for example as too large, it can answer with a single JSON-RPC error that matches none of the commands' ids, often with a null id. Each command was then reported as "no response" and the switch's message was lost. Report that error for every command instead. It only applies when the answer is a lone error matching no command, so an unmatched success, or a batch where some commands were answered, is still reported as before.
cardoe
force-pushed
the
cisco-nxos-review-followups
branch
from
November 30, 2026 22:55
f172fc4 to
af97e91
Compare
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.
Follow-ups to #2825: review feedback, plus fixes from running the driver against a real Nexus (C93180YC-FX3, NX-OS 10.5(6)) in dev.
NX-API endpoint as a URL (review feedback)
driver_info['nxos_address']is now a URL, so switches whose NX-API isn't on 443 work by putting the port in the URL (e.g.https://192.0.2.20:8443). The scheme defaults to https, a bare IPv6 address is bracketed, and the path defaults to/insunless one is given. A bare address such as192.0.2.20still works as before.validate()rejects an address that isn't an http/https URL, has an invalid port, or carries credentials, a query or a fragment.NxosClienttakes the endpoint URL instead of building it.rfc3986(already installed via ironic) is now a direct dependency since it's imported.nxos_addressproperty description and thecomponents_from_show_versiondocstring per Steve's suggestions.The port handling addresses Kenny's comment about NX-API not being on 443.
Fail fast and explain an unreachable switch
The dev switch had
nxapi https portset to a non-default port, andmanagesat for 60s before failing with urllib3's rawHTTPSConnectionPool(...) Max retries exceeded ... at 0x....Cannot read the firmware version from NX-API https://192.0.2.20/ins: timed out connecting after 10s; check 'show nxapi' on the switch: .... TLS failures give the underlying cause.BIOS firmware component
show version'sbios_ver_stris recorded as thebiosfirmware component next tonxos. Each is only recorded if reported.Inspection inventory, and no more ports from the driver
Inspect now reads the switch's hardware into the inventory, all in the same single NX-API request:
cpu(model_name,count)show version,show system resourcesmemory(total,physical_mb)show versioninterfaces[].transceiver(type, vendor, part number, revision, serial, Cisco product ID)show interface transceivercomponents(chassis, slots, PSUs, fans with description, product ID, version ID, serial)show inventorychassis_mac, as its own key the way agent inspection keepsbmc_macshow vdc detailOnly
show versionandshow interfaceare required; a switch that can't answer the rest is logged, not failed.interfacesis always present, even if empty; the other keys are left out when not reported.Other changes:
system_vendor.product_nameis the bare model (C93180YC-FX3) instead ofcisco Nexus9000 C93180YC-FX3 Chassis. A platform with no separate model keeps its family name (Nexus 5548 ChassisisNexus 5548).interfaces. Ports created by the earlier code are left alone.properties['chassis_mac']or readsshow running-config lldp. The plugin data is now empty:nxos_versionduplicated the firmware component andlldp_chassis_idwas unused.NxosClient.show_text()andparse_lldp_chassis_id()had no other callers and are removed.[cisco_nxos] inspection_hooksA comma-separated list of inspection hooks, like
[redfish] inspection_hooks, run on the collected data before it's stored and rules are applied. It's empty by default, because the standard hooks expect a server's inventory; it's where a ports hook for switches will be enabled.docs/design-guide/ironic.mdis updated to match.