Files
ilker 49ba7ed874 hpcod: separate the cluster from the tenant that owns it
One tenant may run several HPC clusters at the same time. The code did not
allow for that: a single tenant_id drove the bridge, the subnet, the MAC
prefix, the VM names, the vendor-data filename and the public hostname. A
tenant asking for a second cluster while the first was running would have
been handed the same bridge, the same subnet and the same MAC prefix - and
Warewulf matches nodes by MAC, so the second cluster would have broken the
first rather than failing cleanly.

Everything that must not collide is now keyed on cluster_id, and tenant_id
survives as what it always meant: who owns this. Bridges are vmbrC###,
hosts c###-head and c###-node#, the portal is c###.hpc.example.org, and the
Slurm ClusterName is the cluster's - which matters for the accounting work
next, because records attributed to a shared name cannot be separated
afterwards.

The bound of 254 therefore applies to clusters running at one time, not to
tenants. It comes from the addressing and nothing else: cluster_id is the
third octet of 10.64.x.0/24 and one byte of the MAC. That is written down
in 20.5a rather than left to be rediscovered.

The registry keeps its shape but not its name: /etc/hpcod/clusters.yaml
with a clusters: key, /etc/hpcod/clusters/ for the pinned certificates,
-clusters and -cluster-domain on the portal, and the two scripts renamed to
match. A half-finished rename would have left the most-read file still
calling a cluster a tenant, which is the confusion this commit exists to
remove.

Verified on a cold provision: terraform 37s, self-configuration 43s, nodes
61s, 141s total; nodes named c002-node[1-2], ClusterName c002, bridge
vmbrC002, and the portal answering 401 at c002.hpc.example.org.

Not addressed here, and the more binding limit at the scale this is meant
for: a cluster cannot span Proxmox nodes. Its bridge is bridge-ports none,
a local L2 island, so two hypervisors would give two segments and PXE would
not cross. Proxmox SDN is the way out and is already enabled on hv01;
docs/20 anticipated it with vlan_tag in the allocation record.
2026-09-20 20:26:49 +02:00
..