2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 01:42:15 +00:00
Commit Graph

29438 Commits

Author SHA1 Message Date
Daniel Hilst fc2f4ed11b Merge branch 'fix/el8-el9-static-ipv6-boot' into feat/ipv6 2026-11-05 16:33:08 -03:00
Daniel Hilst 657ff339e1 fix(xcat-core): a static IPv6 kickstart install leaves the node with no resolv.conf
site.nameservers holds one list for the whole cluster, and on a normal lab it
names IPv4 resolvers. _static_kickstart_network6 in Template.pm kept only the
entries that resolve to an IPv6 address, so it rendered no --nameserver at all
and the installed node had no /etc/resolv.conf. Measured on a riscv64
openEuler install. EL 10 takes the same path, and EL 8 and EL 9 now take it
too, so the number of nodes exposed grows.

_autoyast_network6 in the same file already answered this: it maps
'<xcatmaster>' through ipv6_server_for_node and falls back to the management
node when the cluster configures no IPv6 resolver. The chooser is now one sub,
_ipv6_nameservers_for_node, and both callers use it. The fallback is the
management node and not the gateway, because a gateway can be a router that
serves no DNS. A management node with no address on the network of the node
yields no resolver, rather than a guess.

template_ipv6_rendering.t asserts the rendered network line for all three
cases. Without the fallback the IPv4-resolver case fails while the configured
IPv6 resolver case and the no-address control keep passing, and
autoyast_ipv6_network.t goes red with it, which shows both callers read the
same chooser.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 16:31:56 -03:00
Daniel Hilst d74285f4a2 fix(xcat-core): an EL 8 or EL 9 IPv6-only node installs with a DHCPv6 address that holds no reservation
An IPv6-only EL 8 or EL 9 node presents a different DHCPv6 DUID at each boot
stage: the UEFI firmware, then iPXE, then anaconda. makedhcp reserves the
first two, so the installer takes an address from the dynamic range and every
step that reads the reserved address or its PTR record fails.

xCAT::SvrUtils::uses_static_ipv6_boot accepted the rh family only at major 10,
so Template.pm rendered "dhcp --noipv4 --ipv6=dhcp" for EL 8 and EL 9. The
floor is now 8, by operator decision of 2026-11-05.

pre.rhels8 was IPv4 only in two places. The install monitor opened an AF_INET
socket, so the node reported no status. The install server was cut out of its
URL at the first colon, which splits an IPv6 literal. Both forms come from
pre.rhels10. pre.openeuler includes pre.rhels8 whole, so this also fixes the
reported openEuler defect.

ipv6_pre_rhels8.bats and the EL 8 and EL 9 cases of template_ipv6_rendering.t
capture it. With AF_UNSPEC back to AF_INET the three IPv6 monitor cases fail
and the IPv4 one passes. Without the bracket branch the three IPv6 URL cases
fail and the four IPv4 ones pass. With the floor back at 10 the EL 8 and EL 9
rendering cases fail and the EL 10 ones pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 16:31:41 -03:00
Daniel Hilst 9a1df09075 Merge remote-tracking branch 'versatus/fix/ipv6-off-cluster-tests' into feat/ipv6 2026-11-05 10:15:44 -03:00
Daniel Hilst 6cee09e22c Merge remote-tracking branch 'versatus/fix/ipv6-discovery-neighbour-callback' into feat/ipv6 2026-11-05 10:15:43 -03:00
Daniel Hilst b62b3e8fc9 Merge remote-tracking branch 'versatus/fix/ipv6-mknb-nets' into feat/ipv6 2026-11-05 10:15:43 -03:00
Daniel Hilst b82597dec2 docs(xcat-core): the IPv6 and iPXE pages name grub2 as a workaround that cannot work
No package installs an x86_64 grub2 image. grub2-xcat ships powerpc-ieee1275, riscv64-efi and
aarch64-efi, and copycds publishes a grub2 image for riscv64 alone, so an x86_64 node set to
netboot=grub2 asks TFTP for a file that is not there.

The iPXE page told the reader to use netboot=grub2 on the Lenovo UEFI firmware that hangs on
iPXE v2.0.0. That page now records the limit with no x86_64 workaround.

The IPv6 page required Secure Boot off for every node. That is a grub2 constraint: ipxe-xcat
installs a Microsoft-signed shim, so an x86_64 node with netboot=ipxe boots with Secure Boot on.

The same page said nodeset writes the address on the kernel command line. That holds on EL 10,
on openEuler, on an Ubuntu diskless node and on SLES and openSUSE, each through a different
parameter, and not on EL 8, EL 9 or an Ubuntu diskful node. A table names the parameter and the
routine per family, and says that a family which keeps DHCPv6 needs the dynamic range.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:52:01 -03:00
Daniel Hilst aba7b80288 fix(xcat-core): an IPv6 node gets a boot script whose URLs carry no host
xnba.pm started its script server at ${next-server} and replaced it only when the IPv6 lookup
answered. An IPv6 node for which this server has no facing IPv6 address therefore kept the
DHCPv4 variable, an IPv6 client resolved it to the empty string, every URL in the script lost
its host, and nodeset reported success. ipxe.pm runs the same code with SCRIPTS set to
xcat/ipxe, so netboot=ipxe took the same path.

NetworkUtils gains ipxe_script_server_for_node, which makes the decision and returns either the
server or a reason. No value serves such a node, so xnba.pm now stops with that reason instead
of writing a script that cannot work.

netboot_ipxe_method.t and secureboot_ipxe_node_shim.t replace the whole NetworkUtils module
through %INC, so the new sub is stubbed there as well; both carry IPv4 nodes, for which the real
sub answers the iPXE variable.

Restoring the old behaviour in the new sub -- keep ${next-server} when the lookup does not
answer -- fails eight of the sixteen assertions in ipxe_script_server_for_node.t and leaves the
IPv4, unknown-family and IPv6-with-an-address outcomes passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:45:49 -03:00
Daniel Hilst 0373cd6568 fix(xcat-core): discovery cannot resolve an IPv6 findme and never calls an IPv6 node back
A node that sends its findme request over IPv6 is never discovered. Two
steps fail.

seqdiscovery.pm reads the arp(8) table to turn the client address into a MAC
and looks that MAC up in the mac table. arp(8) prints the IPv4 table only, so
the table holds no row for the client and the plugin logs "Could not find mac
of the <address>" and returns. aaadiscovery.pm, profilednodes.pm, blade.pm and
hpblade.pm carry the same parse. All five interpolate the address into a
regular expression as well, so a dot matches any character and 192.168.201.1
matches the row of 192.168.201.120.

nodediscover.pm then opens a TCP connection to the node to send "restart",
and NetworkUtils::send_tcp_msg does the same for its callers. Both build the
socket with IO::Socket::INET, which has no AF_INET6, so the node receives
nothing and Genesis exits on DISCOVERY_TIMEOUT after 36 attempts.

NetworkUtils gains mac_from_neighbour_table, which takes the text of a
neighbour table and the address and returns the MAC; neighbour_table_text,
which reads arp(8) for IPv4 and "ip -6 neigh show" for IPv6; and
mac_of_neighbour, which joins them. The addresses are compared after both
are normalized, so 2001:db8::2 and its full form are one address. The five
plugins call mac_of_neighbour. open_tcp_socket opens the callback through
IO::Socket::INET6 when it is installed and keeps IO::Socket::INET as the
fallback, the way credentials.pm already does; nodediscover.pm and
send_tcp_msg use it.

networkutils_neighbour_mac.t and networkutils_tcp_callback_family.t fail
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:44:41 -03:00
Daniel Hilst 13132cb416 test(discovery): nothing asks how xcatd resolves an IPv6 findme or calls an IPv6 node back
Sequential discovery resolves the address a findme arrived from to a MAC and
looks that MAC up in the mac table. Five plugins carry the same arp(8) parse,
which reads the IPv4 table only and interpolates the address into a regular
expression. After the match xcatd opens a TCP connection back to the node
with IO::Socket::INET, which cannot reach an IPv6 address.

No test covers either step. networkutils_neighbour_mac.t drives the parse
against the text of an arp(8) table and of an ip(8) neighbour table, both
fixtures, so it measures the parse and not the test host's own cache.
networkutils_tcp_callback_family.t replaces both socket classes and asks
which one the callback uses.

Both files report that the subroutines do not exist on this commit, which is
why the fix commit follows.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:44:31 -03:00
Daniel Hilst 7f2fd291aa test(xcat-core): an IPv6 node with no facing address gets a boot script with no host
xnba.pm starts its script server at ${next-server} and replaces it only when the IPv6 lookup
answers: "$script_server = $resolved if defined $resolved". An IPv6 node for which this server
has no facing IPv6 address therefore keeps the DHCPv4 variable. An IPv6 client resolves that to
the empty string, every URL in the script loses its host, and nodeset reports success. ipxe.pm
runs the same code with SCRIPTS set to xcat/ipxe, so netboot=ipxe takes the same path.

ipxe_script_server_for_node.t drives the three outcomes through Perl-level stubs of
node_address_family and my_ip_facing_family: an IPv4 node keeps the variable, an IPv6 node with a
facing address carries it bracketed, and an IPv6 node without one yields no server and an error
that names the node and the family. It also asserts the error does not offer ${next-server} as a
fallback, and that the two families are not given the same text.

The decision has no sub to call yet, so this file names the sub the next commit adds.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:42:24 -03:00
Daniel Hilst 872bfdcefa fix(xcat-core): makedhcp drops the DHCPv6 boot file of an ipxe node without saying so
dhcp6_bootfile_url_for_node in dhcp.pm returned nothing when the UEFI loader was not under the
tftpdir of the node, and reported nothing. The reservation was still written with its address and
its DUID, makedhcp exited 0, and the node reached a firmware timeout with no line anywhere naming
the file it had asked for. On an IPv6 cell that is the whole boot: there is no second method to
fall back to.

BootPolicy gains dhcp6_missing_loader_warning, which takes the tftpdir of the node and the loader
name and returns the sentence or nothing. dhcp6_bootfile_url_for_node reports it through the
callback, once per node per makedhcp, and then drops the boot file as before. Naming the node
matters because the path comes from noderes.tftpdir, which the reader cannot derive from the site
value.

The three assertions the previous commit added to dhcp_dhcpv6_duid.t now pass, and the nine in
dhcp_ipxe_readiness.t with them. Blanking the file check in the new sub fails five of those nine
and leaves the four controls passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:41:07 -03:00
Daniel Hilst 66520c968c test(xcat-core): a netboot=ipxe node with no loader gets no boot file and no warning
dhcp6_bootfile_url_for_node drops the DHCPv6 boot file when the UEFI loader is not under the
tftpdir of the node, and says nothing. makedhcp exits 0, the reservation is written with its
address and its DUID, and the node then sits at a firmware timeout with no line on the
management node that names the file it was looking for.

upstream_loader_warnings does not cover this. It reads the SITE TFTP directory, and it runs on
makedhcp -n and makedhcp -a only, so a node that carries its own noderes.tftpdir is never
examined and makedhcp <node> warns about nothing at all.

dhcp_dhcpv6_duid.t now asserts the warning reaches the caller for the node whose loader is
absent, exactly once, attributed to the node and naming the full path. The node in the same run
whose loader is present must not be reported. dhcp_ipxe_readiness.t asserts the decision itself
for a present loader, an absent one, a trailing slash on the directory, and the three inputs that
are not a missing file.

These assertions fail on this tree: the three in dhcp_dhcpv6_duid.t report nothing in the
collected warnings, while the assertion that the boot file is absent, and the control on the node
whose loader is present, both still pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:39:41 -03:00
Daniel Hilst 251822deae fix(xcat-core): mknb writes no boot script for an IPv6 network, and an unbracketed xcatd=
An unknown client on an IPv6 provisioning network gets no network boot
script. mknb builds its list of networks from my_nets and my_hexnets, and
both skip inet6 on Linux, so nothing is written under xcat/ipxe/nets and
the client has nothing to fetch.

Where an address does reach a script it is written as
"xcatd=" . $address . ":$port". For 2001:db8:177::1 that is
xcatd=2001:db8:177::1:3001, which parses as an IPv6 literal with no port,
so Genesis contacts a different address and reports nothing. The same
concatenation builds the POWER HTTP URLs and the grub2 roots. xnba.pm and
destiny.pm already bracket an IPv6 address through
NetworkUtils::xcatd_cmdline_address and format_uri_host, so the node
files were correct and the net files were not.

NetworkUtils gains my_nets6, which returns the host's global IPv6
networks keyed the way my_nets keys its IPv4 ones, and
ipv6_network_address, which masks an address to its prefix. my_nets keeps
its IPv4-only behaviour: lsslp.pm and PPCdb.pm read its keys with
dotted-quad arithmetic, so an IPv6 key there would be a wrong answer
rather than a new one. my_hexnets keeps its own, because a hexnet is a
PXELINUX file name built from a hexadecimal IPv4 prefix and DHCPv6 has no
equivalent. mknb merges my_nets6 into the networks it writes nets/
scripts for, asks getipaddr for the IPv6 addresses of site.master as well,
and takes every xcatd= value and every HTTP authority from the two
formatting helpers.

mknb_xcatd_address.t and networkutils_my_nets6.t fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:38:09 -03:00
Daniel Hilst a2d889da3d test(mknb): no test asks what mknb writes for an IPv6 network
mknb writes the network boot scripts of an unknown client from my_nets and
my_hexnets, both of which skip inet6 on Linux, and it builds every xcatd=
value by concatenation. No test covers either, so an IPv6 management node
gets no script, and an address written as xcatd=2001:db8:177::1:3001 reads
as a valid literal with no port.

mknb_xcatd_address.t stubbed the whole of xCAT::NetworkUtils, so the
formatting helpers were absent from the harness and could not be measured.
The three harnesses now load the real module and replace only the probes
that read the running host's interfaces. The new assertions cover the
nets/ scripts, the UEFI and elilo entries, the POWER URLs, the s390x
APPEND line and the grub2 roots for one IPv6 network, and
networkutils_my_nets6.t covers my_nets6 and the prefix masking.

16 of the mknb assertions fail on this commit, and the my_nets6 file does
not run at all for lack of the subroutine.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:37:57 -03:00
Daniel Hilst 02cd805478 test(xcat-core): nothing asserts the DHCPv6 reservation pair of a netboot=ipxe node
A netboot=ipxe node is two DHCPv6 clients. The firmware solicits first and takes the
Microsoft-signed shim over TFTP; the iPXE it chainloads solicits again with a DUID built from
the same vpd.uuid in RFC 4122 order and takes the boot script of the node over HTTP. Its sibling
case makedhcp_dhcpv6_boot_intent defines its node netboot=grub2, so no case read the pair, and a
cell could report green with every iPXE line of dhcp.pm broken.

makedhcp_dhcpv6_ipxe_boot_intent reads the rendered kea-dhcp6.conf. It counts the reservations
keyed on the two expected DUIDs, compares both entries byte for byte, asserts the two DUIDs
differ, and moves the address between the clients with mac.duid to say WHICH client gets WHICH
file. A grub2 arm and a return to iPXE are the discriminator: a case that cannot tell the two
methods apart only measures that a reservation exists.

The loader check is first. dhcp6_bootfile_url_for_node returns empty when the UEFI loader is not
under the tftpdir of the node and makedhcp still exits 0, so every later assertion would pass
vacuously on a management node with no ipxe-xcat.

Measured against the rendered reservations of this tree: reverting dhcp6_chainloads to return 0
takes the count from 2 to 1 and leaves the first reservation and the grub2 arm passing; deleting
the "if ($client eq 'ipxe')" arm of dhcp6_bootfile_url_for_node turns the second URL into the
TFTP shim and leaves nine of the eleven value assertions passing.

ipxe-xcat is packaged for x86_64 only, so a bundle must name this case for an x86_64 cell.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:35:26 -03:00
Daniel Hilst 63c81ab01f test(xcat-core): mac.duid is unmeasured on a table that predates it
mac.duid names the DHCPv6 client identifier that a node's reservations match.
A cluster that upgrades carries a mac table with no duid column, and nothing
recreates it, so the column has to arrive on an existing database.

xcatd adds it: at startup it walks every table in the schema and calls
updateschema, which compares the declared columns against the database and
issues the ALTER. Table->new does not do this, so the column arrives when
xcatd restarts and not when a plugin first opens the table.

The test builds a mac table with every column but duid, runs the schema
update, and reads a duid back. It also asserts the row the table already held
survives, and that a node attribute is mapped onto mac.duid so chdef and
lsdef reach it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:20:44 -03:00
Daniel Hilst d50ecd9f3c test(xcat-core): the node-side IPv6 profile decisions are unmeasured
Two shell routines decide whether an installed or booted node keeps its IPv6
address, and neither was driven by a test.

xcat_is_ipv6_boot in the EL stateless xcatroot answers for ip=dhcp6 and, for
a node given a static address, from the live interface. A dual-stack
interface must answer no, or an IPv4 node is given an IPv6 profile.
persist_ipv6_nm_connection copies the profile the initrd holds, or writes one
from the live address, and must refuse to write a profile with no address:
NetworkManager rejects such a file and leaves the interface unmanaged.

configure_install_nic_ipv6_keyfile renders the install NIC profile with
"nmcli --offline" during Anaconda's chrooted %post. A profile that leaves
IPv4 enabled makes the node wait for a DHCPv4 lease that never arrives, and a
temporary file left in system-connections is read as a second profile for the
same interface.

Both files drive the real routines with ip and nmcli stubbed, inside the
test's own scratch tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:20:43 -03:00
Daniel Hilst fbc64196ba fix(xcat-core): an ISC subnet6 loses its resolvers and keeps a deleted host
Two gaps in the ISC DHCPv6 path.

An IPv6 node on an ISC backend gets no resolver and no domain-search list.
addrangedetection keys %netcfgs on networks.net, which a conf may write with
no prefix length, while addnet6 names the subnet "<net>/<prefix>" from the
"ip -6 route" output. addnet6 read the domain, the nameservers and the
ddnsdomain under the long name alone, so all three were undef and the
subnet6 carried neither statement. dynamic_range_for in the same file already
fell back to the bare net, which is why the range was the only value that
survived.

And "makedhcp -d <node>" removed the DHCPv4 host alone. addnode6 creates the
DHCPv6 host as a separate omapi object on port 7912, and delnode never
touched it, so the reservation outlived the node and kept its address and its
boot file.

net_config_for does the lookup with the same fallback dynamic_range_for uses,
and addnet6 takes its values from it. isc_dhcp6_subnet_statements renders the
domain and resolver statements from that entry, so they can be read back.
delnode6 writes the removal over the open DHCPv6 session.

dhcp_isc_dhcpv6_subnet_and_delete.t captures both. Removing the fallback from
net_config_for fails its three lookup assertions and leaves the
dynamic_range_for assertion passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:20:31 -03:00
Daniel Hilst a12d31ced5 fix(xcat-core): an IPv6 master gives a Genesis node no credentials
A node discovered by Genesis on an IPv6-only cluster gets no credentials and
reports no state. The credential callback never answers and the install state
never reaches xcatd, so discovery stops with nothing in the log that names an
address family.

The Genesis copies of the two awk helpers were never given the IPv6 branch
that the copies under xCAT/postscripts carry. allowcred.awk hardcoded
"/inet/tcp/300/0/0", so it ignored XCAT_CREDENTIAL_CALLBACK_PORT and opened a
listener that accepts no IPv6 connection. updateflag.awk built "/inet/" from
the raw argument, so a bracketed IPv6 literal reached gawk with its brackets
and resolved to nothing. Neither build script copies these files, so the two
copies are independent and the first never followed the second.

Both Genesis copies now carry the postscripts logic. updateflag.awk keeps
logger and writes no file: Genesis has no /var/log/xcat directory, rsyslog
sends everything to /var/log/xcat.genesis, and gawk is fatal when it cannot
open a redirect.

ipv6_genesis_awk_inet6.bats captures this. Four of its six cases fail on the
previous copies.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:20:22 -03:00
Daniel Hilst 32d45ea9e8 test(xcat-core): the Genesis awk helpers are unmeasured over IPv6
The Genesis ramdisk carries its own copies of allowcred.awk and
updateflag.awk, because nothing of xCAT is installed in it. No test drove
those copies, and they had drifted from the copies under xCAT/postscripts
that the IPv6 work changed.

The new bats file runs both Genesis copies against a listener on the
loopback address of the family under test. Against the current copies four
of its six cases fail: the credential listener accepts no connection on the
port it was given, and the state report cannot resolve a bracketed IPv6
literal. The two that pass are the IPv4 and plain-IPv6 state reports, which
show the method reaches a working listener.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 09:20:13 -03:00
Daniel Hilst ade69f14a7 fix(xcat-core): the Ubuntu installer dies with curtin NotExclusiveError
A diskful Ubuntu 24.04 install reaches Subiquity, runs curtin, and dies in
exclusive_open on the root partition with curtin.util.NotExclusiveError. The
console names apt-get as a user of the partition.

pre.ubuntu.subiquity starts rsyslogd inside the live installer to forward the
install log to the management node. In the 24.04 installer that process holds
11.9G of a 16G node while its message queue is empty: impstats reports
"main Q: size=0 enqueued=7 maxqsize=6" beside "maxrss=11951868", so no rsyslog
setting bounds it. rsyslogd runs in the cgroup of
snap.subiquity.subiquity-server.service, so the kernel OOM killer stops the
installer. systemd starts a second subiquity-server, and that server runs
curtin partitioning while the first server's curtin is still installing the
kernel into the target, so clear_holders cannot open the root partition.

xcat_start_installer_rsyslog starts the forwarder with systemd-run, in a
transient unit with MemoryMax=128M and MemorySwapMax=0. The kernel then kills
the forwarder alone. Where systemd-run is absent the install forwards no
syslog, because the install is worth more than its remote log.

ubuntu_subiquity_installer_syslog.bats reads the command line the routine asks
for. Dropping the two memory properties fails the limit assertions and leaves
the launcher and the no-fallback assertions green.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 2db399cd6c07e98494353c292990c150a9adce15)
2026-11-05 08:45:14 -03:00
Daniel Hilst d3a23c713c fix(xcat-core): makedns publishes no AAAA for a dual-stack name server
makedns writes the address record of the name server itself into every zone file
it creates, and it wrote one record. The address came from
_preferred_ip_address, which returns the first IPv4 address, so a server with an
A and an AAAA in /etc/hosts published the A alone.

An IPv6-only compute node resolves that name to reach the server. With no AAAA in
the zone it gets no usable address, and behind a NAT64 translator it gets the
synthesis of the IPv4 address, which does not reach the server.

_server_ip_addresses returns every valid address, IPv4 first, and the zone writer
loops over it, taking the record type from _dns_record_type as before.
_preferred_ip_address is unchanged and still names one address for the error path.

xCAT-test/unit/ddns_server_dual_stack.t captures this. With the routine returning
the single preferred address, its first assertion fails and the other six pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-04 13:05:34 -03:00
Daniel Hilst 684f26e530 fix(xcat-core): an IPv6-only node is given no DNS resolver
An IPv6-only node netboots, installs and reaches the end of its installer, then
fails in any step that resolves a name. The node console reports "no search or
nameservers found in /run/net-*.conf /run/net6-*.conf". On Ubuntu this stops
subiquity in its postinstall package step, seconds after curtin finishes and
before any xCAT late command, so the node never boots from disk.

Three writers were involved, and none of them produced a resolver:

kea_subnet6_intent wrote dns-servers only when a configured nameserver resolved
to an IPv6 address. site.nameservers holds IPv4 addresses and the IPv6 network
row's nameservers column is normally empty, so the option was absent.

addnet6 wrote "nameservers <list>;", which is not an ISC dhcpd statement. RFC
3646 names the option dhcp6.name-servers. dhcpd refuses the whole file on an
unknown statement, so the only networks that could reach that line were the ones
that broke the configuration.

radvd_config emitted no RDNSS, so a node that configures itself from the router
advertisement had no second source.

dhcp6_resolvers_for_network is now the one chooser for all three. It keeps a
configured IPv6 nameserver, and otherwise falls back to the management node's
own address on that network, which is what <xcatmaster> names for IPv4. It
returns undef when the management node has no address on the network, because a
resolver that never answers costs the node a DNS timeout instead of a lease.

Measured with dig against an IPv6 cluster management node: a cluster name and an
external name both resolve over IPv6, so the fallback address answers.

xCAT-test/unit/dhcp6_resolver_fallback.t covers the chooser and all three
writers. Against the previous behaviour 12 of its 17 checks fail, and the 5 that
pass are the controls: a configured IPv6 nameserver is kept, and a management
node with no address on the network yields no resolver, no statement and no
RDNSS.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-04 06:51:58 -03:00
Daniel Hilst e20f5fb621 fix(xcat-core): an aarch64 node writes its console to ttyS0, which does not exist
nodehm.serialport holds a port number, so the plugin that writes the kernel
command line also names the device. anaconda.pm, debian.pm, sles.pm, destiny.pm
and mknb.pm each chose between hvc for POWER and ttyS for everything else. An
aarch64 platform presents a PL011 serial port, which Linux names ttyAMA, so an
aarch64 node was told console=ttyS0 and wrote its console to a device that is
not there. A provisioning failure on such a node leaves no console record.

Three of those sites named ttyS with no architecture test at all, so a ppc64le
node lost its console the same way in mksysclone.

The device is now chosen in one place, xCAT::ConsolePolicy, which maps the
architecture to hvc, ttysclp, ttyAMA or ttyS and builds the console arguments
from a port and an optional speed. The ten call sites call it.
_genesis_uses_power_console is removed; destiny.pm calls the module.

console_policy.t covers every architecture and the empty-port case.
anaconda_console_device.t drives mknetboot and reads the arguments out of the
command line the plugin wrote: it fails on the unfixed tree with ttyS0,115200
where ttyAMA0,115200 is expected, and the ppc64le and x86_64 cases pass either
way, so a change that renamed every device would not satisfy it.

An aarch64 platform with a 16550 instead of a PL011 is not covered, as a POWER
machine without a hypervisor console is not: the map takes one device per
architecture, which is what the two existing entries already assumed.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 1b984211212a12cd56603bdfb6fab6cecf197314)
2026-11-03 19:39:22 -03:00
Daniel Hilst 6a95d50acd test(xcat-core): an aarch64 node is told to write its console to ttyS0
nodehm.serialport holds a port number, so the plugin that writes the kernel
command line also names the device. anaconda.pm chooses between hvc and ttyS,
and an aarch64 platform presents its serial port as pl011, which Linux names
ttyAMA. So an aarch64 node is given console=ttyS0 and writes its console to a
device that does not exist.

The test drives mknetboot for aarch64, ppc64le and x86_64 and reads the console
arguments out of the command line the plugin wrote. The aarch64 case fails with
'ttyS0,115200' where 'ttyAMA0,115200' is expected; the other two pass, so a
change that renamed every console device would not satisfy this test.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 42b80b63497022a7d9e19b169ef011d259233fa7)
2026-11-03 19:39:22 -03:00
Daniel Hilst bc2be657b6 fix(xcat-core): a ppc64le node is reserved for a DHCPv6 identifier its firmware never sends
SLOF, the open firmware of a PowerKVM guest and a PowerVM LPAR, identifies
itself with an RFC 3315 DUID-LL built from the MAC of its interface, and it
reports no UUID at all. makedhcp derives every DHCPv6 reservation from
vpd.uuid, so the reservation of a ppc64le node can never match: measured on an
IPv6-only node, SLOF sent 00:03:00:01:<mac> against the 00:04:<uuid>
reservation xCAT wrote. The node gets no reserved address and no RFC 5970
option 59, and its firmware has nothing to load.

dhcp6_client_duid now takes the MAC and the architecture. kea_duid_ll_from_mac
builds the DUID-LL from the first address of mac.mac, which is the interface
that netboots, and dhcp6_firmware_duid_is_link_layer says which architectures
send one. A ppc64le node takes the DUID-LL with no attribute set, and the
byte-order warning about vpd.uuid is not reported for it, because that firmware
does not read the value. mac.duid gains ll, which selects the DUID-LL on any
architecture. firmware and canonical are unchanged and still override.

One reservation covers the whole netboot: the grub2 ieee1275 network stack
builds its DUID from the same interface, so the loader sends what the firmware
sent. That is why no second reservation is written, unlike a chainloading UEFI
node.

dhcp_dhcpv6_duid.t gains five cases. On the unfixed tree 15 of its 195
assertions fail, cn11 with the firmware-order DUID-UUID where the DUID-LL is
expected. A mutation that gives every architecture the DUID-LL fails 42,
naming the x86_64 cases that must keep the DUID-UUID.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-03 19:32:00 -03:00
Daniel Hilst 6b11e0a419 test(xcat-core): a ppc64le node is reserved for a DUID its firmware never sends
SLOF, the open firmware of a PowerKVM guest and a PowerVM LPAR, identifies
itself with a DUID-LL built from the MAC and reports no UUID at all. makedhcp
derives the DHCPv6 reservation from vpd.uuid, so the reservation of a ppc64le
node can never match it: the node gets no reserved address and no RFC 5970
option 59, and its firmware has nothing to load.

Five cases are added to the identifier table. cn11 fails with the
firmware-order DUID-UUID where the DUID-LL of its MAC is expected; cn13 to cn15
fail with no DUID at all. cn12 sets mac.duid=firmware on a ppc64le node and
passes either way, so a change that gave every node a DUID-LL would not satisfy
the table. The MAC each DUID-LL is built from is asserted, so the expected
values are checkable by hand.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-03 19:29:50 -03:00
Daniel Hilst 4aafe12a0a fix(xcat-core): iPXE gets no DHCPv6 boot file, so an IPv6-only node cannot netboot
On an IPv6-only x86_64 node with netboot=ipxe the firmware fetches the shim and
starts iPXE, and iPXE then prints "Nothing to boot: No such file or directory".
The node falls through to "BdsDxe: No bootable option or device was found". The
same node boots over IPv4.

A UEFI node that chainloads is two DHCPv6 clients on one NIC and they send
different DUIDs. EDK2 copies the SMBIOS UUID into its DUID-UUID in the order
SMBIOS stores it, little-endian in the first three fields from SMBIOS 2.6 on,
and iPXE converts the same bytes to RFC 4122 order first. Measured on
xcat147-cn-tmp-333 with vpd.uuid 5d2df358-d529-11f1-9757-4233c0a89316: the
firmware sends 00:04:58:f3:2d:5d:29:d5:... and iPXE sends
00:04:5d:2d:f3:58:d5:29:... kea_node_reservations6 and addnode6 write one
reservation, keyed on the DUID that mac.duid selects, so the other client
matches nothing and gets no RFC 5970 option 59. On IPv4 the reservation is
keyed on the MAC and both clients share it.

dhcp6_client_duid_list now returns every DUID the clients of a node send, and
both backends reserve for each of them when the netboot method chainloads. The
first entry keeps the address and the hostname: Kea refuses a second
reservation for one address, and _reservation_matches treats a shared hostname
as the same reservation. dhcp6_bootfile_url_for_node takes the client, because
iPXE needs the boot script of the node and not the shim again, which is the
split the DHCPv4 client classes make with the iPXE feature options.

A MAC-keyed reservation was measured and rejected. Kea 2.4.1 derived no MAC for
these clients even with mac-sources ipv6-link-local and the EUI-64 link-local
on the wire: the lease kept an empty hwaddr column and the firmware took a pool
address. ISC DHCP has no hardware-address match for DHCPv6 at all. Two
reservations for one address are refused with "There's already reservation for
this address/prefix", and one reservation cannot hold both identifiers:
"the 'hw-address' and 'duid' are mutually exclusive".

xCAT-test/unit/dhcp_dhcpv6_duid.t covers both backends. Seven of its cases fail
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-02 14:58:44 -03:00
Daniel Hilst d202094813 test(xcat-core): an IPv6-only node that chainloads iPXE never gets a boot file
Over DHCPv6 a UEFI node that chainloads iPXE is two DHCP clients on one NIC, and
the two send different DUIDs. EDK2 copies the SMBIOS UUID into its DUID-UUID in
the order SMBIOS stores it, little-endian in the first three fields from SMBIOS
2.6 on. iPXE converts the same bytes to RFC 4122 order first. makedhcp reserves
the address for one DUID, so iPXE matches nothing, receives no RFC 5970 option
59 and prints "Nothing to boot: No such file or directory".

The second client also needs a different boot file. The shim loads ipxe.efi from
the directory it came from, which iPXE cannot do, so a chainloaded iPXE given
the shim again stops at "Failed to open ipxe.efi".

This adds the cases to xCAT-test/unit/dhcp_dhcpv6_duid.t. They assert on the
reservations that kea_build_node_reservations6 returns and on the omshell hosts
that makedhcp creates on ISC DHCP. Seven fail against the unfixed plugin.

One existing case moves from cn03 to cn01. It asserts that an ipxe node whose
shim is absent gets no option 59, and cn03 asks for the canonical DUID order,
which is the order iPXE sends, so the boot file of its first reservation is the
boot script and not the shim.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-02 14:58:30 -03:00
Daniel Hilst b195fea1a7 fix(yaboot): a dual-stack node is linked to a boot configuration name no firmware asks for
yaboot links its configuration file to one name for each address of the node in
the mac table. The name is sprintf("%02x%02x%02x%02x", split(/\./, $ip)), and an
IPv6 address has no four octets: sprintf reads the first field as a number and
fills the rest with zeroes, so 2001:db8:156::10 gives 7d1000000. A dual-stack
node got one correct link and one link to a name no firmware requests, with no
warning. getipaddr returns the IPv6 address first on such a node, so this is
reachable without an IPv6-only network.

yaboot_config_name returns a name only for an address with four octets in range,
and the loop passes over anything else. A node that produced no name at all is
reported with what to use instead, rather than reporting success.

The error for a node with no facing address and no service node interpolated
$myname, which is declared in the branch above it and not in that one. The file
has no "use strict", so the message read ": " and the name of the management node
was lost. It now determines the name where it uses it.

This commit no longer routes the facing address by family. yaboot is reachable
only at osarch=ppc64 with RHEL earlier than 7 or SLES earlier than 11.4, and the
support matrix carries no ppc64 column, so there is no supported configuration
whose yaboot node could be IPv6-only. petitboot keeps that work, because
nodediscover selects it for PowerNV and noderes.5 documents it for bare-metal
ppc64le.

yaboot_config_name.t covers the guard. Removing it fails the four name checks and
leaves the two IPv4 checks passing, which tells the defect apart from a test that
dies.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-31 09:07:37 -03:00
Daniel Hilst 9804168ca9 Merge upstream master into feat/ipv6
Integration test of the 51 commits that landed on upstream master after this
branch was built. Four conflicts, all from edits to the same lines:

perl-XCAT/xCAT/BootUtils.pm: both sides add a new sub at the end of the file.
Master adds expand_node_template, this branch adds grub2_kernel_commands and
grub2_image_provides. All three are kept.

xCAT/xCAT.spec and xCATsn/xCATsn.spec: master wraps the chrony and dhcpd
requirements in a suse_version test, and its %endif lands on the line this
branch uses for radvd. The requirement stays outside the test, because an
openSUSE management node writes radvd.conf too.

xCAT-server/xCAT-server.spec: master's openSUSE requirement list is a superset
of this branch's, so master's is taken whole.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-31 08:55:22 -03:00
Daniel Hilst a85baeaf3d fix(template): the Subiquity install fetches from an unbracketed IPv6 server
The Subiquity templates build three URLs as
"http://#XCATVAR:XCATMASTER##COLONHTTPPORT#/install/autoinst/...", and that tag
renders the bare value of the master. For an IPv6-only node that is a literal
address, so wget read the last group as a port:

    wget -T 30 -O /tmp/getinstdisk http://2001:db8:147::1/install/autoinst/getinstdisk
    http://2001:db8:147::1/install/autoinst/getinstdisk: Bad port number.

The early-commands script runs under "set -eux", so that one line ended it.
subiquity reported CalledProcessError from Early/run, wrote a crash report of
kind "unknown", and stopped before curtin ran. Nothing in the installer logs
named the cause: curtin-install.log was empty, cloud-init was healthy, and the
error report that looked like the failure was the Error CONTROLLER loading its
own configuration.

Template.pm already computed $master_uri_host, bracketed for an IPv6-only
node, and used it for the SLES media URL and the repo baseurl. It is now
exposed as #MASTERURIHOST#, and the three URLs take it.

#XCATVAR:XCATMASTER# keeps the bare value where it is right: bash reads
/dev/tcp/<host>/<port> with no brackets, and the updateflag notification uses
that form.

subiquity_uri_host.t reads both templates, which are the artifact: every
http:// URL has to take the URI host, the /dev/tcp line has to keep the bare
one, and Template.pm has to substitute the tag. Restoring the bare tag in one
URL fails two checks; dropping the substitution fails the third.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 15:56:24 -03:00
Daniel Hilst 319a20106e fix(template): the Subiquity autoinstall gives an IPv6-only node DHCPv4 only
Both Subiquity templates wrote "dhcp4: true" for every node, in the network
section the installer uses and in the netplan the late command writes into the
installed system. An IPv6-only node has no DHCPv4 server to answer, so netplan
brought the provisioning NIC up with no address.

Measured on an IPv6-only node: the installer fetched its autoinstall seed over
IPv6, then could not configure the interface and fell back to asking at the
console. On a serial console that waits for a keypress, so the install stopped
at the mode prompt with no sign of why. The installed system would have had no
address either, which is the defect xcatroot had for a diskless node and
cd6719946 fixed there.

#SUBIQUITYDHCP:<indent># and #SUBIQUITYTARGETDHCP# render from the address
family of the node, beside the #SUBIQUITYINSTALLNIC# and #SUBIQUITYINSTALLMAC#
tags that were already there. An IPv6-only node gets dhcp6 with dhcp4 turned
off explicitly, because netplan defaults dhcp4 to false only when nothing
names it, and the overrides follow the family in use. An IPv4 node gets what
it had, byte for byte.

$node_ipv6_only becomes 'our' so a test can set it. subvars already computes
it before these substitutions run, so nothing recomputes the lookup.

subiquity_ipv6_netplan.t covers both families and both sites, and asserts the
templates carry the tags rather than a literal. ubuntu_subiquity_installnic.t
renders the new tag and gains an IPv6 case: it runs the late command for real,
and an unrendered tag is a shell comment that swallows the redirect, so that
test would have written no file at all.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 14:59:20 -03:00
Daniel Hilst 518ddee895 test(service-node): a check matches the path of the checkout it runs in
service_node_artifacts_el.t asserts the EL service template is not a
Subiquity one, and it matched the pattern against the whole absolute path. A
checkout directory named for the thing under test therefore matched itself:
in a worktree called ipv6-subiquity-net the check failed on
share/xcat/install/rh/service.rhels9.tmpl, which is the right template.

It now matches the basename. A real Subiquity template still fails it, and an
EL one in a path carrying the word still passes.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 14:59:19 -03:00
Daniel Hilst f92df9bc9b fix(debian): an IPv6-only Ubuntu node never configures its interface
subiquity_url_kcmdline left ip= out of the command line, on the reasoning that
casper treats an absent IPv4 half as already done. It does, and it also skips
the whole networking stage: casper calls configure_networking only inside

    if [ -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]

and STATICIP comes from ip=. With no ip= the interface was never brought up,
so wget answered "Cannot assign requested address" and casper panicked with
"Unable to find a live file system on the network". The URL, the brackets and
the served ISO were all correct; nothing had an address to reach them from.

ip=off takes that branch while asking for no IPv4: configure_networking reads
ip= into IP and treats off as already done, then runs dhcpcd -6 on ip6=dhcp.

Measured on an IPv6-only node. With ip=off the console shows dhcpcd-10.0.6,
then "Trying to download and mount http://[2001:db8:147::1]:80/.../install.iso",
and the management node's access log records

    2001:db8:147::1003 "GET /install/ubuntu24.04.4/x86_64/install.iso" 200 3405470119 "Wget"

the whole 3.2G ISO over IPv6, after which subiquity starts. Without ip=off the
same node fails at the wget every time.

debian_subiquity_boot_params.t asserts ip= is present. Removing it from the
command line fails that check alone.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 14:21:32 -03:00
Daniel Hilst 12e1deb45a fix(xcat-core): nothing installs radvd, so the IPv6 networks announce nothing
makedhcp writes /etc/radvd.conf for every IPv6 network in the networks table
and starts the service, and no package declared radvd. On a management node
that did not happen to carry it the file was written and nothing read it. A
client that follows RFC 4861 starts DHCPv6 only when an advertisement sets the
managed flag, and takes its on-link prefix and default route from the
advertisement rather than from the lease, so an IPv6-only node received one
address with a prefix length of 128 and no route to its server.

Measured on an Ubuntu management node: radvd.service answered "not-found"
while /etc/radvd.conf held the right configuration, the compute node held a
/128 DHCPv6 lease, and its installer answered "wget: can't connect to remote
host: Cannot assign requested address" when it tried to fetch its root over
HTTP. Installing radvd made the service active and makedhcp kept it that way.

xCAT and xCATsn now require it, in the rpm specs and in the Debian control
files. A service node answers DHCP for its own subnet and writes the same
file, so it needs the daemon too.

Depends rather than Recommends on Ubuntu, because the apt 3.0 solver drops a
Recommends: that is what took bind9 out of the 26.04 install and left makedns
with no named.

radvd_packaging.t reads the four manifests, which are the artifact. Removing
any one declaration fails its own check, and moving the Debian one to
Recommends fails the check that names the difference.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:45:04 -03:00
Daniel Hilst b1aac24b0a fix(dhcp): router advertisements reach an interface DHCP does not serve
configure_router_advertisements took the mgtifname of every IPv6 network in
the networks table. site.dhcpinterfaces names the interfaces this server
answers on, and the advertisement ignored it, so a management node restricted
to eth1 still advertised itself on eth0. Every client on that LAN can then
select it as a router, which is what restricting the interface was meant to
prevent.

The sub now takes the interface set the DHCP configuration was built from and
skips a network whose interface is not in it. All three call sites already had
the set: the ISC path in scope, and both Kea paths as a parameter. An empty or
absent set is no restriction, so a cluster that sets no dhcpinterfaces keeps
the behaviour it had.

There are also two fixes to how radvd is started:

- The service is examined on every call rather than only when the
  configuration file changed. A start that failed left the file already
  correct, so every later makedhcp returned on the file alone and never tried
  again while radvd stayed down. The call also moved out of the dhcpd6 restart
  branch of the ISC path, which a repeat makedhcp does not enter at all.
- restartservice answers -1 when the service is not installed and the exit
  status of the command otherwise. Only the -1 was reported, so a radvd that
  failed to start was silent. Every nonzero result is now reported, and the
  message says which of the two it was.

dhcp_dhcpv6_duid.t drives the sub directly for the service cases, because
process_request reaches it only on some paths. Dropping the interface filter
fails the check on an unserved network; restoring the early return on an
unchanged file fails the restart check and leaves the one for a service that
is already up passing; ignoring a positive exit status fails the two checks
that name it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:18:35 -03:00
Daniel Hilst 2ac19d7202 fix(debian): an IPv6-only node is given [<xcatmaster>] as its gateway
mknetboot read networks.gateway and passed it to dracut_static_ip6 as it
stood. '<xcatmaster>' is the common value of that column, and it reached the
kernel command line as "[<xcatmaster>]", which is not an address. A node whose
image server sits off its own link then had no route to it.

static_ip6_boot_arg resolves the gateway through ipv6_server_for_node, which
already knew the placeholder and which the AutoYaST path already used. A
gateway that does not resolve is dropped rather than written as a bad address:
an address with no route still reaches a server on the same link.

The composition is its own sub, taking its two lookups as coderefs, because
the helpers were covered while nothing connected them to the call site.
debian_static_ip6_gateway.t drives it with the real dracut_static_ip6.
Passing the gateway unresolved puts "[<xcatmaster>]" in the argument, which
two of its checks report.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:18:14 -03:00
Daniel Hilst 7f8fc5a937 fix(debian): copycds deletes the install media when it is given the ISO in the tree
link_install_iso unlinked its destination and then created the link. copycds
can be given the ISO that is already in the install tree, or the link that a
previous run left there, and the destination is then the same file as the
source. The unlink deleted it, and the symlink that followed pointed at a path
that no longer existed. An ISO copied into /install by hand was lost, and the
tree was left with a dangling link that answers 404 to the node fetching it.

The source and the destination are now compared by device and inode before
anything is removed, which also follows the link, so a second copycds of the
same media leaves the link alone instead of recreating it.

debian_subiquity_boot_params.t covers an ISO at the destination, a link that
resolves to the media, and a different ISO that replaces the link. Without the
comparison the first case leaves a dangling link and the file is gone, which
three of the new checks report.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:18:14 -03:00
Daniel Hilst 3fbf0b2a85 fix(xcat-test): a conf value is cut at its first semicolon
The value class of the conf parser held ':' and '/' and not ';', so
"othersettings=cpumode:host-passthrough;firmware:efi-secureboot" was read as
"cpumode:host-passthrough" and the rest was dropped with no warning. chtab
wrote the row with the first setting alone, and the node was defined without
the firmware it needs to boot over IPv6. The [Object_*] branch had the same
class and the same effect on vmothersetting.

The chtab command was also built by interpolation, with the row selector
unquoted, so a row name or a key carrying shell syntax would have ended the
command. chdef left its type and object name unquoted for the same reason.

parse_conf_assignment is now the one place the class is written, for both
section kinds. table_row_command builds the chtab command with every argument
quoted, the row selector among them, and object_definition_command quotes its
type and name.

xcattest_object_quoting.t asserts the argument list each command delivers, not
only its text, so a quoting change that splits an argument is caught. Removing
';' from the class fails the one check that names a semicolon value and leaves
the other fifteen passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:17:39 -03:00
Daniel Hilst 102dc80920 fix(postscripts): an installed node ignores the DUID its reservation holds
configdhcpv6duid always derived the DHCPv6 client identifier from the SMBIOS
UUID in firmware byte order. makedhcp does that only when mac.duid is unset or
holds 'firmware': 'canonical' reserves the order product_uuid prints, and a
literal DUID is reserved as it stands. A node with either setting wrote an
identifier that matched no reservation, so it took a pool address and had no
boot file URL.

mypostscript.tmpl now exports the attribute as DHCP6DUID, and the postscript
reads it. 'canonical' keeps the order product_uuid printed. A literal is
written as it stands for NetworkManager, which takes a whole DUID.
systemd-networkd composes one from a named type, and only the UUID type can be
expressed that way, so a literal of another type is written for
NetworkManager alone and the reason is logged. A value that is neither keyword
nor DUID writes nothing, which is what makedhcp refuses as well.

The derived values are byte-identical to kea_duid_from_uuid for both orders.
postscript_dhcpv6_duid.bats goes from 9 checks to 16; ignoring the attribute
fails the five that name a setting and leaves the firmware default passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:17:39 -03:00
Daniel Hilst 8c704104ab fix(template): the AutoYaST profile gives a node its gateway as a resolver
_autoyast_network6 replaced '<xcatmaster>' in site.nameservers with the
gateway of the node, and fell back to the gateway when the list held no IPv6
address. '<xcatmaster>' is the management node, which runs named. The gateway
is not: a cluster whose gateway is a separate router gave every node a
resolver that answers nothing, and a cluster with no gateway gave none at all,
so the installed node resolved no hostname.

The placeholder now resolves through ipv6_server_for_node, which is what the
gateway itself already used. A value that is not an address is not written,
so an unresolvable placeholder leaves the list empty rather than putting
"<xcatmaster>" in the profile.

autoyast_ipv6_network.t gains a management node that is nobody's gateway, so
the two can be told apart, and the check that asserted the old behaviour now
asserts the new one. Restoring the gateway fails five checks and leaves the
other nineteen passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:17:23 -03:00
Daniel Hilst 7f46d8dab3 fix(ipv6): an NFS root loses the last group of its IPv6 server
substitute_facing_address brackets the facing address only where a port
follows the placeholder. An NFS root carries the server between two colons,
as in "root=nfs:!myipfn!:/install/netboot", so an IPv6 server came out as
"root=nfs:2001:db8::1:/install/netboot". dracut reads the server up to the
last colon, so it took "2001:db8:" and the statelite node could not mount its
root.

The substitution now also brackets a placeholder that an NFS path follows. A
placeholder with nothing after it still takes the bare address, because
xcatd=!myipfn! names a host with no port and the postscripts read that value
as it stands.

networkutils_ipv6_helpers.t covers both forms in one command line. Removing
the new substitution fails the two IPv6 checks and leaves the IPv4 and
bare-placeholder checks passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:17:23 -03:00
Daniel Hilst c0f8fd42b0 feat(debian): an IPv6-only node installs Ubuntu from the ISO over HTTP
An IPv6-only node could not install Ubuntu. subiquity_boot_params refused it,
because casper mounts the live filesystem with klibc nfsmount, which has no
IPv6: it answers "need a path" for "[2001:db8::1]:/export" and for
"2001:db8::1:/export", while an IPv4 server gets past parsing to the mount.
casper takes nfsroot= as an opaque path, so no option changes the family.

casper has a second route. do_urlmount downloads an ISO with casper's own
wget, which speaks IPv6, and loop-mounts it, and the network itself was never
the limit: init parses ip6= and configure_networking runs "dhcpcd -1KL -6" on
it. The route needs an ISO to fetch, and xCAT serves the extracted media and
kept no ISO.

copycds now passes the ISO it was given to the distribution plugin, which
links it into the install tree as install.iso. A symbolic link, because the
Ubuntu 24.04 ISO is 3.2G, and the xcat.conf xCAT ships gives /install
"Options FollowSymLinks". A block device has no path to link and passes none.

An IPv6-only node then gets "ip6=dhcp boot=casper netboot=url
url=http://[server]:port/install/<os>/<arch>/install.iso", with no nfsroot
and no toram: do_urlmount already holds the ISO in the initramfs tmpfs, so
copying the live filesystem again only doubles the memory the node needs.
That memory is the cost of the route -- 3.2G for the ISO on top of the
installer -- so a node with 4G cannot take it.

An IPv4 node is untouched and still mounts its root over NFS. A tree copied
before this change carries no ISO, so such a node is refused as before, with
a message naming install.iso and copycds.

debian_subiquity_boot_params.t goes from 17 checks to 36. Routing an IPv6-only
node back to the NFS form fails the six HTTP checks; dropping the bracketing
fails exactly the two bracketing checks; and returning success from
link_install_iso without creating the link fails the three that read the link
back, while the one that reads the return value still passes.

Not yet booted on a cluster.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 10:42:54 -03:00
Daniel Hilst 8cfb0c60a9 fix(debian): the Subiquity refusal names the wrong component
subiquity_boot_params refuses an IPv6-only node and says the live installer
"configures its network and mounts its root with klibc, which has no IPv6
support". The first half is wrong. casper reads ip6= from the kernel command
line and configures the interface with dhcpcd -6, which speaks DHCPv6:
scripts/functions runs "dhcpcd -1KL -t $ROUNDTTT -6" on the ip6= value, and
init parses ip6= at line 156. klibc ipconfig is only the IPv4 branch.

The one component with no IPv6 is klibc nfsmount, which casper uses for the
live filesystem. Measured on noble klibc-utils 2.0.13: it answers "need a
path" for "[2001:db8::1]:/export" and for "2001:db8::1:/export", while an
IPv4 server gets past parsing to the mount, and the binary carries no inet6
string against seven nfs and mount strings.

The refusal stands, because casper takes nfsroot= as an opaque path and has
no way to pass it an address family. Only its reason changes. The comment
also records the route that would close this: netboot=url fetches an ISO with
casper's own wget, which does IPv6, and that is a different provisioning
method than the extracted tree xCAT exports.

The check on the message matched /klibc/, which is the family and not the
component, so it passed for any klibc tool. It now matches /nfsmount/, and
the previous wording fails it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 10:31:41 -03:00
Daniel Hilst ec5acc96a1 fix(yaboot): a dual-stack node is linked to a boot configuration name no firmware asks for
yaboot links its configuration file to one name for each address of the node
in the mac table. The name is sprintf("%02x%02x%02x%02x", split(/\./, $ip)),
and an IPv6 address has no four octets: sprintf reads the first field as a
number and fills the rest with zeroes, so 2001:db8:156::10 gives 7d1000000.
A dual-stack node therefore got one correct link and one link to a name no
firmware requests, with no warning. An IPv6-only node got only the second.

yaboot_config_name returns a name only for an address with four octets in
range, and the loop passes over anything else. A node that produced no name
at all is reported with what to use instead, rather than reporting success.

The facing address was found with my_ip_facing, which resolves with inet_aton
and reports an IPv6-only node unresolvable. yaboot_facing_address asks
node_address_family first, the way grub2.pm and petitboot.pm do, and the
!myipfn! substitution goes through substitute_facing_address so a placeholder
that a port follows is bracketed.

The error for a node with no facing address and no service node interpolated
$myname, which is declared in the branch above it and not in that one. The
file has no "use strict", so the message read ": " and the name of the
management node was lost. It now determines the name where it uses it.

yaboot_ipv6.t covers both subs. Restoring the unguarded sprintf fails the
four name checks; calling my_ip_facing unconditionally fails the three family
checks. The IPv4 checks pass under both, which is what tells the two defects
apart from a test that dies.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 10:23:38 -03:00
Daniel Hilst 6dcde28dc9 fix(petitboot): an IPv6-only node is given a boot configuration name no firmware asks for
petitboot asks for a configuration file named after the four octets of the
IPv4 address of the node, in hexadecimal. The name is built with
sprintf("%02x%02x%02x%02x", split(/\./, $ip)), and an IPv6 address has no
four octets: sprintf reads the first field as a number and fills the rest
with zeroes, so 2001:db8:156::10 gives 7D1000000. nodeset then links the
configuration to a name no firmware requests, reports success, and the node
boots nothing.

petitboot_config_name returns the name only for an address that has four
octets in range, and nodeset reports the node instead of linking a name that
cannot work. The message says what to use: an IPv4 address on the node, or
netboot=grub2, which carries the server in the boot file URL and needs no
name of this form.

This is a refusal, not support. What name petitboot asks for over DHCPv6 is
not established here, and no cell in the lab runs petitboot, so the value
cannot be measured. An error that names the limit is what an operator can
act on; a wrong name is not.

Five checks in petitboot_ipv6.t cover it. Restoring the unguarded sprintf
fails the three IPv6 and undef checks and leaves the two IPv4 checks passing,
including the name of 192.0.2.50, which stays C0000232.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 10:15:49 -03:00
Daniel Hilst 9cc9503a96 fix(petitboot): an IPv6 node loses the server from its kernel and initrd URL
petitboot builds the URL it fetches a kernel and an initrd from as
"$httpmethod://$installsrv:$httpport$tftpdir/", so an IPv6 install server
gives "http://2001:db8::1:80/tftpboot/...", which cannot be split into a host
and a port. The node then has no server to fetch from.

The facing address is found with my_ip_facing, which resolves with inet_aton.
An IPv6-only node is reported unresolvable, and the node gets no
configuration at all.

petitboot_boot_url builds the URL through uri_authority, which brackets an
IPv6 address. petitboot_facing_address asks the family of the node which
helper answers, the way grub2.pm does. The three !myipfn! substitutions go
through substitute_facing_address, which brackets the placeholder that a port
follows and leaves every other one bare. petitboot.pm also now loads
xCAT::NetworkUtils, which it has always used and never named.

An IPv4 node keeps the URL it had, byte for byte, including the port that the
old form always wrote.

petitboot_ipv6.t covers both. Writing "$server:$port" back in place of
uri_authority fails the two IPv6 URL checks. Calling my_ip_facing
unconditionally fails the three family checks. Neither mutation touches the
IPv4 checks, which is what separates the two defects from a test that dies.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 10:15:36 -03:00
Daniel Hilst 38a60074e0 fix(dhcp): a unit test writes the radvd configuration of the host it runs on
configure_router_advertisements writes /etc/radvd.conf and runs sysctl on the
management interface. dhcp_dhcpv6_duid.t drives makedhcp through
process_request, so the test reaches both. The suite runs as root in the
GitHub CI, where the test therefore replaces the real /etc/radvd.conf of the
runner and turns IPv6 forwarding on for its interfaces.

Where the file is not writable the warning also reaches the callback that
other checks read, so the test failed on an unprivileged host:

  Structures begin differing at:
       $got->[2] = 'Cannot write /etc/radvd.conf, so the IPv6 networks
                    announce no route: Permission denied'
  $expected->[2] = Does not exist

The path is now the package variable $radvdconffile, and the sysctl call is
the sub enable_ipv6_forwarding. The test localizes both, the way it already
localizes $dhcpconffile and xCAT::Utils::restartservice.

Six checks now cover the behaviour the configuration carries: the file is
written, it names the interface of the IPv6 network, the interface sends
advertisements, the managed flag is on, the prefix is announced, and
forwarding is enabled. Removing the call from the ISC path fails exactly
those six and leaves the other 127 passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 10:15:08 -03:00