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

29714 Commits

Author SHA1 Message Date
Daniel Hilst 38f4e4e2e9 fix(xcat-core): the OpenEmbedded metadata check fails on the bootnic service
The OpenEmbedded metadata check failed in test_installed_network with
'xcat-genesis-bootnic.service' missing from the expected set. The
xcat-genesis-network recipe installs and enables genesis-bootnic and
its unit since the Genesis DHCPv6 boot nic fix, and the test still
expected only xcat-genesis-duid.service.

The test now expects both services, and asserts that the bootnic
script is installed and that its unit runs it before NetworkManager.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 09:28:10 -03:00
Daniel Hilst 7ee57ff62e fix(xcat-core): sequential discovery over IPv6 finds no nic in the deploy network
Sequential discovery over IPv6 matched the pool node and then failed
with "No nic found in deploy network for seqdisc1". NetworkManager
installs a DHCPv6 lease as a /128, so Genesis reports the boot nic as
2001:db8:188::1004/128. hosttag_for_ipv6_nic masked both addresses with
that prefix length, and a /128 never matches the address of the node.

For a /128, hosttag_for_ipv6_nic now takes the network from the IPv6
rows of the networks table, which nodediscover reads once per request
through the new ipv6_networks. discovery_hosttag_ipv6_nic.t fails
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 07:56:00 -03:00
Daniel Hilst dd1d517d80 test(xcat-core): sequential discovery over IPv6 finds no nic in the deploy network
On xcat88-mn the findme from the OpenEmbedded Genesis reached xcatd
over IPv6 and seqdiscovery matched seqdisc1, then zzzdiscovery failed
with "No nic found in deploy network for seqdisc1". NetworkManager
installs a DHCPv6 lease as a /128, so Genesis reports the boot nic as
2001:db8:188::1004/128. hosttag_for_ipv6_nic masks both addresses with
that prefix length, and a /128 never matches the address of the node.

The test asserts that a /128 lease inside an xCAT IPv6 network of the
node is the node itself. It fails today.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 07:55:24 -03:00
Daniel Hilst d4591ee343 fix(xcat-core): a node with no MAC still boots its own DHCPv6 class
When sequential discovery clears mac= on a defined node, makedhcp drops
the DHCPv6 reservation of the node but keeps its two per-node client
classes. The classes match the DUID, so iPXE still fetches the boot
script of the node, Genesis boots with that node's destiny, and no
findme reaches xcatd.

kea_node_boot_classes6_for_nodes now skips a node with no MAC, as
kea_node_reservations6 does, so kea_sync_node_boot_classes6 removes
the classes with the reservation. dhcp_dhcpv6_duid.t fails without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 00:42:34 -03:00
Daniel Hilst 38f521ce4b test(xcat-core): a node with no MAC still boots its own DHCPv6 class
seq_discovery_ipv6 clears mac= on the compute node and runs makedhcp,
so the node is unknown and sends a findme. kea_node_reservations6
drops the reservation of a node with no MAC, but
kea_node_boot_classes6_for_nodes still writes the two per-node classes,
which match the DUID. On xcat88-cn iPXE took a pool address and still
fetched nodes/xcat88-cn.uefi, Genesis booted with destiny=shell, and
xcatd never ran sequential discovery.

The test clears the MAC of an ipxe node and asserts that it gets no
reservation and no boot class. The class assertion fails today.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 00:41:38 -03:00
Daniel Hilst d6fecff195 fix(xcat-core): makehosts cuts an IPv6 address at its first colon
hosts.otherinterfaces and nics.nicips take "<name>!<ip>" or
"<name>:<ip>". The ":" form was split at every colon, so
"node01:2001:db8::5" gave the address "2001". otherinterfaces dropped
the entry; nicips wrote "2001 node01-eth1" to the host entries, which
makedns then rejects as malformed.

addotherinterfaces, delotherinterfaces and donics now split at the
first colon only. ddns_ipv6_records.t holds both forms down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:52:41 -03:00
Daniel Hilst 03aead6059 fix(xcat-core): makedns drops IPv6 PTRs and named.conf settings
makedns stops with "the mask should be a factor of 4" when a node is
in an IPv6 network with a /62 or other non-nibble prefix.
get_reverse_zones_for_entity rejected the prefix that getzonesfornet
already accepts. It now takes the zone of the next nibble that holds
the node address, which is one of the zones getzonesfornet creates.

A node whose hosts.ip is IPv4 got an AAAA for its IPv6 address but no
PTR, because add_or_delete_records walked hosts.ip only. It now also
walks the other addresses the makehosts content gives the node.

find_nameserver_for_dns asked the resolver for the NS of ip6.arpa. and
arpa.: its stop list matched IN-ADDR.ARPA and upper-case ARPA only.

update_namedconf matched "listen-on {" and "listen-on-v6 {". The EL
named.conf writes "listen-on-v6 port 53 { ::1; };", so
site.dnsinterfaces was ignored and named stayed on ::1. The match now
allows options before the brace and a block on one line.

A new zone closed allow-update before the site.dnsupdaters entries,
and named rejects the entries as unknown options.

ddns_ipv6_records.t holds each case down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:52:40 -03:00
Daniel Hilst 129836ee58 fix(xcat-core): makedns drops IPv6 records and named.conf settings (test)
makedns on a dual-stack or IPv6-only cluster fails in six places:

- a node in an IPv6 network whose prefix is not a multiple of 4 makes
  get_reverse_zones_for_entity die, and makedns stops;
- the reverse walk asks the resolver for the NS of ip6.arpa. and arpa.,
  because its stop list matches only upper case;
- a node whose hosts.ip is IPv4 gets an AAAA but no PTR for its IPv6
  address;
- site.dnsinterfaces does not replace "listen-on-v6 port 53 { ::1; };"
  of the EL named.conf, so named stays on ::1;
- site.dnsupdaters is written after the allow-update block of a new
  zone, which named rejects;
- hosts.otherinterfaces and nics.nicips with the ":" separator cut an
  IPv6 address at its first colon.

ddns_ipv6_records.t runs each routine and reads the records, the
named.conf or the host entries it produced. These checks fail on this
commit and pass with the fixes that follow.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:52:40 -03:00
Daniel Hilst 2e2ac69f78 fix(xcat-core): Genesis OpenEmbedded still asks for DHCPv6 on every nic
On a node with three nics on the provisioning network, every nic sent a
DHCPv6 SOLICIT under the same DUID. A secondary nic took the reserved
address and the boot nic got a pool address, so xcatd could not match
the findme report to the node.

genesis-bootnic tried to restrict DHCPv6 with ipv6.method in
[connection-*] sections of a conf.d file. NetworkManager does not accept
ipv6.method as a connection default and ignores it.

genesis-bootnic now writes two keyfile profiles: one bound to the BOOTIF
address with ipv6.method=auto and the higher autoconnect priority, and
one multi-connect profile with ipv6.method=link-local for every other
nic. genesis_openembedded_bootnic.bats fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:49:07 -03:00
Daniel Hilst 9a8ea90a47 test(xcat-core): Genesis OpenEmbedded still asks for DHCPv6 on every nic
genesis-bootnic writes ipv6.method into [connection-*] sections of a
NetworkManager conf.d file. NetworkManager.conf(5) does not list
ipv6.method among the properties such a section can default, so
NetworkManager ignores it. On xcat88-cn all three nics still sent a
SOLICIT under the same DUID, and the boot nic held a pool address
while a secondary nic held the reservation.

The test asserts that the boot nic gets a connection profile bound to
its BOOTIF address with ipv6.method=auto, that the other nics get a
link-local profile, and that no conf.d file carries ipv6.method. It
fails on the current script.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:48:24 -03:00
Daniel Hilst 68df4daaa9 fix(xcat-core): the Ubuntu netboot online hook ends the script that runs it
dracut SOURCES a hook: source_all runs `. "$f" "$@"`. An `exit` in the hook
therefore ends networkd-run.sh, which is the script bringing the network up, so
the early return path would stop network setup on the second interface. A compute
node with three nics on the provisioning network reaches that path.

The hook leaves with `return` now. A case sources it with the marker already
present and asserts the caller still runs; putting `exit` back fails only that
case. Two cases drove the hook with `sh hook.sh` and now source it, which is both
what dracut does and what `return` requires.

dracut's own 98syslog/rsyslogd-start.sh uses `exit` in an online hook, so the
convention is not uniform. `return` is correct for a sourced script and says what
is meant: end this hook, not its caller.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 18:25:36 -03:00
Daniel Hilst 07651d98b8 fix(xcat-core): the Ubuntu netboot initramfs never reaches its root handler
xcat-online.sh calls /sbin/xcatroot from initqueue/online, which systemd-networkd
and NetworkManager both reach, instead of waiting for a netroot dispatch that
only network-legacy performs. install.netboot registers it and still installs the
legacy dispatcher where dracut ships one, so EL is unchanged.

The hook runs once: it marks /tmp/xcat.rootimg.done on success, because a second
interface coming online would download the image again.

NOT YET PROVEN ON A NODE. The management node of the cell was reverted by the run
that was aborted while this was written, so the image to boot it with was gone.
The next xcat-test-ubuntu-26-x86_64 run measures it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 18:21:19 -03:00
Daniel Hilst 34ce66f542 test(xcat-core): the Ubuntu netboot initramfs never reaches its root handler
dracut dispatches a netroot= handler from network-legacy's ifup. Ubuntu 25.10 and
later ship no network-legacy, so network resolves through systemd-networkd and
nothing calls /sbin/netroot. install.netboot already says so in a comment, and
treats the dispatcher as optional.

Measured on xcat32-cn with the 26.04 netboot image: the initramfs does no DHCP of
its own, the management node logs no request for rootimg.cpio.gz, and dracut
enters emergency mode 3.3 seconds in. Under quiet that surfaces as "Failed to
isolate default target". The initrd is complete: modules.txt lists network,
systemd-networkd, net-lib, nfs and xcat, and both /sbin/netroot and
/sbin/xcatroot are present. Nothing calls them.

The cases run install.netboot the way dracut does, with its helpers stubbed, and
assert what it registers. They also drive the new hook with a stub handler.
Deleting the registration fails only "the root handler is registered on an
interface coming online".

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 18:21:19 -03:00
Daniel Hilst 07dbee9f4f Merge remote-tracking branch 'origin/fix/genesis-net-init-waits-for-the-xcatd-family' into releases/2.20.0-rc9 2026-11-08 17:39:12 -03:00
Daniel Hilst 17d4018eb4 fix(xcat-core): Genesis ends net init on an address of the wrong family
Net init now waits for the family xcatd is on, read from XCATMASTER, which doxcat
parses out of the xcatd= kernel argument before the wait. An address of the other
family no longer ends it.

With no xcatd address to read, an address of either family ends the wait, which
is what an IPv4-only network needs and what the earlier form did for every
network.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 17:39:09 -03:00
Daniel Hilst de86c39b46 test(xcat-core): Genesis ends net init on an address of the wrong family
genesis_nic_has_address ends the wait for the boot nic on an address of either
family. xcatd is on one family, so on a dual stack provisioning network the node
can go on to getcert and getdestiny holding only the family xcatd is not on, with
no route to the management node.

The cases drive the three address helpers out of doxcat with a stub ip and assert
what ends the wait for an IPv4 xcatd and for an IPv6 one. Two of the six fail
before the change: "an IPv6 xcatd is not reached by an IPv4 address alone" and
"an IPv4 xcatd is not reached by an IPv6 address alone". The other four pass
before and after, so the file is not vacuous.

No cell is in this state today, because an IPv6 cell serves no IPv4 pool and an
IPv4 cell sends no router advertisement, so the boot nic gets one family. The
form was still wrong.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 17:39:09 -03:00
Daniel Hilst 43251728df Merge remote-tracking branch 'origin/fix/genesis-oe-dhcp6-on-every-nic' into releases/2.20.0-rc9 2026-11-08 17:09:03 -03:00
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