Skip to content

cozystack preset: reproduce full node network topology beyond the primary default-route link #226

Description

Problem

The cozystack preset renders machine.network.interfaces from discovery of the single default-route-bearing link only — talm.discovered.default_link_name_by_gateway plus its bond_config plus at most one VLAN (only if that link is itself a VLAN) — plus one optional VIP link. Nodes whose real topology is richer than one primary link cannot be expressed through the preset, so operators fork the template and hand-edit the rendered node configs. Those edits then drift from the template and can no longer be re-rendered with talm template/apply.

Example of a node that is not expressible today:

  • bond0 (802.3ad over two NICs) carrying the default route and a tagged VLAN (vlanId: 7, 198.51.100.0/24) and a VIP;
  • a second bond bond1 (802.3ad over two other NICs) on a separate L2 storage network (203.0.113.0/24) with no default route, carrying one or two addresses and its own VIP.

None of the following are reproducible by the preset: (1) a secondary link that does not carry the default route; (2) an additional VLAN child on a link (beyond the single primary VLAN); (3) multiple addresses on one link.

The discovery library already ships the primitives — bond_config, bond_slaves, is_vlan, vlan_id, parent_link_name, and existing_interfaces_configuration (which returns the full applied machine.network.interfaces). The gap is that the preset composes only the primary link.

Proposed approaches (either or both)

A. Preserve-existing (discovery, minimal). talm.discovered.existing_interfaces_configuration already returns the full applied interface config; the preset computes it ($existingInterfacesConfiguration) but never emits it. Add e.g. network.preserveExisting: true that emits it verbatim instead of rebuilding only the primary link. Any already-applied topology is then preserved by discovery with zero hand-edits.

B. Declarative extra links (topology in git). Add a values schema for additional links/VLANs/addresses layered on the discovered primary link:

network:
  extraLinks:
    - interface: bond1
      bond: { interfaces: [enp3s0, enp4s0], mode: 802.3ad }
      addresses: [203.0.113.10/24, 203.0.113.11/24]
    - interface: bond0
      vlans:
        - vlanId: 7
          addresses: [198.51.100.10/24]

A preserves what is applied; B keeps the topology declarative in git. For nodes with a storage bond or multiple VLANs this is the difference between forking the template and using the stock preset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions