feat: NetworkTargetDict.uplinks, the NICs a bridge leaves through (NetOrk/netork#1325)
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 36s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m12s
CI / driver (pull_request) Successful in 2m47s
driver / publish (pull_request) Skipped

A VM on a VLAN-aware bridge without a VLAN tag only gets an address when
the switch port behind the bridge carries an untagged network. To find
that port, the caller needs the bridge's physical NICs: their LLDP
neighbours name the switch and the port.

uplinks lists them in groups, one per way out of the bridge: a bond's
slaves together, a single NIC alone. A bond is one link, so a caller can
let one slave's neighbour speak for the others when lldpd sees only one.
Internal, VLAN and virtual ports are no uplinks. A missing key means the
driver cannot tell; an empty list is a bridge without uplink.
This commit is contained in:
christianmanivong committed 2026-10-30 09:27:23 +01:00
1 parent 145c2c668b
commit a5b7b540c6
5 files changed
+47 -6

No files matched your search

+3 -1
View File
@@ -613,7 +613,9 @@ class HypervisorDriver(PackageManagementMixin, HealthMetricsMixin, DeviceTypeDri
List[NetworkTargetDict] - each entry's ``vlan_aware`` flag tells the
caller whether a ``NICConfigDict.vlan_tag`` may additionally be set
for a NIC using that target (see ``NetworkTargetDict`` for the
per-kind rules).
per-kind rules). ``uplinks``, where the driver can tell, names
the physical NICs a bridge leaves the host through, grouped:
a bond's slaves in one group, a single NIC in its own.
"""
...
+5 -5
View File
@@ -1310,17 +1310,17 @@ class NetworkTargetDict(TypedDict):
Distinguishes real bridges (Linux or OVS) from SDN network segments (vnets),
and tells the caller whether a separate ``vlan_tag`` may be applied on top:
- Linux bridge: vlan_aware reflects the bridge's own ``bridge_vlan_aware`` flag.
- OVS bridge: always vlan_aware (OVS bridges tag per-port regardless of a
dedicated "VLAN aware" setting).
- SDN vnet: never vlan_aware — the VLAN is already fixed by the vnet's zone/tag,
so a NIC attached to it must not also carry a ``vlan_tag``. That fixed VLAN
is surfaced via ``fixed_vlan_tag`` instead, for display purposes.
- OVS bridge: always vlan_aware (OVS tags per port, with no "VLAN aware" setting).
- SDN vnet: never vlan_aware — its zone/tag fixes the VLAN (``fixed_vlan_tag``).
``uplinks``: the physical NICs it leaves the host through, one group per way out
(a bond's slaves together, a single NIC alone); no internal, VLAN or virtual ports.
"""
name: str # Bridge, vnet or port group name, usable directly as NICConfigDict.bridge
kind: str # "bridge", "vnet" or "portgroup" (VMware: VLAN fixed like a vnet's)
vlan_aware: bool # True if a NICConfigDict.vlan_tag may be set on top of this target
fixed_vlan_tag: NotRequired[int | None] # vnet only: the VLAN ID already baked into it
uplinks: NotRequired[list[list[str]]] # NIC groups it leaves through; absent = unknown
class StorageTargetDict(TypedDict):