2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-22 02:12:16 +00:00
Commit Graph

29730 Commits

Author SHA1 Message Date
Vinícius Ferrão e26416f76d fix(kvm): resolve the default machine type before converting a UUID
The UUID conversion of mkvm, clonevm, rinv and rscan used the machine
type that the domain XML names. A domain that names none, or names an
alias such as pc, gets the default machine type of the hypervisor:
pc-i440fx-2.1 on QEMU 2.1 and pc-i440fx-rhel7.1.0 on the qemu-kvm of
RHEL 7.1. Its guest then reported a swapped UUID that the plugin did
not expect.

The plugin now asks libvirt for the machine type through the domain
capabilities of the hypervisor, as it already does for the video
model, and converts the UUID for that machine type. The domain XML
keeps the machine type it names. When libvirt cannot answer, the
plugin uses the machine type of the XML, as before.

(cherry picked from commit f3b47fcca98ca75c123615433df38d3642d2c5d4)
(cherry picked from commit 1e830adaa9)
(cherry picked from commit 8f81a34a3e)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:16:09 -03:00
Vinícius Ferrão b06f13582b fix(kvm): give a KVM guest the UUID that vpd.uuid holds
mkvm and clonevm wrote the libvirt domain UUID with the first three
fields of vpd.uuid swapped, rscan swapped them back when it stored a
domain UUID in vpd.uuid, and rinv printed the swapped value. QEMU
stores the domain UUID as SMBIOS 2.6 specifies, so the guest reported
the swapped UUID, not vpd.uuid, and its UEFI firmware sent a DUID that
the reservation makedhcp derives from vpd.uuid did not match.

The plugin now converts through xCAT::KVMUtils::guest_uuid, which
keeps the UUID unchanged for every machine type except pc-i440fx-2.1
and its RHEL counterpart pc-i440fx-rhel7.1.0. Those machine types,
which QEMU before 9.1 and the qemu-kvm of EL8 still offer, store the
UUID bytes unencoded behind an SMBIOS 2.8 entry point, so their guest
reports the first three fields swapped and the swap stays. mkvm and
clonevm take the machine type of the domain they build, and rscan and
rinv the machine type of the domain they read.

A guest that mkvm defined before keeps its UUID, because mkvm reuses
the domain XML in kvm_nodedata. Its vpd.uuid keeps the swapped order
until it is corrected.

(cherry picked from commit 4d8007091c9a8ba2e246749a7278c0f5e04da374)
(cherry picked from commit 76f2008779)
(cherry picked from commit 32d61367cd)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:16:08 -03:00
Vinícius Ferrão a6a2596d7b fix(kvm): keep the mac attributes of a guest that rscan updates
rscan -u, and rscan -w for a guest that xCAT already knows, deleted the
mac row of the guest and wrote back only its MAC address. That dropped
mac.duid, so the next makedhcp reserved the default DUID in place of
the identifier the node had selected, and its client lost the reserved
address. rscan now updates the MAC address in the existing row and
keeps the other mac attributes. The other tables it rewrites are
unchanged.

(cherry picked from commit b464b57499d74d525188c59a340c1bde8e3ffcf1)
(cherry picked from commit b1ed21d010)
(cherry picked from commit 5f1fd10929)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:15:34 -03:00
Daniel Hilst 965430fa6a fix(xcat-core): ISC gives the firmware of a KVM guest the iPXE boot script
On ISC DHCP a KVM guest that xCAT defines and that netboots with ipxe
boots neither stage: the firmware receives the iPXE boot script and
iPXE receives the shim.

addnode6 and addnode6_other_clients chose the boot file of each DHCPv6
host from the client label of its DUID. The label follows from vpd.uuid,
but which UUID order the firmware sends depends on the UUID of the
libvirt domain. For a guest that mkvm defines the labels are reversed.

The two hosts that hold a UUID order of a chainloading node now carry
one statement that chooses the file by boot stage: the boot script when
option 15, the User Class, holds iPXE, and the shim otherwise. The Kea
classes from kea_node_boot_classes6 make the same split.
isc_dhcp6_boot_stage_statement in BootPolicy builds the statement.

dhcp_dhcpv6_duid.t asserts the statement on both hosts of a KVM node.
The assertions fail without this change. Two older assertions expected
one file per label and now expect the statement.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:14:41 -03:00
Daniel Hilst 653ea56987 test(xcat-core): ISC gives the firmware of a KVM guest the iPXE boot script
On ISC DHCP, makedhcp gives each DHCPv6 host of a netboot=ipxe node the
boot file of the client that its DUID label names. The firmware of a
KVM guest that xCAT defines sends the canonical UUID order and iPXE
sends the swap, so the labels are reversed. ISC gives the boot script
to the firmware and the shim to iPXE, and the node boots neither.

dhcp_dhcpv6_duid.t runs makedhcp on ISC for a KVM ipxe node and asserts
that the host of each UUID order chooses the boot file by the iPXE user
class, option 15, as the Kea classes do. Both assertions fail on this
tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:13:53 -03:00
Daniel Hilst 6497b1a1a6 fix(xcat-core): makedhcp does not reload Kea for a DHCPv6 boot class
When the Kea Control Agent host updates succeed, an IPv6-only node
skips the Kea reload. A new DHCPv6 boot class stays inactive and a
deleted one stays active.

kea_process_request restarts Kea after a live update only when
client_classes_changed is set. It set the flag from the DHCPv4 class
updates and discarded the results of kea_sync_node_boot_classes6 and
kea_remove_node_boot_classes6.

kea_process_request now also sets the flag when either DHCPv6 boot
class update reports a change.

dhcp_kea_reload_boot_classes6.t asserts the restart for an added and
for a removed DHCPv6 boot class. Both assertions fail without this
change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:12:52 -03:00
Daniel Hilst fcf4b9734e test(xcat-core): makedhcp does not reload Kea for a DHCPv6 boot class
When the Control Agent host updates succeed, makedhcp restarts Kea only
if client_classes_changed is set. kea_process_request sets it from the
DHCPv4 class updates alone. The results of kea_sync_node_boot_classes6
and kea_remove_node_boot_classes6 are discarded, so an IPv6-only node
skips the reload: a new boot class stays inactive and a deleted one
stays active.

dhcp_kea_reload_boot_classes6.t runs kea_process_request with a Kea
backend whose live host commands succeed, and counts the restarts. It
asserts a restart when a DHCPv6 boot class is added or removed, and
keeps the two controls: no class change, and a DHCPv4 class change.
The two DHCPv6 assertions fail on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:12:47 -03:00
Daniel Hilst 7513aba307 fix(xcat-core): the DHCPv6 discovery URL ignores site.httpport
With site.httpport=8080 an unknown node loads iPXE over DHCPv6 and
cannot fetch the boot script of its network.

kea_client_classes6 wrote the second-stage URL of a network as
http://<server>/tftpboot/..., with no port. The per-node URL from
dhcp6_bootfile_url_for_node already carries the site port.

kea_client_classes6 now takes an httpport option and adds the suffix
from httpport_suffix, as the DHCPv4 network classes do.
kea_boot_client_classes6 passes the value of site.httpport.

dhcp6_boot_client_classes.t and dhcp_dhcpv6_duid.t assert the port in
the URL. Both fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:12:06 -03:00
Daniel Hilst f79ab05278 test(xcat-core): the DHCPv6 discovery URL ignores site.httpport
With site.httpport=8080 an unknown node loads iPXE over DHCPv6 and
cannot fetch the boot script of its network. kea_client_classes6
writes that URL with no port, so the client asks port 80.

dhcp6_boot_client_classes.t gives kea_client_classes6 port 8080 and
asserts the port in the second-stage URL. dhcp_dhcpv6_duid.t sets
site.httpport and asserts the same URL from kea_boot_client_classes6,
which is the caller in the plugin. Both assertions fail on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:11:52 -03:00
Daniel Hilst b6e8a4580e fix(xcat-core): a DHCPv6 boot class answers clients of every network
A discovery client on the second IPv6 network received the boot URL of
the first network.

kea_client_classes6 builds the boot classes of one network. Each URL
carries the address of the management node on that network. The
classes go to the global client-classes of Dhcp6 without the
additional-only flag, so Kea evaluates their tests for the clients of
every subnet. The additional-class list of the subnet does not restrict
them.

kea_client_classes6 now sets additional_only on every class it returns.
The Kea backend renders it as only-in-additional-list, or as
only-if-required before Kea 2.7.4, the same flag the DHCPv4 network
classes use.

dhcp6_boot_client_classes.t asserts the rendered flag. It fails without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:11:18 -03:00
Daniel Hilst 14e0f40cdc test(xcat-core): a DHCPv6 boot class answers clients of every network
kea_client_classes6 builds the boot classes of one network, and the
subnet names them in its additional-class list. The classes do not set
the additional-only flag, so Kea also evaluates them for every client of
every other subnet. A discovery client on the second network then
receives the boot URL of the first network.

dhcp6_boot_client_classes.t renders the classes of one network through
the Kea backend and asserts that each one carries
only-in-additional-list. The assertion fails on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:11:01 -03:00
Daniel Hilst 71c726b32f fix(xcat-core): Ubuntu genimage leaves the online hook out of the dracut module
On Ubuntu 26.04 genimage stops with "dracut[F]: Cannot install a hook
(.../97xcat/xcat-online.sh) that does not exist". install.netboot hooks
xcat-online.sh, but stage_dracut_module does not copy it into 97xcat, so
the stateless image gets no initrd and the node never boots.

Add xcat-online.sh to the files of the stateless module.
imgutils_ubuntu_dracut_module.t fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit ed9a23ba7b203cb3aff6583e07455172be6f2394)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 17:59:02 -03:00
Daniel Hilst f93367daae test(xcat-core): Ubuntu genimage leaves the online hook out of the dracut module
On Ubuntu 26.04 genimage stops with "dracut[F]: Cannot install a hook
(.../97xcat/xcat-online.sh) that does not exist". install.netboot hooks
xcat-online.sh into initqueue/online, but mkinitrd_dracut in the Ubuntu
genimage copies a fixed file list into 97xcat, and that list does not
name xcat-online.sh. The stateless image gets no initrd and no kernel,
so nodeset fails and the node never boots.

This commit moves the copy into imgutils::stage_dracut_module, with the
same file list, so a unit test can call it. The test stages each mode
from the source tree and checks that every file the staged install
script gives to inst_hook is in the module. It fails on xcat-online.sh.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 4155d98dc35a65d5d6721298bf9c2c89428a29fa)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 17:59:02 -03:00
Daniel Hilst 6d2418aaa7 fix(xcat-core): a UEFI node set to boot its disk stops at the firmware boot menu
After the IPv6 diskful install on xcat88-cn, the node netbooted iPXE,
which fetched nodes/seqdisc1.uefi and ran its "exit". OVMF loaded
BootManagerMenuApp, and the node waited at "Please select boot device"
until the case timed out.

UEFI firmware that runs a boot option which returns success stops at
its boot manager menu and does not try the next option. iPXE "exit"
returns success. _write_uefi_exit_script in xnba.pm, which the ipxe
method also uses, now writes "exit 1", so the firmware goes on to the
disk. The BIOS script keeps "exit". netboot_ipxe_method.t fails
without this change; xnba_semicolon.t is updated to the new script.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 10:41:54 -03:00
Daniel Hilst d7aaafc7a0 test(xcat-core): a UEFI node set to boot its disk stops at the firmware boot menu
After the IPv6 diskful install on xcat88-cn, the node netbooted iPXE,
which fetched nodes/seqdisc1.uefi and ran its "exit". OVMF then loaded
BootManagerMenuApp and the node waited at "Please select boot device"
for the rest of the case. UEFI firmware that runs a boot option which
returns success stops at its boot manager menu instead of trying the
next option, and iPXE "exit" returns success.

The test sets an ipxe node to boot and asserts that its UEFI script
exits with a failure status. It fails today.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 10:41:54 -03:00
Daniel Hilst ed5c5b723c fix(xcat-core): two Ubuntu root handler bats cases fail on an Ubuntu runner
"the online hook calls the handler with dracut's three arguments" and
"a second interface does not fetch the image again" fail in the GitHub
CI with "called: No such file or directory". Both cases source
xcat-online.sh from sh. On Ubuntu sh is dash, and the dash "." builtin
passes no arguments, so the hook sees no interface and returns before
it calls the stub handler.

The initramfs links sh to bash, so the cases now source the hook from
bash. Run on an Ubuntu host, both cases fail before this change and
pass after it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 09:28:40 -03:00
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