2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 09:52:17 +00:00
Commit Graph

11192 Commits

Author SHA1 Message Date
Daniel Hilst a8d482cdb1 fix(xcat-core): an unknown DHCPv6 client is handed the shim twice
kea_client_classes6 built one class per client architecture, each naming the
signed iPXE shim. That answers the firmware. The shim starts iPXE, which
solicits again carrying the iPXE user class, and a client xCAT has never seen
matches no per-node class: its only match is the same architecture class, so it
is given the shim again and never fetches a kernel. The Genesis image never
runs, no findme reaches xcatd, and sequential discovery over IPv6 cannot start.
The DHCPv4 side has carried this second stage for years in
kea_xnba_network_classes, keyed on option 93.

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:02:56 -03:00
Daniel Hilst 0e45012264 fix(xcat-core): choose the UUID byte order of a DUID from the node, not the platform
The implementation for 596450159, which committed only its test.

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

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

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

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

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

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

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

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:11:04 -03:00
Daniel Hilst 0c3cede440 docs(xcat-core): correct why a DUID byte order cannot name a DHCPv6 boot stage
The previous two commits said the firmware sends the uuid in RFC 4122 order and iPXE in SMBIOS
order, the opposite of a physical machine. That reads the measurement the wrong way round.

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 01:19:12 -03:00
Daniel Hilst 182f3d9ef2 fix(xcat-core): DHCPv6 gives the firmware an http boot file it cannot fetch
A UEFI node that chainloads solicits twice. dhcp6_client_duid_list labelled the SMBIOS
little-endian DUID-UUID 'firmware' and the RFC 4122 one 'ipxe', and kea_node_reservations6 wrote
the boot file of that stage into each reservation.

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

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 01:11:23 -03:00
Daniel Hilst cbfbbe12d7 fix(genesis): imgserver falls back to the IPv4 address of an IPv6-only node
The imgserver of the nodeset response takes noderes.tftpserver, then
noderes.xcatmaster, then site.master, and falls back to my_ip_facing. That
resolver is IPv4 only, and an IPv6-only node shares the link with the management
node, so the fallback answers with the IPv4 address and the node is sent to
fetch its image from an address it has no route to.

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

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

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

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 19:38:18 -03:00
Daniel Hilst 69737e20ff fix(dhcp): a DHCPv6 client with no reservation is told nothing to boot
A node that xCAT has not yet discovered has no DUID, so kea_node_reservations6
writes no reservation for it. Option 59, bootfile-url, is written only inside a
reservation, so Kea answers the node with an address from the dynamicrange and
no boot file. The node boots nothing, and sequential discovery over IPv6 cannot
start: xCAT learns the DUID from the Genesis image, and the image needs a boot
file to run.

DHCPv4 answers an unknown client from client classes keyed on option 93, the
client system architecture. RFC 5970 gives DHCPv6 the same registry in option
61 and the boot file URL in option 59, so the same shape applies. Two places
dropped it:

  render_dhcp6_config did not render client-classes, which render_dhcp4_config
  has always done. _render_subnet6 did not render the additional-class list,
  which _render_subnet4 renders.

Both now render them. kea_client_classes6 builds one class per architecture:
the signed iPXE shim for a UEFI x86_64 client when the loader is on disk, and
the grub2 loader for aarch64, riscv64 and ppc64. kea_subnet6_intent builds them
per network, because option 59 carries a server and that server is the
management node facing that network, and names them per subnet so two
provisioning networks cannot collide.

A node with a reservation keeps the boot file the reservation carries. The
classes answer only what no reservation matched.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 19:15:27 -03:00
Daniel Hilst b999334d1a test(xcat-core): a nodeset subrequest reports a command it never ran
rinstall prints "Failed to run 'nodeset' against the node" while nodeset
succeeds and reports no error. xCAT::Utils::runxcmd returns $::RUNCMD_RC, and
xCAT::Utils::runcmd and the service helpers of every plugin inside the
subrequest assign to that global, so the status of the last command of the
subrequest becomes the status of the subrequest. makedhcp supplies that
command: the ISC branch restarts dhcpd6 whenever /etc/dhcp/dhcpd6.conf is
absent or foreign, which is every run of a cluster with no IPv6 network, and
the restart fails because dhcpd6 has no subnet to serve.

runxcmd_subrequest_errorcode.t holds the result of a subrequest to the
errorcode of its responses. dhcp_isc_dhcp6_restart.t holds the restart of
dhcpd6 to a run that serves an IPv6 network. The condition moves out of
dhcp.pm into xCAT::DHCP::Backend::ISC unchanged, so that a test can read it.

Against this tree the first test fails 3 of its 5 assertions and the second
fails 1 of its 4.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 07:18:31 -03:00
Daniel Hilst 99619fe205 fix(xcat-core): radvd ignores dhcpinterfaces=* and outlives the last IPv6 network
ra_interface_is_served looked up the interface name literally. With
dhcpinterfaces=*, which Kea accepts, no interface was served and
makedhcp wrote no advertisement.

configure_router_advertisements returned when no IPv6 network was
left, and the Kea callers ran it only with a DHCPv6 subnet. radvd then
kept announcing the old prefix and default route.

The wildcard now serves every interface. radvd_config starts its output
with a marker line. When no IPv6 network remains and the file carries
that marker, makedhcp stops and disables radvd and removes the file.
radvd sends a router lifetime of zero when it stops. A radvd
configuration without the marker is left alone. Both Kea paths now
call configure_router_advertisements on every run.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-06 17:36:42 -03:00
Daniel Hilst aac8356fe5 fix(xcat-core): DHCPv6 entries of secondary clients stay behind
With mac.duid=canonical, addnode6 gave the shim to the host that
answers iPXE, so iPXE never loaded the node script. delnode6 listed
only the ipxe and genesis hosts, so makedhcp -d left <node>-firmware.

On Kea, an entry of a client that holds no address has no hostname.
After a change of netboot, no reservation of the new set matched it,
and makedhcp -d matched only the DUIDs of the current clients.

addnode6 now asks for the boot file of the client that mac.duid
selects, removes the hosts of clients the node no longer has, and
delnode6 also removes <node>-firmware. Each Kea DHCPv6 entry names its
node in user-context. upsert_reservations replaces the entries of a
node as a set, and makedhcp -d matches on that owner.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-06 17:36:42 -03:00
Daniel Hilst a5cd542a5d fix(xcat-core): configdhcpv6duid writes a DUID that the reservation does not hold
mypostscript assigned DHCP6DUID and did not export it, so configdhcpv6duid, which runs as a
child process, never saw mac.duid and wrote the firmware DUID-UUID. The script also rejected
ll, which makedhcp accepts and selects by default on ppc64le. It read the SMBIOS UUID before
the attribute, so a missing or nil UUID ended the script although a literal DUID needs none.
And it wrote no systemd-networkd configuration for a DUID that is not a DUID-UUID.

mypostscript now exports DHCP6DUID. The script reads the attribute first, builds the DUID-LL
from the first mac.mac address for ll and for an unset value on ppc64le, reads the UUID only
for firmware and canonical, and gives systemd-networkd the type of every DUID through
DUIDType and the rest through DUIDRawData.

postscript_dhcpv6_duid.bats fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-06 17:32:00 -03:00
Daniel Hilst e628125cf9 fix(xcat-core): Subiquity IPv6 netplan lets RA start DHCPv6 and drops named resolvers
_subiquity_netplan6 wrote dhcp4: false and a static address, and left accept-ra unset. A
router advertisement with the managed flag still starts DHCPv6 in systemd-networkd. The pool
address it gets has no PTR record, so xcatd refuses the completion callback and the node
boots the installer again.

The same sub filtered site.nameservers on a colon, so a resolver given as a host name was
dropped and the management node replaced it.

The netplan now carries dhcp6: false and accept-ra: false, and the resolvers come from
_ipv6_nameservers_for_node, which resolves a host name to its AAAA address as the kickstart
path already does. subiquity_ipv6_netplan.t fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-06 17:29:55 -03:00
Daniel Hilst 3f79229fc0 fix(xcat-core): the EL10 IPv6 keyfile is written inside a deleted ifcfg block
An IPv6-only diskless node needs its address in a NetworkManager keyfile, because the
booted system does not repeat the DHCPv6 exchange of the initial ramdisk. This branch
writes that keyfile inside the dhclient and ifcfg handoff of
xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot, and upstream commit
1c42a2c72 deletes the whole handoff. So the branch does not merge, and the keyfile
depends on ETHX and MACX, which getdevfrommac() and the deleted derivation supplied.

The deletion is the base now. xcat_boot_netif() names the provisioning NIC from ifname=,
from netdev=, or by matching the BOOTIF MAC against /sys/class/net/<dev>/address.
xcat_persist_ipv6_boot() reads the MAC of that interface from sysfs and calls
persist_ipv6_nm_connection(). The removal of ifcfg-$ETHX is dropped: the script writes no
ifcfg file any more, so there is no competing profile to remove.

Eight checks in xCAT-test/bats/ipv6_xcatroot_el_stateless.bats run the two functions
against a scratch sysfs tree. Three mutations of the rework each turn one check red. The
checks cannot run against the unreworked file, which holds neither function, so the test
and the change are one commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 17:36:03 -03:00
Daniel Hilst 428298e9a1 Merge branch 'fix/ipv6-ubuntu-dracut-and-test-isolation' into feat/ipv6 2026-11-05 17:12:35 -03:00
Daniel Hilst 6de92d269b fix(xcat-core): the Genesis image matches no DHCPv6 reservation of its node
The OpenEmbedded Genesis image ships one NetworkManager configuration,
10-xcat-genesis.conf, and it sets ipv6.dhcp-duid=ll. The image therefore sends
the DUID-LL of the provisioning NIC on every netboot method. makedhcp reserves
the two DUID-UUID orders that EDK2 and iPXE send, and only a DUID-LL where
mac.duid says ll, so a node with the default selector gets no answer once
Genesis runs and a node with ll leaves the firmware and iPXE unanswered. Three
programs boot one node and each sends an identifier of its own.

dhcp6_client_duid_list in xCAT-server/lib/xcat/plugins/dhcp.pm returned the two
UUID orders alone. It now derives 00:03:00:01 and the MAC, which needs no value
the node reports first, and appends it as a third client. dhcp6_node_clients is
the one place the clients of a node are selected: it drops the iPXE order where
the method does not load iPXE and keeps the DUID-LL for every method, because
Genesis runs whatever loaded it. kea_node_reservations6, the ISC hosts and the
makedhcp -d match list all read that selection, so delnode6 removes the hosts
it writes. The first client still keeps the address and the hostname.
mac.duid=ll, a literal DUID and DHCPv4 are unchanged.

Seventeen assertions in dhcp_dhcpv6_duid.t fail without the appended client.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 17:08:45 -03:00
Daniel Hilst 9c311c8946 fix(xcat-core): Ubuntu diskless nodes cannot netboot over IPv6 only
The Ubuntu genimage enters dracut mode only when the rootimg holds
/usr/share/dracut or /usr/lib/dracut (netboot/ubuntu/genimage:791). Seven
netboot package lists hold no dracut, so genimage writes the legacy /init.
That /init waits for an "inet addr" line from ifconfig (genimage:1339) and
cuts XCATSERVER at the first colon (genimage:1348). Both steps are IPv4-only,
so an IPv6-only diskless node never boots. Ubuntu 26.04 diskless is the row
this blocks.

Add dracut and dracut-network to the 24.04 ppc64el list, its ppc64le copy,
and the five 26.04 netboot lists. Both packages are published for noble
(universe, 060+5-1ubuntu3) and resolute (main, 110-11) on amd64, ppc64el and
riscv64. dracut-network pulls iproute2 on resolute and iputils-arping on
noble, so no other entry is needed.

The new xCAT-test/unit/ubuntu_netboot_dracut_pkglists.t reads the seven lists
plus the working 24.04 x86_64 reference and asserts both entries.
profile_customization.t now expects dracut in the 26.04 riscv64 list.
Removing dracut from compute.ubuntu26.04.pkglist fails only that list's
assertion; the reference stays green.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 16:46:29 -03:00
Daniel Hilst dc2b3b4aea Merge branch 'fix/subiquity-ipv6-static-netplan' into feat/ipv6 2026-11-05 16:40:34 -03:00
Daniel Hilst 94225e8034 fix(xcat-core): a Subiquity IPv6 install takes a pool address and stops at post.xcat
The Subiquity autoinstall of an IPv6-only node asked netplan for DHCPv6, and
the late-command wrote the same request into the installed system. A DHCPv6
client is identified by its DUID, which the installer generates in the
initramfs, so it matched no Kea reservation and the node took an address out
of the dynamic range. That address has no PTR record, because makedns writes
PTRs from the hosts table, and xcatd identifies a client over IPv6 only by the
name its address resolves to. post.xcat then fetched a mypostscript that
getpostscript could not build, and the install stopped.

subiquity_dhcp_keys and subiquity_target_dhcp_keys in Template.pm now render
the static address of the node, through a new _subiquity_netplan6, in the shape
xcatroot writes for a diskless IPv6 node. A new subiquity_install_match
replaces the literal name: "e*" of both templates: a static address on each of
three interfaces of one bridge is a broken network, so an IPv6-only node is
matched by its MAC. Each IPv4 return keeps its former string.

casper takes no static ip6=, so the debian.pm docs say where the reserved
address comes from instead.

subiquity_ipv6_netplan.t fails 15 of 30 without this change, and
subiquity_install_match.t has no subroutine to call.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-05 16:39:13 -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 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 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 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 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 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 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 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 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 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 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 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 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