2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-20 01:12:18 +00:00
Commit Graph

6555 Commits

Author SHA1 Message Date
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 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 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
Daniel Hilst 10c30c80ba Merge pull request #7993 from VersatusHPC/fix/getpostscript-client-identity-v2
fix(xcat-core): getpostscript serves no node when the client reverse lookup is empty
2026-10-30 09:57:22 -03:00
Daniel Hilst 0312d28117 fix(dhcp): makedhcp -n writes no router advertisement
kea_process_request has two paths. The full regeneration writes the whole
configuration, restarts the services, unlocks and returns; the incremental one
falls through to the end. The call added in the previous commit sat only on the
incremental path, so makedhcp -n, which is what configures a new cluster, wrote
no /etc/radvd.conf at all.

Measured on an IPv6-only alma10.1 management node: with radvd.conf removed,
radvd stopped and forwarding set to 0, makedhcp -n left all three unchanged.
The generator itself was correct the whole time; it was never called.

The full regeneration now configures the advertisements before it returns.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 18:14:38 -03:00
Daniel Hilst 113463a191 feat(dhcp): an IPv6 network announces no prefix and no route
makedhcp writes the DHCPv6 reservations and nothing announces the network. xCAT
configures no router advertisement anywhere: a fresh IPv6 provision network has
no radvd and forwarding off.

Two failures follow from that one gap. A client that follows RFC 4861 uses
DHCPv6 only when an advertisement sets the managed flag, so iPXE reported
"No configuration methods succeeded" and never sent a solicit: the DHCPv6 log
held the firmware DUID alone. And a client that does solicit gets one address
with a prefix length of 128, because the on-link prefix and the default route
come from the advertisement, not from DHCPv6.

makedhcp now writes /etc/radvd.conf for every IPv6 network in the networks
table and restarts radvd, for both the ISC and the Kea backend. The
advertisement sets the managed flag and marks the prefix on-link but not
autonomous, so the address still comes from DHCPv6, which holds the
reservations. An IPv4 cluster gets no file and no service. A management node
without radvd gets a warning naming what the nodes lose.

Measured on an IPv6-only alma10.1 node with netboot=ipxe. Without the
advertisement iPXE stopped at "No configuration methods succeeded". With it
iPXE reported "Configuring (net0 ...) ok" and
"net0: 2001:db8:149::1002/64 gw fe80::4054:ff:fec9:95d3", loaded the kernel,
and the node booted and answered ssh, xdsh and updatenode over IPv6.

Captured by xCAT-test/unit/radvd_config.t. Removing the managed flag fails the
assertion that names it; making the prefix autonomous fails the assertion that
names that.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 17:55:55 -03:00
Daniel Hilst c2c5bc8bb6 docs(dhcp): the iPXE loader cannot finish an IPv6 boot yet
The commit that added ipxe to the DHCPv6 gate justified it with strings found
in snponly.efi. That was not evidence that the feature is built in, and a boot
disproved it.

Measured on an IPv6-only alma10.1 node with ipxe-xcat 2.0.0: the firmware does
fetch the shim over IPv6 from the option this code sends, the shim chains to
snponly.efi, and iPXE then reports "No configuration methods succeeded" on a
network whose only DHCP server is DHCPv6. iPXE never reaches the script.

The option stays, because it is what xCAT owes a client that asks, and the node
fails at the same point without it. The comment now records what the loader
cannot do, so the next reader does not repeat the strings test.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 17:44:32 -03:00
Daniel Hilst adeb938962 fix(xnba): the kernel and initrd URLs of an IPv6 node lose their server
The previous commit replaced !myipfn! with the facing address, which fixed the
kernel command line. It left the eleven other places where setstate writes
${next-server} into the script directly, among them the imgfetch lines for the
kernel and the initial ramdisk. An IPv6 node resolved those to
"http:///tftpboot/..." and had no server to fetch its kernel from.

Measured on an IPv6-only alma10.1 node: the script carried
"http://[2001:db8:149::1]:80/install/..." for the command line and
"http://${next-server}/tftpboot/.../vmlinuz" for the kernel.

The server is now computed once in setstate and used at every site, so the
whole script names one server. An IPv4 node still gets ${next-server}, which
iPXE fills from its own offer.

netboot_ipxe_method.t and secureboot_ipxe_node_shim.t load xnba.pm against a
stub of xCAT::NetworkUtils. The stub gains the two methods setstate now calls,
and both tests describe their nodes as IPv4, which keeps ${next-server}.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 17:26:26 -03:00
Daniel Hilst 7514b931b3 fix(xnba): an IPv6 node loses the server from every URL in its iPXE script
xnba.pm writes ${next-server} in place of !myipfn! and lets iPXE fill it from
the DHCP offer. next-server is a DHCPv4 field, so an IPv6 node resolves it to
the empty string and every URL in the script loses its host. The fallback does
not help either: my_ip_facing resolves with inet_aton, so it reports an
IPv6-only node unresolvable.

The script now carries the facing address of the management node when the node
has an IPv6 address, bracketed because the script puts it in a URL. The lookup
names the family, the way grub2.pm does. An IPv4 node keeps ${next-server}, so
nothing changes for it.

ipxe.pm runs this code with SCRIPTS and METHOD set to its own, so the change
reaches netboot=ipxe as well as netboot=xnba.

xnba.pm also calls xCAT::NetworkUtils eight times without loading it, and works
only because another module does. The use is now explicit.

Captured by xCAT-test/unit/ipxe_script_server.t. Ignoring the family fails five
of its seven assertions and leaves the two IPv4 ones passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 16:59:24 -03:00
Daniel Hilst 25720c77a7 feat(dhcp): an ipxe node gets no boot file over DHCPv6
dhcp6_bootfile_url_for_node writes RFC 5970 option 59 for grub2 alone, so a node
with netboot=ipxe takes its reserved IPv6 address and has nothing to load. Its
firmware then releases the address and solicits again. grub2 was the only
loader an IPv6 node could use.

The iPXE build xCAT ships does speak DHCPv6: snponly.efi, the UEFI loader of
ipxe-xcat 2.0.0, carries dhcpv6, ipv6 and four IPv6 strings, against a control
of 26 iPXE and dhcp strings in the same binary. The firmware that solicits over
DHCPv6 is UEFI, so the UEFI loader is the only one such a client can ask for.

An ipxe node now gets tftp://<bracketed server>/<UEFI loader>, and the loader
name comes from BootPolicy->x86_loader, which is the one place it is chosen. No
URL is written when that file is not on disk, because naming a file the TFTP
server does not have costs the client a timeout it cannot diagnose; the Kea
client classes already refuse it for the same reason.

xnba keeps its exclusion. Its loader reports one ipv6 string against a control
of five, where the iPXE loader reports five against 26, so there is no evidence
it reads option 59.

Captured by xCAT-test/unit/dhcp_dhcpv6_duid.t. Removing ipxe from the gate fails
the first assertion; removing the on-disk check fails the second.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 16:55:47 -03:00
Daniel Hilst 77eaf4d53c fix(ipv6): a diskless node has an address and no route
mknetboot gave an IPv6-only node ip=either6, which asks dracut for DHCPv6.
DHCPv6 assigns one address with a prefix length of 128 and carries no route, and
an xCAT provision network sends no router advertisement: radvd is not installed
and net.ipv6.conf.<nic>.forwarding is 0. The node came up with the address and
no way to reach the server, and the dracut hook reported
"Connecting to [2001:db8:147::1]:80... failed: Network is unreachable."

debian.pm now builds the static form from the address, gateway and prefix the
node already has in the database, the way sles.pm passes hostip and gateway to
linuxrc. either6 remains the answer when the address cannot be resolved.

Captured by xCAT-test/unit/dracut_static_ip6.t. Removing the prefix length from
the parameter fails four of its nine assertions and leaves the bracketing and
the refusal cases passing.

Measured on an IPv6-only Ubuntu 24.04 node: Kea records prefix_len=128 for its
lease, and dracut logged BOUND6 for eth0 before the fetch failed.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 15:27:53 -03:00
Daniel Hilst ddaad73ab4 fix(grub2): a ppc node is given linuxefi when its image carries it
grub2_kernel_commands read the image and not the architecture, so a ppc node
whose grub2 image carries linuxefi was given it. linuxefi loads an EFI binary
and a ppc loader is not one. The previous commit removed the architecture test
along with the defect it carried.

The command now needs both: the architecture whose loader is an EFI binary, and
an image that carries the command.

grub2_netboot_protocol.t covers the three architectures and caught this. Its
loader fixture now records the commands it carries, because the configuration
follows the image.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 15:27:53 -03:00
Daniel Hilst 89b9213e4d Merge pull request #7977 from VersatusHPC/fix/boot-node-template
fix(boot): stop unsupported node-template keys from looping
2026-10-29 15:00:28 -03:00
Daniel Hilst 075e6801e9 fix(grub2): an x86 node stops at the menu with "can't find command `linuxefi'"
setstate in grub2.pm appends "efi" to the kernel and initrd commands for every
node whose architecture matches x86, so the configuration reads linuxefi and
initrdefi. Both come from a downstream patch. grub2-xcat 2.12-2 for Ubuntu is
built from upstream grub and carries neither, so the node loads the loader and
its own configuration over TFTP, prints "can't find command `linuxefi'", asks
for no kernel, and waits at the menu until it is powered off.

The pair now comes from the image served to the node. BootUtils reads the
image, which records the name of every command its modules register, and
answers linuxefi and initrdefi only when the image carries them. An image that
cannot be read is answered with linux and initrd, which every grub2 image
carries.

This reaches a node only when it netboots with grub2. An IPv6 node has no other
loader, because bootfile-url is written for grub2 alone.

Measured on an IPv6-only Ubuntu 24.04 node: with linuxefi the node made no TFTP
request for the kernel; with linux it loaded the kernel and the initial ramdisk
and printed no error.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:45:34 -03:00
Daniel Hilst e3429791c6 fix(xcat-core): getpostscript serves a node's postscripts to a password or token login
With nodeauthentication off and no peer name, getpostscript used
_xcat_authname as the client identity and expanded it with noderange.
becomeuser and tokens set _xcat_authname to an account name, so a user
named after a node group received the postscripts of the first node in
that group.

xcatd now records the CN of the validated client certificate as
_xcat_certname, and only while no becomeuser or token replaced it. It
deletes any _xcat_certname the client sent. getpostscript uses that
name only when it names exactly one node, with no group or range
expansion. _xcat_authname is no longer a candidate.

getpostscript_client_identity.t drives the plugin with these requests.
On the previous head the group and node login checks fail, and
dropping the exact match fails the group and range checks.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:41:25 -03:00
Daniel Hilst 582fd157f2 fix(ipv6): an IPv6-only Ubuntu diskless node gets a DHCPv4 initrd
The Ubuntu diskless kernel command line carries no dracut ip= parameter. dracut then
configures the interface it needs with DHCPv4, so an IPv6-only node comes up with no
global address, cannot fetch imgurl and never mounts a root.

gen_net_boot_params now returns ip6 beside the ip it already derived, spelled either6,
which asks dracut for DHCPv6 and falls back to router advertisement. debian.pm appends
it for a node that xCAT::NetworkUtils::node_is_ipv6_only reports as IPv6-only, so an
IPv4 node is told exactly what it was told before. The ip the EL path reads is
unchanged.

Captured by xCAT-test/unit/networkutils_dracut_ipv6_boot_param.t. This closes the
derivation; the Ubuntu diskless path is not yet proven end to end on a cluster.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 09:09:23 -03:00
Daniel Hilst 9f5d9be84f fix(sles): the installer of an IPv6-only node configures IPv4 and reaches nothing
sles.pm gave linuxrc no network arguments beyond the net device. linuxrc
configures IPv4 by default, so an IPv6-only node sent an IPv4 DHCPDISCOVER,
received "no/incomplete answer", and reported "Failed to download AutoYaST
file" without ever contacting the install source.

static_ipv6_boot_args() adds ipv6only=1 with the address, prefix, gateway and
IPv6 nameserver of the node. The node is configured statically for the reason
anaconda.pm configures EL statically: the firmware answers DHCPv6 with the
RFC 6355 DUID-UUID that the reservation is keyed on, while the installer builds
a DUID of its own that matches no reservation.

Measured on a Leap 15.6 node: with these arguments the installer fetched
control.xml from http://[2001:db8:156::1]:80/install/leap15.6/x86_64/1 from its
own address 2001:db8:156::10. Without ipv6only=1 linuxrc ignores the rest and
stays on IPv4.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 13:24:43 -03:00
Daniel Hilst 60d0176d14 fix(dhcp): no range6 is written for an IPv6 subnet that has a dynamic range
addnet6 read the dynamic range from $netcfgs{$net}, where $net is the subnet it
writes, "2001:db8:156::/64". addrangedetection stores the range under
networks.net, "2001:db8:156::", so the lookup always missed and makedhcp warned
"No dynamic range specified" for a network whose row declares one.

The subnet then carried no range6, and a DHCPv6 client whose DUID matches no
reservation received no address. The SUSE installer is such a client: linuxrc
builds its own DUID rather than the DUID-UUID the firmware sends, so it could
not get an address even though the node has a reservation for the same MAC.

dynamic_range_for() looks the range up under the subnet as written and then
under the network address alone.

xCAT-test/unit/dhcp_dhcpv6_conf_file.t fails its prefix-form assertion when the
second lookup is removed.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 12:40:44 -03:00
Daniel Hilst c7139d062c fix(grub2): an IPv6 facing address is substituted bare into the install URL
grub2.pm replaced !myipfn! with the facing address as it stands. sles.pm and
anaconda.pm put that placeholder where a URI authority expects a host, with the
port already appended, so an IPv6-only node was told to install from
"http://2001:db8:156::1:80/install/...". Nothing can split that into an address
and a port, so the installer could not reach the repository.

substitute_facing_address() brackets a placeholder that a port follows and
leaves every other one bare, because xcatd=!myipfn! names a host with no port
and the postscripts read that value as it stands.

The other five plugins that substitute the placeholder serve BIOS PXE, ppc64le
and yaboot, none of which network boots over IPv6, so they keep the bare
replacement.

grub2_ipv6.t and sles_install_url_ipv6.t fail their bracketing assertions when
the port-aware branch is removed, and their bare-address assertions still pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 10:46:39 -03:00
Daniel Hilst a701dfc206 fix(sles): an IPv6 install server is not bracketed in the install URLs
sles.pm built its install URLs as "$server:$port". An IPv6 address contains
colons, so a node was told to install from
"http://2001:db8:156::1:80/install/leap15.6/x86_64/1" and could not reach the
repository. The same join was in the statelite and stateless imgurl=. The XCAT=
argument beside them was already bracketed.

rootimg_url() and autoyast_boot_args() now build those URLs through
xCAT::NetworkUtils::uri_authority(), which brackets an IPv6 address and passes a
name or a !myipfn! placeholder through unchanged. uri_authority is the former
xcatd_cmdline_address, renamed because three URL sites now share it;
xcatd_cmdline_address stays as a wrapper for its own callers.

xCAT-test/unit/sles_install_url_ipv6.t fails its four IPv6 assertions when the
colon join is restored.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 10:21:32 -03:00
Daniel Hilst c59021e408 fix(dhcp): no DHCPv6 configuration is written on openSUSE
ISC serves DHCPv4 and DHCPv6 from two files in the same directory. dhcp.pm set
the v6 file inside the branch that switches the v4 file to /etc/dhcp/dhcpd.conf.
openSUSE already has /etc/dhcpd.conf, so the branch never ran, $dhcp6conffile
stayed undef, and makedhcp wrote no IPv6 configuration. dhcpd6 then exited with
"No subnet6 declaration for eth1" and no node could get an IPv6 lease.

dhcp6_conf_file_for() now returns the v6 file that belongs beside a given v4
file, and the module derives it after every branch that chooses the v4 file.

xCAT-test/unit/dhcp_dhcpv6_conf_file.t fails on the openSUSE and /etc/dhcp3
layouts when the derivation is restricted to /etc/dhcp again.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 09:46:30 -03:00
Daniel Hilst b0b542468c fix(debian): the Ubuntu live installer cannot install over IPv6, and said nothing
With a boot configuration written, an IPv6-only node reached the live installer and
could only PXE-loop. casper configures the interface with klibc ipconfig and mounts
the root with klibc nfsmount, and neither knows IPv6: measured on noble, the
ipconfig in the casper initrd carries no IPv6 string at all, and nfsmount answers
"need a path" for both "[2001:db8::1]:/export" and "2001:db8::1:/export".

subiquity_boot_params now refuses a node with no IPv4 address and says why. The
caller already reports the message and skips the node. A node with an IPv4 address
is unaffected.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 06:39:15 -03:00
Daniel Hilst 2b8f026182 fix(grub2): nodeset writes no configuration for an IPv6-only node
nodeset refused the node and named the wrong reason:

    Error: The <node> can not be resolved
    Error: Failed to generate grub2 configurations for some node(s)

The node resolves: it has an IPv6 address and no IPv4 one. setstate resolved the
!myipfn! placeholder with my_ip_facing, which resolves its argument with inet_aton
and so reports any IPv6-only node unresolvable.

The lookup now follows the address family of the node, as the tftpserver lookup in
the same file already does. A node with an IPv4 address keeps the lookup it had.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 06:39:15 -03:00
Daniel Hilst a91d0f783d fix(kvm): a KVM node cannot ask for EFI without Secure Boot
vm.othersettings firmware: accepted only efi, which leaves Secure Boot to libvirt
firmware autoselection. Autoselection picks a descriptor by host policy, so on a
host whose best match enrolls keys the guest refuses an unsigned boot loader:

    NBP file downloaded successfully.
    BdsDxe: failed to load Boot0004 "UEFI PXEv6" : Access Denied

That decides whether a node can network boot over IPv6. A DHCPv6 bootfile-url is
written for a grub2 node alone, and the grub2 image under /tftpboot/boot/grub2 is
built with grub2-mkimage and is not signed, so a node with Secure Boot enforced
cannot start it and falls through to the next boot entry.

firmware: now also takes efi-secureboot and efi-insecure, and build_xmldesc adds
the <firmware> element that states the request. enrolled-keys follows secure-boot
because libvirt refuses a guest whose keys are enrolled while Secure Boot is off.
XML::Simple writes the firmware attribute of <os> and the element has the same
name, so the element is added to the rendered XML rather than to the hash.

firmware:efi keeps its behaviour and adds no element.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 06:23:08 -03:00
Daniel Hilst e375c064ce fix(dhcp): a node cannot netboot over DHCPv6 with the ISC backend
makedhcp wrote no boot file into a DHCPv6 reservation, so the firmware took the
reserved address and had nothing to load. EDK2 reported "PXE-E21: Remote boot
cancelled" and tried the next boot entry, which reads as a DHCP failure although
the address was granted. Measured on openEuler 24.03: dhcpd6.conf carried no
bootfile reference where the DHCPv4 configuration carried fifteen.

addnode6 now emits option dhcp6.bootfile-url, which is RFC 5970 option 59, from
the same helpers the Kea backend uses. Those two helpers read noderes and
BootPolicy, not Kea, so they lose their kea_ prefix.

Two further defects kept the same node from booting. The DHCPv6 daemon was never
started: ISC runs it as a second service, the flag that recorded the need was
assigned and never read, restart_dhcpd restarted only the DHCPv4 service, and the
service map had no ISC DHCPv6 name. And makedhcp failed with "The file
/etc/sysconfig/dhcpd6 doesn't exist" although no EL or openEuler dhcp package
ships that file and dhcpd6 does not need it: with the file deleted the daemon
still binds the provisioning NIC, because ISC dhcpd listens only on the
interfaces its subnet declarations name.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 02:41:54 -03:00
Daniel Hilst 7ab3628353 fix(xcat-core): an IPv6 server is unreadable in the netboot kernel command line
root=nfs:, XCAT=, xcatd= and imgurl=http:// all separate the server from what follows with a
colon, so an IPv6 address in any of them cannot be told from the path or the port. Eight sites
built those values by interpolation, and a diskless, statelite or cloned node of any family took
a command line its initrd could not parse.

build_statelite_nfsroot_parameter brackets the server, which covers the NFS root of all three
netboot plugins at once. debian.pm and sles.pm now build the XCAT endpoint and the image URL
through xcatd_cmdline_address and format_host_port, as anaconda.pm already did for the install
path, and the mksysclone endpoint of anaconda.pm and sles.pm goes the same way.

destiny.pm had a third xcatd= site. The earlier change covered the two genesis branches and left
the legacy nbk branch interpolating the address.

nfs_root_options.t asserts the bracketed form, the IPv4 form and the mount options after a
bracketed address. Removing the brackets fails 2 of its 80 assertions and leaves the IPv4 and the
name cases passing.

zvm.pm carries the same pattern and is left alone: z/VM has no IPv6 netboot path to test it on.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 01:23:24 -03:00
Daniel Hilst 3030ee7995 fix(xcat-core): a statelite and a cloned node ask DHCPv6 for an address no reservation holds
mknetboot excluded a statelite node from the static IPv6 address with no reason recorded, and
mksysclone had no IPv6 code at all. Both reach the same dracut networking as a diskless node, so
both asked DHCPv6 with the identifier their initrd generates. A reservation matches one
identifier, so the node took a pool address and no boot URL.

Statelite now takes the same path as diskless, and mksysclone renders the address beside the
Genesis kernel it boots.

anaconda_ipv6_statelite_sysclone.t drives both commands against a SQLite fixture. Restoring the
statelite guard fails one of its six assertions and removing the mksysclone block fails another,
while the diskless assertion survives both, so the gate did not move for diskless.

debian.pm records why the Ubuntu live filesystem is mounted over IPv4. The comment blamed casper,
which passes nfsroot= through untouched; klibc nfsmount is what cannot read an IPv6 server.
Measured on noble: "[2001:db8::1]:/export" and "2001:db8::1:/export" both answer "need a path",
while "192.0.2.1:/export" is accepted.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 01:01:51 -03:00
Daniel Hilst 18de00c7b4 fix(xcat-core): an openEuler node asks DHCPv6 for an address no reservation holds
The static IPv6 boot path was gated on is_el10_os, which tests the basename against
rh|centos|alma|rocky|ol and the major version against 10 exactly. openEuler reaches the same
kickstart and dracut code through #KICKSTARTNET#, but the predicate answered 0 for it, so an
openEuler node fell to "dhcp --device=X --noipv4 --ipv6=dhcp". Its installer then sent the DUID
that NetworkManager generates, which matches no reservation, and the node took a pool address.

The same equality left a later EL release on the DHCPv6 path for no reason.

SvrUtils::uses_static_ipv6_boot names the capability instead of a version: openEuler of any
release, and EL from 10 upwards. The three gates in Template.pm and anaconda.pm read it, and the
variable that carried the answer is no longer called el10_ipv6_only. is_el10_os keeps its own
tests and its one remaining meaning.

anaconda_ipv6_rendering.t asserts the predicate per family. Removing the openEuler arm fails 2
of its 38 assertions and leaves 36 passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 14:39:14 -03:00
Daniel Hilst 4509c4bb5d fix(xcat-core): the ISC path got no IPv6 reverse zone, and the Kea test passed under JSON::PP
getzonesfornet in dhcp.pm rounded the prefix itself and passed the rounded value beside a
network that still carried its own. getIPv6PrefixLength prefers the embedded prefix, so the
rounded value was ignored and no reverse zone was written at all: dhcpd updated no PTR record
for a /62 or /126 network and reported nothing. The ddns.pm copy stripped the prefix first and
was unaffected, so the previous commit's claim that both copies were fixed was wrong.

The zones now come from xCAT::NetworkUtils::getIPv6ReverseZones, which both copies call. A
network whose prefix is not a multiple of 4 is covered by the zones of the next nibble -- a /62
by its four /64 zones -- which is what the IPv4 arm does with a /22. Rounding down to the /60
made xCAT answer for three networks it does not own.

kea_subnet_id_numeric.t only observes the encoding under the XS backend, and passed 6 of 6
under JSON::PP with the bug in place. It skips unless JSON->backend is the XS one, and the
workflow installs libjson-xs-perl so the backend is there.

dhcp6_boot_server now reports a substituted boot server, so an unresolvable tftpserver is not
silent, and the caller reports a warning that arrives with a server. The routine also moved
below grub2_node_loader, whose comment it had separated from it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 11:38:48 -03:00
Daniel Hilst dc8c5cefed fix(xcat-core): Genesis sends a DUID the reservation does not hold, and makedns aborts on a /62
Both Genesis images built a DUID-UUID from the nil SMBIOS UUID. makedhcp refuses that UUID,
because nodeimport writes it to every PowerKVM node, and reserves the hardware address instead,
so the client sent an identifier no reservation held and the node took a pool address with no
boot file. genesis-duid and doxcat now keep the DUID-LL for it, which is what Kea reads the
hardware address out of.

getzonesfornet died on an IPv6 prefix that is not a multiple of 4, which took makedns and
makedhcp with it for a /62 or a /126 network. A reverse zone is delegated on a nibble, so the
prefix is rounded down and the enclosing zone is returned. Both copies of the routine are fixed.

The test suite needs socat and jq, and five bats files skipped without them, so the workflow
installs both. Template.pm drops the unused _is_el10, credentials.pm drops a repeated import,
and two comments that recorded bug history are cut to the fact the code cannot show.

Reverting any one fix fails named assertions: 1 of 8 and 1 of 3 bats cases for the two Genesis
images, and 4 of 30 in ddns_ipv6.t, which traps the abort so the file still reports.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 10:20:52 -03:00
Daniel Hilst 2811c2761d fix(xcat-core): the byte-order warning cannot be silenced, and a delete keeps one family
makedhcp reported a vpd.uuid that looks byte-swapped for duid=firmware and duid=canonical as
well as for a node with no duid attribute. Setting duid is the remedy the message names, so the
message could not be silenced except by a literal DUID. The check reads the version field, which
also reports a UUID that does not follow RFC 4122. It is now reported only for a node with no
duid attribute, and makedhcp.8 says so.

delnode removed only the lines of the family of the address it was given. A node whose address
changed from IPv4 to IPv6 kept its old A record, and makedhcp then wrote a DHCPv4 reservation
with a boot file for a node whose only address was IPv6. The family filter stays on the update
path, which is what keeps both records of a dual-stack node.

dhcp_dhcpv6_duid.t asserts that each duid value silences the report and that the default still
makes it. makehosts_dual_stack.t asserts a family change followed by a delete. Reverting either
fix fails exactly one assertion in each file.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 10:12:58 -03:00
Daniel Hilst b667e759db fix(xcat-core): makedhcp fails on a dual-stack grub2 node
kea_boot_server6_for_node resolved the tftpserver of the node as IPv6 and reported
an error when it got no answer. A dual-stack node keeps an IPv4 tftpserver, which
has no IPv6 address, so makedhcp exited non-zero for the whole command and the
DHCPv6 reservation lost its boot URL.

xCAT::DHCP::BootPolicy->dhcp6_boot_server now chooses the server: a configured
value that resolves, else the management node address that faces the node, which
is what <xcatmaster> already does. When neither resolves, the node gets a warning
and keeps its reservation, because the node still boots over IPv4.

xCAT-test/unit/dhcp6_boot_server.t asserts the choice. Removal of the fallback
fails 3 of its 12 assertions and leaves 9 passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 02:01:33 -03:00
Daniel Hilst 33373cbc32 fix(makehosts): writing one address of a dual-stack node deletes the other
A node with an A line and an AAAA line in /etc/hosts under one name loses one of them.
Running makehosts for a node whose hosts.ip is IPv4 left only the IPv4 line. A second
line under the same name is the only way to give a node both records through
/etc/hosts and makedns.

_host_line_index_values records node names for any line whose first field looks like an
address, IPv6 included, and addnode overwrites the first match and blanks every other
one. Driving the plugin with 192.0.2.10 node01 and 2001:db8::10 node01 returned both
line indexes for the IPv4 address, so the IPv6 line was blanked.

A node name now matches only lines of the family being written. The reason the index
records node names at all, so a node that changes address does not leave a second
entry, is unchanged and is asserted per family. An unparsable first field counts as the
same family, so a legacy entry keeps the behaviour it had.

makehosts_dual_stack.t fails 6 of its 9 assertions without the family check; the three
that pass include an unknown node matching no line.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 21:02:23 -03:00
Daniel Hilst b49ff5aaec Merge remote-tracking branch 'origin/fix/ipv6-duid-collisions' into feat/ipv6 2026-10-26 17:56:24 -03:00
Daniel Hilst 6cdc48b595 fix(xcat-core): nothing reports a vpd.uuid left in the old byte order
Before this work xCAT stored vpd.uuid with its first three fields swapped for
nodes from Genesis discovery and for KVM guests from mkvm, clonevm and rscan.
vpd.uuid now holds the UUID that the operating system reports, and no row is
migrated. makedhcp swaps such a row a second time, so the DUID it reserves the
address for is the canonical order of the real UUID, which no client sends. The
node then gets no lease and makedhcp reports nothing. Until now the problem was
only described in makedhcp.8.pod.

A row cannot be rewritten, because nothing tells which spelling it holds. So
makedhcp reports instead. The new dhcp6_uuid_looks_byte_swapped reads the RFC
4122 version field: a swap of the first three fields moves it from the first
nibble of the third field to the third nibble, and moves nothing else. A value
whose version is valid only in the swapped position is therefore a row to look
at. dhcp6_client_duid returns the message as a third value, and addnode6 and
kea_node_reservations6 report it once for the node. Neither changes the value or
the reservation.

What the check cannot know: a swap leaves a valid version in the first field
about half the time, so it misses those rows. It also cannot read the UUID that
the node holds, so a node with a non-conformant firmware UUID can be reported
for nothing.

dhcp_dhcpv6_duid.t adds node cn10 and a block that holds down the detection, the
double swap, and the remedy the message gives. Reading the swapped version from
nibble 15 instead of 14 fails exactly the four assertions that name the report,
and leaves green the five that hold the limits of the check and the four that
hold the DUID values.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 17:43:36 -03:00
Daniel Hilst 587bbaabb3 fix(xcat-core): every PowerKVM node from nodeimport gets the same DHCPv6 DUID
nodeimport writes '00000000-0000-0000-0000-000000000000' to vpd.uuid for every
PowerKVM node it creates (profilednodes.pm). That value is 32 valid hexadecimal
digits, so kea_duid_from_uuid builds a DUID from it and returns
00:04:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 for all of them. makedhcp
then keeps the reservation of the node it wrote last and reports nothing.

kea_duid_from_uuid now refuses the nil UUID, which it reads through the new
dhcp6_uuid_is_placeholder. A node whose vpd.uuid is the nil UUID is treated like
a node with no vpd.uuid: with Kea DHCP the reservation falls back to the MAC
address of the node, and with ISC DHCP addnode6 skips the node and names the
reason. addnode6 carries a third message for the nil UUID, because the existing
'vpd.uuid is not a UUID.' is false for a value of the right form.

The all-f UUID is left alone. Nothing in the tree writes it, and RFC 4122 names
only the nil UUID.

dhcp_dhcpv6_duid.t adds node cn09 and a block for two PowerKVM nodes. Dropping
the one new line from kea_duid_from_uuid fails 15 assertions, among them 'two
nodes with the nil vpd.uuid keep one reservation each', while the three
neighbours that hold the limits of the check stay green.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 17:43:20 -03:00
Daniel Hilst 40178d4f08 fix(xcat-core): esx.pm writes vpd.uuid with two opposite conventions
vpd.uuid holds the UUID that the guest operating system reports, and makedhcp derives the
DHCPv6 DUID of a node from it. esx.pm uses two opposite conventions for the same column. The
clone callback stores config.uuid unchanged, while mkvm and rinv swap the first three fields.
One of the two is always wrong, so a VMware guest gets a dynamicrange address with no
bootfile-url and does not boot over IPv6, and rinv prints a UUID the guest does not report.

Neither convention is right on its own. VMware writes uuid.bios into the SMBIOS type 1
structure unencoded and only the version of the entry point changes. Measured on ESXi 7.0.3,
8.0.3 and 9.1.0: EFI firmware gives SMBIOS 2.7 at every hardware version, and BIOS firmware
gives 2.4 up to hardware version 11 and 2.7 from hardware version 12. A 2.7 guest reports the
first three fields swapped, and a 2.4 guest reports them unchanged.

xCAT::VMCommon::esx_guest_uuid takes the UUID, config.firmware and config.version and returns
the UUID on the other side. inv and clone_task_callback read both properties from the VM view.
build_cfgspec learns them from the firmware and virtualHW.version keys of vm.othersettings,
which xCAT::VMCommon::esx_vmx_settings now passes to vSphere as fields of the
VirtualMachineConfigSpec, because extraConfig does not apply them.

xCAT-test/unit/esx_vm_uuid.t pins every row of the measurement with literal UUID strings, and
the DUID that kea_duid_from_uuid then derives for a UEFI guest against the DUID that its
firmware sent. A mutation that drops the SMBIOS 2.4 branch fails the 6 assertions that name a
BIOS guest at hardware version 8 or 11 and leaves the other 56 passing. A mutation that stops
converting an EFI guest fails the 24 assertions that name one and leaves 38 passing.

No ESXi host exists in the lab, so the change is not validated end to end.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 17:40:41 -03:00
Daniel Hilst 8924cb43de fix(xcat-core): bracket an IPv6 master in the xcatd= kernel argument
xCAT::NetworkUtils::xcatd_cmdline_address brackets an address that holds a colon, as
RFC 3986 does, and leaves an IPv4 address or a hostname unchanged. destiny.pm builds
the xcatd= argument through it, and doxcat reads the bracketed form with bash
parameter expansion, keeping the awk split for the unbracketed case so an existing
node parses exactly as before. The Genesis payload needs no extra command for this.

Two mutations, each failing only the side it names. Reverting doxcat to the plain awk
split fails 3 of the 5 bats cases, the three bracketed ones, and leaves the IPv4 and
the default-port cases passing and the unit test green. Removing the bracketing from
the routine fails 4 of the 8 unit assertions, the IPv6 ones, and leaves IPv4,
hostname, empty and undefined passing and the bats file green.

destiny.pm itself is not unit tested: it is an xcatd plugin, so no in-process test can
load it. The two call sites are one-line substitutions visible in the diff.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 17:07:51 -03:00
Vinícius Ferrão 8f81a34a3e fix(kvm): resolve the default machine type before converting a UUID
The UUID conversion of mkvm, clonevm, rinv and rscan used the machine
type that the domain XML names. A domain that names none, or names an
alias such as pc, gets the default machine type of the hypervisor:
pc-i440fx-2.1 on QEMU 2.1 and pc-i440fx-rhel7.1.0 on the qemu-kvm of
RHEL 7.1. Its guest then reported a swapped UUID that the plugin did
not expect.

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

(cherry picked from commit f3b47fcca98ca75c123615433df38d3642d2c5d4)
(cherry picked from commit 1e830adaa9)
2026-10-26 15:27:22 -03:00