2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-20 17:32:15 +00:00
Commit Graph

29697 Commits

Author SHA1 Message Date
Daniel Hilst 64a7bfca00 fix(xcat-core): Genesis OpenEmbedded asks for DHCPv6 on every nic
The OpenEmbedded Genesis image runs DHCPv6 on every nic of a node under one DUID,
so a node with several nics on the provisioning network holds its reserved
address on whichever nic asked first. When that is not the boot nic, xcatd
receives the node's report from a pool address and cannot name the node.

xcat-genesis-bootnic.service runs genesis-bootnic before NetworkManager starts,
on the same condition and ordering as xcat-genesis-duid.service. The recipe
installs both the script and the unit, and enables the unit.

A secondary nic is put on link-local rather than disabled, so the node still
reports that nic to xcatd for its nic data and only stops asking for an address
the reservation holds.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 17:08:55 -03:00
Daniel Hilst a5d910f663 test(xcat-core): Genesis OpenEmbedded asks for DHCPv6 on every nic
A DHCPv6 reservation is keyed on the DUID, and a DUID names the machine, not the
nic. 10-xcat-genesis.conf puts the DHCPv6 settings in [connection], which
NetworkManager applies to every nic, so each nic of a node asks for the same
reserved address and Kea gives it to the first REQUEST.

Measured on xcat88-cn, which carries three nics on the provisioning bridge
virbr-p88. Kea logged four solicits under one DUID in one boot, and granted
2001:db8:188::20 to whichever IA asked first; the others took pool addresses.
The node then reported to xcatd from an address xcatd could not match to a node,
so el10-x86_64-genesis-oe-ipv6 passed or failed by chance.

genesis-bootnic reads BOOTIF and writes 16-xcat-genesis-bootnic.conf, which
leaves DHCPv6 on the boot nic and puts every other nic on link-local. It follows
genesis-duid, which already writes 15-xcat-genesis-duid.conf from the SMBIOS UUID
before NetworkManager starts.

The six cases pass with the file as committed, so the evidence is a mutation:
writing ipv6.method=auto for the secondary nics, which is the behaviour before
this change, reds only "the boot nic keeps DHCPv6 and every other nic does not
ask for an address".

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 17:08:54 -03:00
Daniel Hilst cab264cb93 Merge remote-tracking branch 'origin/fix/xcat-test-dhcp4-unit-name-on-ubuntu' into releases/2.20.0-rc9 2026-11-08 16:32:20 -03:00
Daniel Hilst 018987d0fb fix(xcat-test): the cases restart a DHCPv4 unit that Ubuntu does not have
Ten cmd lines in five case files restarted the DHCPv4 server with the same
inline probe of kea-dhcp4, falling back to isc-dhcp-server on Ubuntu. Kea is the
backend there and its unit is kea-dhcp4-server, so the probe was false and the
fallback named a unit that is not installed. The restart exited 5 with "Unit
isc-dhcp-server.service not found" and failed the case.

Each of those lines now calls commoncmd/restart_dhcp.sh. discovery_test also
decided whether to create /var/lib/dhcpd/dhcpd.leases from the same single-unit
probe, so on an Ubuntu management node it wrote an ISC leases file beside a Kea
backend; it now asks restart_dhcp.sh --print-unit.

Each rewritten line keeps the check that followed it. xcattest discards a cmd
line that does not start with [#/$\w] and binds its checks to the previous
command, so the calls are written as absolute paths.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 16:32:12 -03:00
Daniel Hilst 79f5291554 test(xcat-test): the cases restart a DHCPv4 unit that Ubuntu does not have
xCAT runs Kea as kea-dhcp4 on EL and as kea-dhcp4-server on Debian and Ubuntu.
Ten cmd lines across five case files probed the EL name alone and fell back to
isc-dhcp-server on Ubuntu, which is absent where Kea is the backend.
reg_linux_diskless_installation_hierarchy failed on it in
xcat-test-ubuntu-24-x86_64 #85: rc 5, "Unit isc-dhcp-server.service not found".
Measured on xcat24-mn, Ubuntu 24.04.4: kea-dhcp4 inactive, kea-dhcp4-server
active, isc-dhcp-server absent.

restart_dhcp.sh restarts whichever DHCPv4 unit is active, and --print-unit names
it for a caller that asks which backend the node runs. The bats cases drive it
with a stub systemctl that reports one unit active and records what was
restarted.

The eight cases pass with the file as committed, so the discriminating evidence is
a mutation: dropping kea-dhcp4-server from the candidate list reds exactly "the
Ubuntu Kea unit is restarted" and the message assertion, and leaves the EL, ISC
and dhcpd cases green.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 16:32:12 -03:00
Daniel Hilst 801dc568c8 Merge remote-tracking branch 'origin/fix/genesis-dhcp6-secondary-nic-reservation' into releases/2.20.0-rc9 2026-11-08 16:02:37 -03:00
Daniel Hilst ade70bbf26 test(xcat-core): nothing holds udpcat.awk to the socket family of its sibling helpers
allowcred.awk and updateflag.awk both had to choose the gawk network family from
the management address. udpcat.awk, which sends the discovery packet, still names
/inet/ and no test covers it.

The two cases send a packet to a loopback listener of each family and pass with
the file unchanged, because a /inet/ socket that connects resolves an IPv6
literal. A /inet/ listener does not, which is the difference that made the other
two helpers fail. The cases are a guard on the third helper, not a captured
defect.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 16:02:32 -03:00
Daniel Hilst cf96a26a45 Merge remote-tracking branch 'origin/fix/genesis-dhcp6-secondary-nic-reservation' into releases/2.20.0-rc9 2026-11-08 15:52:30 -03:00
Daniel Hilst 251f334a54 fix(xcat-core): Genesis waits for an IPv4 address that an IPv6 cell never serves
Genesis booted on the el10 x86_64 IPv6 cell, started its DHCP clients and then did
nothing for the rest of the case. No findme, no credential request and no status
update reached xcatd, and the node stayed out of the shell.

doxcat ended net init on the boot nic with a wait for an IPv4 address and no bound.
An IPv6 provisioning network declares an IPv4 subnet with no pool, so Kea refuses
every DHCPv4 request and the wait never ends.

The wait now ends when the boot nic holds an address of either family, in
genesis_nic_has_address, because xcatd is reached over whichever family the
network serves. The message after it names the family that arrived.

The pSeries branch, which runs when BOOTIF is absent, still reads IPv4 only. It is
bounded by its own try count and is not changed here.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 15:52:25 -03:00
Daniel Hilst 26b3a62c04 test(xcat-core): Genesis waits for an IPv4 address that an IPv6 cell never serves
The provisioning network of an IPv6 cell declares an IPv4 subnet with no pool, so
Kea answers every DHCPv4 request with ALLOC_ENGINE_V4_ALLOC_FAIL_NO_POOLS and the
node holds no IPv4 address. doxcat waits for one with no bound, and Genesis never
reaches xcatd.

The bats case gives the boot nic an IPv6 address and no IPv4 address, and expects
doxcat to finish. Before the change doxcat does not return and the sandbox timeout
reports 124. The sandbox stub for "ip -4" now reads a per-nic file when the test
writes one, and answers as before when it does not.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 15:52:25 -03:00
Daniel Hilst 801c926571 Merge remote-tracking branch 'origin/fix/genesis-dhcp6-secondary-nic-reservation' into releases/2.20.0-rc9 2026-11-08 15:45:25 -03:00
Daniel Hilst 6f126a0ac6 fix(xcat-core): a secondary nic can take the IPv6 address reserved for the node
A node with several nics on the provisioning network booted Genesis and reported
to xcatd from a pool address, so the management node never saw it reach the
shell. The el10 x86_64 IPv6 cell passed or failed by chance: one run in three
served the reserved address to the boot nic.

doxcat started DHCPv4 and DHCPv6 on the boot nic and on every eligible secondary
nic at the same time. A DHCPv6 reservation is keyed on the DUID, which names the
machine and not the nic, so each nic asked for the same reserved address and Kea
gave it to the first REQUEST. DHCPv4 is unaffected: a DHCPv4 reservation is keyed
on the hardware address.

A secondary nic now waits for the boot nic to hold a routable IPv6 address before
it asks for one, in genesis_wait_nic_v6. On an IPv4-only network the wait ends
after the last try and the secondary nic asks for no IPv6 address, which it could
not have obtained there anyway. DHCPv4 on a secondary nic still does not wait.

genesis_secondary_dhcp.bats measures which nics are selected, so its boot nic now
starts with an address and its cases read as before.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 15:45:17 -03:00
Daniel Hilst 38ae1281ae test(xcat-core): a secondary nic can take the IPv6 address reserved for the node
A DHCPv6 reservation is keyed on the DUID, and a DUID names the machine, not the
nic. Every nic of a node asks for the same reserved address, and Kea gives it to
the first REQUEST. The node then holds its own address on whichever nic won, and
xcatd cannot match a report that arrives from a pool address.

The bats case boots doxcat in the sandbox with a boot nic and one eligible
secondary nic, and reads the order the nics were served from the recorded
dhclient command lines. The sandbox gains an "ip -6 -o addr show dev" stub, which
reads the per-nic file the test writes.

Two of the three assertions hold before the change. Only "a secondary nic is not
served DHCPv6 while the boot nic has no address" fails, because doxcat starts
both families on every selected nic at once.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 15:45:08 -03:00
Daniel Hilst 81bf21c55e Merge remote-tracking branch 'origin/fix/nodediscover-ipv6-node-and-nic' into releases/2.20.0-rc9 2026-11-08 13:00:05 -03:00
Daniel Hilst 8f0d4e5e84 fix(xcat-core): sequential discovery cannot name a node reached over IPv6
process_request gated the MAC record on inet_aton($node), which answers for
IPv4 only, so a node whose only address is IPv6 was refused with "Can not
resolve IP for the matching node". update_discovery_data runs after that return,
so no discoverydata row was written, no mac was set and makedhcp never ran.
Measured on xcat88-mn: discoverydata empty after a full seq_discovery_ipv6 run.

It then matched each NIC behind a dotted-quad pattern. The Genesis image sends
address=${ipv4_address:-$ipv6_address}, so over IPv6 the NIC record carries the
v6 address, the branch was skipped, $localnic stayed 0 and the node was reported
as not on the deploy network.

The node is now resolved once with getipaddr and accepted by
discovery_address_usable, and the network of a NIC comes from nic_network_key,
which masks IPv6 by bits so a prefix that is not a whole number of bytes keys
correctly. An IPv6 NIC takes its hostname tag from hosttag_for_ipv6_nic:
gethosttag reads an A record and my_if_netmap, which is netstat -rn and prints
IPv4 routes only, so it cannot answer for one.

The IPv4 path is untouched. nic_network_key keeps the arithmetic the caller used,
gethosttag is still asked for an IPv4 NIC, and each test holds an IPv4 case down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 12:59:53 -03:00
Daniel Hilst 435ba5abd3 test(xcat-core): sequential discovery cannot resolve or match an IPv6 node
nodediscover.pm decides two things with IPv4-only code, and sequential discovery
over IPv6 stops at each of them.

It gates the MAC record on inet_aton($node), so a node whose only address is
IPv6 fails and process_request returns "Can not resolve IP for the matching
node". update_discovery_data runs after every such early return, so no
discoverydata row is written and makedhcp never runs. Measured on xcat88-mn:
tabdump discoverydata empty after a full seq_discovery_ipv6 run.

It then matches a NIC behind if ($ip =~ /\d+\.\d+\.\d+\.\d+/). The OpenEmbedded
image sends address=${ipv4_address:-$ipv6_address}, so over IPv6 the NIC record
carries the v6 address, the branch is skipped, $localnic stays 0 and
process_request returns "No nic found in deploy network".

The three tests ask xCAT::DiscoveryUtils for the two decisions and for the
hostname tag of an IPv6 NIC. Each holds an IPv4 case down as well, because every
green discovery cell depends on that path being unchanged. All three fail on this
commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 12:57:38 -03:00
Daniel Hilst 225f8882fa Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:19:41 -03:00
Daniel Hilst 0e9e723a23 fix(xcat-core): a node found by sequential discovery gets no DHCPv6 reservation
findme assigned a node and recorded its MAC, its address, its BMC, its position,
its groups and its chain, and never recorded the UUID the request carries.
dhcp6_client_duids builds the DHCPv6 identity of a node from vpd.uuid, so
makedhcp fell back to a DUID-LL derived from the MAC. None of the three boot
stages sends a DUID-LL, so the reservation matched nothing and the node kept an
address from the pool, which xcatd cannot map back to it. The node is discovered
and then cannot be provisioned at the address it was given.

findme now records the UUID through xCAT::DiscoveryUtils::vpd_attribs_from_findme,
which takes the SMBIOS form only. The OpenEmbedded image synthesises
"<machine type>-<serial>-<first mac>" when the firmware reports no product_uuid,
and a DUID built from that string would match no client either.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:19:28 -03:00
Daniel Hilst 2d47339d7d test(xcat-core): a discovered node needs its UUID recorded for DHCPv6
dhcp6_client_duids builds the DHCPv6 identity of a node from vpd.uuid, and no
other table holds it. Sequential discovery writes mac, hosts, ipmi, nodepos,
nodelist, nodehm and chain for the node it assigns and never wrote vpd, so the
reservation of a discovered node falls back to a DUID-LL built from its MAC.
Measured on xcat88-mn: the firmware, iPXE and the Genesis image all send a
DUID-UUID, so that reservation matches nothing and the node keeps a pool address.

The findme request already carries the value. The new test asks
xCAT::DiscoveryUtils which vpd attributes a request carries, and holds down the
one case that must be refused: the OpenEmbedded image synthesises
"<machine type>-<serial>-<first mac>" when the firmware reports no product_uuid,
and a DUID built from that string matches no client.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:19:28 -03:00
Daniel Hilst 673d4727bb Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:08:50 -03:00
Daniel Hilst 2151865bb1 fix(xcat-core): the per-network iPXE boot script has no host over IPv6
mknb wrote http://${next-server} into every URL of the per-network boot scripts
under xcat/ipxe/nets. DHCPv4 fills next-server from the siaddr of the offer.
DHCPv6 has no next-server option, so iPXE leaves the variable empty and an
unknown IPv6 client fetches from a URL with no host. That script is the only one
carrying destiny=discover, so sequential discovery over IPv6 could not start even
once a client class named the script.

ipxe_script_http_base returns the address of the management node facing the
network for an IPv6 network, and keeps ${next-server} for IPv4, so the DHCPv4
scripts are written exactly as before. mknb uses it for the gpxe and the UEFI
scripts of the x86 loaders.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:08:35 -03:00
Daniel Hilst e474f57d2f test(xcat-core): a per-network iPXE script needs a host on an IPv6 network
mknb writes one boot script per network under xcat/ipxe/nets, and that script is
what an unknown client boots: it carries destiny=discover and no node name, so
the Genesis image asks to be discovered. Every URL in it named the server with
${next-server}. DHCPv4 fills that from the siaddr of the offer, and DHCPv6 has no
next-server option, so iPXE leaves it empty and the fetch has no host.

The new test asks xCAT::NetworkUtils for the base of those URLs and holds down
both families. Measured on xcat88-mn: the per-node script, which boots, carries
http://[2001:db8:188::1]/ while the per-network script carried
http://${next-server}/.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:08:35 -03:00
Daniel Hilst 282adefda5 Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:03:12 -03:00
Daniel Hilst a8d482cdb1 fix(xcat-core): an unknown DHCPv6 client is handed the shim twice
kea_client_classes6 built one class per client architecture, each naming the
signed iPXE shim. That answers the firmware. The shim starts iPXE, which
solicits again carrying the iPXE user class, and a client xCAT has never seen
matches no per-node class: its only match is the same architecture class, so it
is given the shim again and never fetches a kernel. The Genesis image never
runs, no findme reaches xcatd, and sequential discovery over IPv6 cannot start.
The DHCPv4 side has carried this second stage for years in
kea_xnba_network_classes, keyed on option 93.

kea_client_classes6 now also builds an iPXE second-stage class for the network,
naming the per-network script mknb writes under xcat/ipxe/nets, which carries
destiny=discover and no node name. The class is offered before the architecture
class, because Kea takes the first class that defines an option.
kea_boot_client_classes6 passes the network and its prefix length, which name
that script.

Measured on xcat88-mn: /tftpboot/xcat/ipxe/nets holds 2001:db8:188::_64.uefi and
no DHCPv6 class named it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:02:56 -03:00
Daniel Hilst 82d39637a6 test(xcat-core): an unknown DHCPv6 client needs the second boot stage named
kea_client_classes6 names the shim for an unknown client, which answers the
firmware. The shim starts iPXE, and iPXE solicits again with the iPXE user class.
A client xCAT has never seen matches no per-node class, so its only match is the
architecture class, and it is handed the shim a second time. It never fetches a
kernel and never sends a findme, so sequential discovery over IPv6 cannot start.

The new assertions ask for an iPXE second-stage class carrying the per-network
script that mknb writes, and for it to be offered before the architecture class,
because Kea takes the first class that defines an option. All four fail on this
commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:02:56 -03:00
Daniel Hilst 39a1ad2d05 Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 10:40:04 -03:00
Daniel Hilst df0ecf829d fix(xcat-core): a boot loader holds the reserved DHCPv6 address of its node
render_dhcp6_config wrote no expired-leases-processing block, so Kea held a
reclaimed lease for hold-reclaimed-time, which is 3600 seconds. A node boots in
stages that share one DUID and use a different IAID each. The firmware takes the
reserved address and releases it, the reclaimed lease keeps that address bound to
the IAID of the firmware, and Kea gives the Genesis image a pool address. The
image then speaks from an address xcatd cannot map to a node, and discovery
stops at "Node unassigned".

_expired_leases6 writes the block, with hold-reclaimed-time 0 and both timers at
5 seconds, so a reserved address is free again inside one boot. A caller can
override any of the three values.

Measured on xcat88-cn: the firmware released 2001:db8:188::20 and the image was
given 2001:db8:188::1003 29 seconds later. With the block in place the image was
granted ::20 and the node reached status=shell.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 10:39:06 -03:00
Daniel Hilst 2ec9341007 test(xcat-core): a reserved DHCPv6 address must be free for the next boot stage
A boot chain presents one DUID in several stages, and each stage asks for its own
IA. Kea holds a reclaimed lease for an hour by default, so the reserved address a
boot loader released is still bound to the IAID of the loader when the Genesis
image asks for it. The image is given a pool address, and xcatd names a node by
the address it speaks from.

The new assertions read expired-leases-processing out of the rendered DHCPv6
document. They fail on this commit, because render_dhcp6_config writes no such
block and all three Kea defaults apply.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 10:39:06 -03:00
Daniel Hilst d0957a5695 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:48:58 -03:00
Daniel Hilst 0e45012264 fix(xcat-core): choose the UUID byte order of a DUID from the node, not the platform
The implementation for 596450159, which committed only its test.

dhcp6_firmware_uuid_order answers canonical for a kvm node and firmware for any other, because
getNodeUUID writes the byte swap of vpd.uuid into the libvirt domain of a guest xCAT defines and
the SMBIOS encoding swaps it back. dhcp6_client_duid uses it when the node sets no duid attribute,
and dhcp6_client_duids reads nodehm.mgt to supply it.

dhcp_dhcpv6_duid.t gains the mgt column and asserts the address holder of a kvm node against that
of a node xCAT does not define.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:48:54 -03:00
Daniel Hilst 175ac0ea0c Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:48:34 -03:00
Daniel Hilst 5964501597 fix(xcat-core): a KVM node reserves its IPv6 address for the wrong byte order
makedhcp derived the DHCPv6 address reservation of a node from the byte swap of vpd.uuid, on the
grounds that EDK2 copies the SMBIOS UUID bytes into its DUID and SMBIOS stores the first three
fields little-endian. That holds for a physical node. For a KVM guest that xCAT defines it is
wrong: getNodeUUID writes the byte swap of vpd.uuid into the libvirt domain, qemu stores that
little-endian in SMBIOS, and the two swaps cancel, so the firmware of the guest sends vpd.uuid
unswapped.

Measured on xcat88-cn: the firmware and the OpenEmbedded Genesis image both sent
00:04:0c:3f:8d:41:... from vpd.uuid 0c3f8d41-6a52-4e7b-..., while iPXE sent the swap. The address
was reserved for the swap, so the image took an address from the dynamic range and xcatd could
not name it.

dhcp6_firmware_uuid_order reads nodehm.mgt and answers canonical for a kvm node and firmware for
any other, and dhcp6_client_duid uses it when the node sets no duid attribute. A node that names
an order itself is unchanged.

dhcp6_firmware_uuid_order.t covers the predicate. dhcp_dhcpv6_duid.t asserts that a kvm node
holds its address on the canonical order and that a node xCAT does not define keeps the swap.
Both fail with the predicate forced to one order.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:48:31 -03:00
Daniel Hilst 267e996ed7 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:17:48 -03:00
Daniel Hilst 5e1e3b0000 revert(xcat-core): a pool of one address cannot serve two IAs of one client
Reverts dd065ea99, 084f4a9ed and c84716b9d, which gave a node of several DHCPv6 clients a pool of
exactly its address, gated on a client class matching every DUID of the node.

Measured on xcat88-cn: Kea consumes a pool address per (DUID, IAID) pair. The firmware and the
OpenEmbedded Genesis image send the same DUID with different IAIDs, so the firmware took
2001:db8:188::20 and Genesis still fell through to the dynamic range at ::1002. The pool serves
whichever client solicits first and cannot serve both.

A host reservation applies to every IA of its client, so a reservation is what spans the firmware
and the image. The defect is which DUID holds the reservation, not that a reservation holds it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:17:28 -03:00
Daniel Hilst 4303f85640 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:11:18 -03:00
Daniel Hilst c84716b9db fix(xcat-core): the Genesis image gets a pool address and xCAT cannot name the node
A node solicits over DHCPv6 under more than one DUID, and kea_node_reservations6 reserved the
address for the first client only. The OpenEmbedded Genesis image sends the DUID-UUID in the
order the firmware sends, which is not that client, so it took an address from the dynamic range.
xcatd could not map the address to a node, Genesis reported CERTIFICATE_ACTION_FAILED with the
node unassigned, and discovery over IPv6 stopped there.

Which order the firmware sends is not the same on every platform. For a KVM guest getNodeUUID
writes the byte swap of vpd.uuid into the domain, and the firmware swaps those bytes back, so the
order the firmware sends is the one the code labels for iPXE.

makedhcp now gives a node of several clients a pool of exactly its address, gated on a client
class that matches every DUID of the node, and leaves the address out of the reservation: Kea
excludes a reserved address from every pool. The reservation still carries the hostname, on one
entry, because _reservation_matches treats a shared hostname as the same reservation. A node with
one client is unchanged and keeps its address in its reservation.

dhcp_dhcpv6_duid.t reads the address through the pool as well as the reservation. Without the
pool insertion its nine address assertions fail.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:11:04 -03:00
Daniel Hilst 084f4a9eda feat(xcat-core): match every DUID form of a node to one reserved IPv6 address
kea_node_address_class6 builds the Kea DHCPv6 client class that matches every DUID of one node,
and kea_node_address_pool6 builds the pool of exactly that node's address, gated on the class.
Together they give the address to whichever client solicits, so the address no longer depends on
which byte order the firmware of a platform sends.

A node with fewer than two DUID forms gets neither: its reservation holds the address by itself.

Kea excludes a reserved address from every pool, so makedhcp must stop writing the address into
the reservation of a node that uses this pool. That change is not here yet, and these routines
have no caller until it lands.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:02:19 -03:00
Daniel Hilst dd065ea99a test(xcat-core): one IPv6 address cannot reach every DHCPv6 client of a node
A node solicits under more than one DUID. Measured on 2026-11-08, the OpenEmbedded Genesis
image sends the DUID-UUID in the byte order the firmware sends, not the DUID-LL that
dhcp6_client_duid_list assumes. It matched the reservation of the node that holds no address,
took 2001:db8:188::1005 from the dynamic pool, and xcatd could not name it. Genesis reported
CERTIFICATE_ACTION_FAILED with the node unassigned.

A reservation holds the address for one identifier only. Kea refuses the same address on a
second reservation, and a hw-address reservation never matches because these packets carry no
hardware address. A client class can match every DUID form, and a pool of one address can be
gated on that class.

The test asks for kea_node_address_class6 and kea_node_address_pool6 and fails without them.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:02:18 -03:00
Daniel Hilst e2495c4811 Merge feat/ipv6 into releases/2.20.0-rc9
Comment-only: the reason a DUID byte order cannot name a boot stage.
2026-11-08 01:19:16 -03:00
Daniel Hilst 0c3cede440 docs(xcat-core): correct why a DUID byte order cannot name a DHCPv6 boot stage
The previous two commits said the firmware sends the uuid in RFC 4122 order and iPXE in SMBIOS
order, the opposite of a physical machine. That reads the measurement the wrong way round.

getNodeUUID in kvm.pm writes the libvirt domain uuid as the byte-swap of vpd.uuid, and swaps back
when it reports the value, so vpd.uuid is the uuid the guest reports. The firmware sends the
SMBIOS bytes of the domain uuid, which is vpd.uuid unswapped, and iPXE converts those to RFC 4122,
which is the swap. A node whose domain carries vpd.uuid unswapped gives the opposite pair. Both
orders are real, and neither follows from vpd.uuid alone.

The code does not change. The reason recorded in it does.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 01:19:12 -03:00
Daniel Hilst 970cf0fde1 Merge feat/ipv6 into releases/2.20.0-rc9
Carries the DHCPv6 boot-stage split on option 15. The firmware and the iPXE it loads send the
same vpd.uuid in two byte orders, and which client sends which order depends on the platform, so
the reservation of a chainloading node can no longer name a boot file.
2026-11-08 01:11:34 -03:00
Daniel Hilst 182f3d9ef2 fix(xcat-core): DHCPv6 gives the firmware an http boot file it cannot fetch
A UEFI node that chainloads solicits twice. dhcp6_client_duid_list labelled the SMBIOS
little-endian DUID-UUID 'firmware' and the RFC 4122 one 'ipxe', and kea_node_reservations6 wrote
the boot file of that stage into each reservation.

The byte order depends on how the platform stores its SMBIOS uuid, so it does not identify a boot
stage. On a QEMU UEFI node the pair arrives the other way round: the firmware matched the
reservation labelled 'ipxe' and was given an http:// URL, which a UEFI PXEv6 boot option cannot
fetch, and reported "PXE-E53: No boot filename received". iPXE matched the one labelled
'firmware', was given the shim a second time and stopped at "Failed to open ipxe.efi".

kea_node_boot_classes6 makes the split the DHCPv4 path makes with the iPXE feature sub-options of
option 175, using option 15, the DHCPv6 User Class: iPXE sends it holding iPXE and the firmware
does not send it at all. Each of the two classes matches every DUID of the node, so neither order
is assumed, and the tests are mutually exclusive. The reservations of a chainloading node now
carry no boot file, because Kea gives a reservation's option data precedence over a class's; they
keep their DUIDs, so an update or a delete after a change of netboot still finds every client.
The Genesis client keeps its own reservation and boot file.

dhcp6_boot_stage_classes.t went from 16 failures to none. The assertions in dhcp_dhcpv6_duid.t
that read a stage boot file out of a reservation now read it out of the class that serves it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 01:11:23 -03:00
Daniel Hilst cc5ee8f3fc test(xcat-core): capture the DHCPv6 boot stage that a DUID byte order cannot identify
A UEFI node that chainloads solicits twice, and makedhcp tells the two clients apart by the byte
order of the DUID-UUID. The order depends on how the platform stores its SMBIOS uuid, so it does
not identify a boot stage.

Measured on an EL10 management node with Kea DHCPv6 at DEBUG, one boot of a QEMU UEFI node sends
the opposite pair to the one the code assumes: the firmware solicits with 00:04:0c:3f:8d:41:... in
RFC 4122 order and no option 15, and iPXE with 00:04:41:8d:3f:0c:... in SMBIOS order and option 15
holding 00:04:69:50:58:45, the length-prefixed string iPXE.

This test asks for the split the DHCPv4 path already makes, on what the client reports rather than
on who it is. It fails on the current tree: kea_node_boot_classes6 and
dhcp6_ipxe_user_class_test do not exist, and every one of its 16 assertions is red.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 01:11:13 -03:00
Daniel Hilst c5ece4aebd Merge fix/selinux-cn-ipxe-bootcfg into releases/2.20.0-rc9
selinux_cn_diskless_disabled_by_design named three boot-configuration paths and
none of them is the iPXE node script, so the case failed on every cell whose
compute node is netboot=ipxe.
2026-11-07 20:15:40 -03:00
Daniel Hilst cdb8187cbc fix(xcat-test): the SELinux diskless case cannot find an iPXE node boot config
selinux_cn_diskless_disabled_by_design looks for the boot configuration of the
compute node in three places: the xnba node directory, pxelinux.cfg by node
name, and petitboot. A node with netboot=ipxe has its script in
/tftpboot/xcat/ipxe/nodes/<node>.uefi instead, which the list does not name, so
the case reports

  BOOTCFG-BAD: the node has no boot configuration
  BOOTCFG-BAD: no boot configuration carries selinux=0

and fails on every iPXE cell. xcat54-cn of el10-x86_64-devel is netboot=ipxe, so
build 78 of xcat-test-el10-x86_64 failed there after its other checks passed:
the node reported SELinux disabled and the case still could not confirm the flag
reached the boot configuration.

Both path lists now name the iPXE script, the UEFI one first, which is the file
a UEFI client fetches. nodeset/ipxe_secureboot_shim.sh already reads that path.

The paths stay absolute, so the check still fails when no boot configuration
carries selinux=0.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 20:15:32 -03:00
Daniel Hilst a5a8c5444c Merge feat/ipv6 into releases/2.20.0-rc9
Carries the imgserver fallback: it chose the address with my_ip_facing, which is
IPv4 only, so an IPv6-only node with no noderes.tftpserver was sent to fetch its
image from an address it has no route to.
2026-11-07 19:54:01 -03:00
Daniel Hilst cbfbbe12d7 fix(genesis): imgserver falls back to the IPv4 address of an IPv6-only node
The imgserver of the nodeset response takes noderes.tftpserver, then
noderes.xcatmaster, then site.master, and falls back to my_ip_facing. That
resolver is IPv4 only, and an IPv6-only node shares the link with the management
node, so the fallback answers with the IPv4 address and the node is sent to
fetch its image from an address it has no route to.

It now uses my_ip_facing_node, which picks the family from the node. InstUtils
and grub2 already make the same choice, each with its own ternary; this is the
third site and the first to use the shared helper.

The fallback is reached only when none of the three attributes is set, so a cell
that sets noderes.tftpserver was never affected.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 19:53:51 -03:00
Daniel Hilst 279e4de1f2 Merge feat/ipv6 into releases/2.20.0-rc9
Carries the xcatd= address family: destiny.pm chose the address with
my_ip_facing, which is IPv4 only, so an IPv6-only node fetched its Genesis
payload over IPv6 and was told to report to xcatd over IPv4.
2026-11-07 19:38:41 -03:00
Daniel Hilst 137bb9675b fix(genesis): the xcatd= argument names the IPv4 address of an IPv6-only node
my_ip_facing resolves the peer with OnlyV4, and an IPv6-only node shares the
link with the management node, so the call succeeds and returns the IPv4
address. destiny.pm wrote it into the xcatd= kernel argument, so Genesis
fetched its payload over IPv6 and was told to report over IPv4. The node holds
no IPv4 address once the network serves no IPv4 pool, and discovery never
completes.

NetworkUtils gains my_ip_facing_node, which picks the family from the node and
returns the same (error, value) pair as my_ip_facing, so callers read the result
unchanged. destiny.pm uses it for the genesis and legacy boot command lines.

xcatd_cmdline_address already brackets an IPv6 literal, so the argument reads
xcatd=[2001:db8:188::1]:3001 and the port stays separable from the address.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 19:38:18 -03:00
Daniel Hilst 7f2fdb6f87 test(genesis): the xcatd= argument names the IPv4 address of an IPv6-only node
destiny.pm chooses the address for the xcatd= kernel argument with my_ip_facing,
which resolves the peer with OnlyV4. An IPv6-only node shares the link with the
management node, so that call succeeds and answers with the IPv4 address.

Measured on xcat88-mn, whose compute node holds only 2001:db8:188::20:

  imgfetch -n kernel http://[2001:db8:188::1]/tftpboot/xcat/genesis.kernel.x86_64
  imgargs kernel ... xcatd=192.168.88.1:3001 destiny=shell

The payload is fetched over IPv6 and the node is then told to report over IPv4.
An IPv4 pool on the same network hid this. Without one the node holds no IPv4
address, so Genesis cannot reach xcatd and discovery never completes.

genesis_xcatd_address_family.t asserts that the resolver picks the family from
the node, that a resolver error travels rather than becoming a false address,
and that an IPv6 literal is bracketed in the argument. Five of its seven
assertions fail without the fix.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 19:38:18 -03:00