Skip to content

feat(netplan): render InfiniBand (IPoIB) interfaces#6927

Open
ArtsiomAntropau wants to merge 2 commits into
canonical:mainfrom
ArtsiomAntropau:feat/add-netplan-infiniband-support
Open

feat(netplan): render InfiniBand (IPoIB) interfaces#6927
ArtsiomAntropau wants to merge 2 commits into
canonical:mainfrom
ArtsiomAntropau:feat/add-netplan-infiniband-support

Conversation

@ArtsiomAntropau

@ArtsiomAntropau ArtsiomAntropau commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

The netplan renderer's type dispatch only handled physical, bond, bridge and vlan interfaces, so type: infiniband links were silently dropped from the generated /etc/netplan/50-cloud-init.yaml. On OpenStack instances (network_data.json -> network config v1) IPoIB interfaces disappeared entirely, even though the eni, sysconfig and network-manager renderers already rendered them.
Add an infiniband branch that configures IPoIB devices under ethernets (netplan has no dedicated infiniband section), matching on the 20-byte IPoIB hardware address and setting infiniband-mode: datagram when an MTU is present, mirroring the NetworkManager renderer. This is possible now that netplan supports IPoIB -- matching the long-form HWADDR and the infiniband-mode key (netplan 0.105, PR canonical/netplan#283) -- which was the missing-netplan-support blocker that had LP: #1848471 (GH #3474) closed as won't-fix.

Proposed Commit Message

feat(netplan): render InfiniBand (IPoIB) interfaces

The netplan renderer's type dispatch only handled physical, bond,
bridge and vlan, so `type: infiniband` interfaces were silently
dropped from the generated netplan. The eni, sysconfig and
network-manager renderers already render them, so on netplan-default
distros IPoIB links from an OpenStack network_data.json (network
config v1) ended up missing entirely.

Render InfiniBand devices under `ethernets` (netplan has no dedicated
infiniband section), matching on the 20-byte IPoIB hardware address
and setting `infiniband-mode: datagram` when an MTU is present, as the
NetworkManager renderer does. Address and MTU handling reuses
`_extract_addresses`.

This was previously not possible because netplan could not match the
long-form IPoIB HWADDR; that support was added in netplan 0.105
(canonical/netplan#283), which unblocks it here.

Fixes GH-3474

Additional Context

The netplan renderer never handled type: infiniband. The interface
loop in Renderer._render_content only has branches for
physical/bond/bridge/vlan, so IPoIB interfaces were silently dropped
from the generated netplan, while the eni, sysconfig and
network-manager renderers already rendered them.

This was reported before (GH-3474, LP: #1848471) and closed won't-fix at
the time, because netplan itself couldn't match the 20-byte IPoIB
HWADDR. That blocker is gone: netplan added IPoIB support in 0.105
(canonical/netplan#283), including matching the long HWADDR and the
infiniband-mode key, so the renderer can finally emit it.

Practical impact: OpenStack instances with IPoIB links
(network_data.json -> network config v1) get those interfaces missing
from netplan on netplan-default distros; only the ENI renderer
configured them.

The new branch renders IB under ethernets (netplan has no dedicated
infiniband section), matches on the HWADDR, and sets
infiniband-mode: datagram when an MTU is present, mirroring the
NetworkManager renderer. Address/MTU handling reuses _extract_addresses.

Test Steps

Unit tests: added a netplan round-trip case and updated the existing
large_v1 fixture, which already contained an IB interface that used to
be dropped.

pytest tests/unittests/test_net.py -k infiniband

Manual check on a live system, non-destructive via net-convert:

  1. A v1 config with an IB interface (net.yaml):
    version: 1
    config:
      - type: infiniband
        name: ib0
        mac_address: "00:00:10:48:fe:80:00:00:00:00:00:00:a0:88:c2:03:00:f7:f0:ea"
        mtu: 2044
        subnets:
          - type: static
            address: 192.168.2.80/24
  1. Render it:
    cloud-init devel net-convert \
      --network-data net.yaml --kind yaml \
      --distro ubuntu --output-kind netplan --directory out
    cat out/etc/netplan/50-cloud-init.yaml
  1. Before this change ib0 is absent. With it:
    network:
      version: 2
      ethernets:
        ib0:
          match:
            macaddress: "00:00:10:48:fe:80:00:00:00:00:00:00:a0:88:c2:03:00:f7:f0:ea"
          addresses:
          - "192.168.2.80/24"
          set-name: ib0
          mtu: 2044
          infiniband-mode: datagram
  1. On a host with netplan >= 0.105, netplan generate accepts the output.

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

The netplan renderer's type dispatch only handled physical, bond,
bridge and vlan interfaces, so `type: infiniband` links were silently
dropped from the generated /etc/netplan/50-cloud-init.yaml. On OpenStack
instances (network_data.json -> network config v1) IPoIB interfaces
disappeared entirely, even though the eni, sysconfig and network-manager
renderers already rendered them.
Add an infiniband branch that configures IPoIB devices under `ethernets`
(netplan has no dedicated infiniband section), matching on the 20-byte
IPoIB hardware address and setting `infiniband-mode: datagram` when an
MTU is present, mirroring the NetworkManager renderer.
This is possible now that netplan supports IPoIB -- matching the
long-form HWADDR and the infiniband-mode key (netplan 0.105, PR canonical#283) --
which was the missing-netplan-support blocker that had LP: #1848471
(GH canonical#3474) closed as won't-fix.
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