2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-23 19:02:17 +00:00

7468 Commits

Author SHA1 Message Date
Daniel Hilst 0dba03fc8e fix(xcat-core): rewritemyfru rejects a node that asks over IPv6
rewritemyfru answers "Unable to prove root on your IP approves of this
request" to a node on an IPv6 cluster, so the FRU of the node is not
rewritten.

ok_with_node in frusetter.pm opens the credential callback with
IO::Socket::INET, which cannot connect to an IPv6 address.

ok_with_node now opens the socket with
xCAT::NetworkUtils::open_tcp_socket, as bmcconfig.pm does. The
challenge and the expected answer do not change.

The IPv6 tests in frusetter_ipv6_callback.t fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 17:55:20 -03:00
Daniel Hilst a8b81b7f76 fix(xcat-core): getbmcconfig rejects a node that asks over IPv6
getbmcconfig answers "Unable to prove root on your IP approves of this
request" to a Genesis node on an IPv6 cluster. getipmi then retries
without end, and bmcsetup never configures the BMC.

ok_with_node in bmcconfig.pm opens the credential callback with
IO::Socket::INET, which cannot connect to an IPv6 address.

ok_with_node now opens the socket with
xCAT::NetworkUtils::open_tcp_socket, which uses IO::Socket::INET6 and
keeps IO::Socket::INET as the fallback. The challenge and the expected
answer do not change.

The IPv6 tests in bmcconfig_ipv6_callback.t fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 17:37:09 -03:00
Daniel Hilst 2eb12d2c27 fix(xcat-core): a BMC cannot be given an IPv6 address
When ipmi.bmc is an IPv6 address, bmcconfig finds no network for it and
Genesis leaves the BMC unconfigured. bmcsetup only writes IPv4 LAN
parameters.

bmc_net_params now accepts an IPv6 address, or a name that resolves only
to one, and returns the prefix length, the gateway and the prefix of the
networks row that contains it. bmcconfig sends the prefix as
routerprefix. bmcsetup writes the address with "ipmitool lan6 set
static_addr" and, when there is a gateway, a static router. A name with
an IPv4 address keeps the IPv4 setup.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 14:19:50 -03:00
Daniel Hilst 75ac4fb8ef fix(xcat-core): test that a BMC cannot be given an IPv6 address
bmcconfig finds the netmask and gateway of a BMC with inet_aton and a
dotted-quad match, so a BMC with an IPv6 address gets no network and
Genesis does not configure it. bmcsetup only writes IPv4 LAN parameters.

Move the network lookup of net_parms into xCAT::BMCUtils::bmc_net_params,
with the IPv4 behaviour unchanged, so a unit test can call it. Add tests
for the IPv4 and IPv6 results of the lookup, and bats tests for the lan6
commands that bmcsetup must issue. The IPv6 tests fail on this commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 14:19:35 -03:00
Daniel Hilst 2c462a5941 fix(xcat-core): a static ip= install boot fails on a slow link
xCAT does not set rd.net.timeout.carrier. dracut does not retry a static
ip= configuration that found no carrier. On a port whose link came up
46 s after the driver loaded, the EL and openEuler installer logged "No
carrier detected" and stopped in the dracut emergency shell.

_el10_static_ipv6_boot_args now adds rd.net.timeout.carrier=120. dracut
waits only while the boot interface has no carrier. The static IPv4
path of managedaddressmode=static and the Ubuntu diskless path do not
get the argument.

anaconda_ipv6_rendering.t fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:25:42 -03:00
Daniel Hilst 150d820300 fix(xcat-core): makehosts keeps the old line of a node moved to IPv6
After chdef <node> ip=<IPv6> and makehosts <node>, /etc/hosts held the
old IPv4 line and the new IPv6 line of the node. node_address_family
answers 4 for such a node, so nodeset rendered ip=dhcp and an IPv4
kickstart with no warning.

addnode matches a node name only against lines of the family it writes,
which keeps both lines of a dual-stack node. When makehosts writes
hosts.ip and the node has no line of that family, the address moved to
the other family. addnode now replaces the old line in that case. A
node with a line of each family keeps both, and makehosts -m is
unchanged. ipv6_provisioning.rst says how to move a dual-stack node to
IPv6 only.

makehosts_family_change.t fails 3 of 6 assertions without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:23:29 -03:00
Daniel Hilst adb686f3a0 fix(xcat-core): an IPv6-only Ubuntu diskless node gets no address in the initrd
On Ubuntu 26.04 an IPv6-only diskless node boots with no address and
cannot fetch its root image. grub2 adds BOOTIF= to every node, and
systemd-network-generator turns it into 70-BOOTIF.network with no
address. The generator drops an ip= that names no interface, and the
file for a named interface sorts after 70-BOOTIF.network. debian.pm
gave the static ip= an empty interface when the node had no installnic
or primarynic.

static_ip6_boot_arg now takes the net_params hash. It adds rd.bootif=0,
so the generator writes no 70-BOOTIF.network, and it names the
interface xcatboot0 through ifname=<name>:<mac> when the node has no
installnic, as the EL path does. The DHCP=ipv4 drop-in for
70-BOOTIF.network then has no file to apply to on an IPv6 node. An
IPv4 node is unchanged.

debian_static_ip6_gateway.t fails 5 of 9 assertions without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:22:27 -03:00
Daniel Hilst 74ba342c29 fix(xcat-core): a KVM node reserves its IPv6 address for the order iPXE sends
A KVM guest that mkvm defines gets no reserved IPv6 address for its
firmware, its Genesis image or its installed system. The address is
reserved for the DUID that iPXE sends.

dhcp6_firmware_uuid_order answered canonical for mgt=kvm. That was
true while getNodeUUID wrote the byte swap of vpd.uuid into the domain.
The carried kvm fixes make mkvm write the UUID that the guest reports
as vpd.uuid, so the firmware of the guest sends the byte swap of
vpd.uuid, as a physical node does.

dhcp6_client_duid now uses the firmware order for every node that sets
no duid attribute, as the mac.duid schema text states. The
dhcp6_firmware_uuid_order sub, its test and the nodehm read in
dhcp6_client_duids are removed. Comments that described the old mkvm
now describe a domain that an earlier mkvm defined.

dhcp_dhcpv6_duid.t asserts that a kvm node holds its address on the
byte-swapped order. It fails without this change.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ddns_ipv6_records.t holds each case down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:52:40 -03:00
Daniel Hilst 81bf21c55e Merge remote-tracking branch 'origin/fix/nodediscover-ipv6-node-and-nic' into releases/2.20.0-rc9 2026-11-08 13:00:05 -03:00
Daniel Hilst 8f0d4e5e84 fix(xcat-core): sequential discovery cannot name a node reached over IPv6
process_request gated the MAC record on inet_aton($node), which answers for
IPv4 only, so a node whose only address is IPv6 was refused with "Can not
resolve IP for the matching node". update_discovery_data runs after that return,
so no discoverydata row was written, no mac was set and makedhcp never ran.
Measured on xcat88-mn: discoverydata empty after a full seq_discovery_ipv6 run.

It then matched each NIC behind a dotted-quad pattern. The Genesis image sends
address=${ipv4_address:-$ipv6_address}, so over IPv6 the NIC record carries the
v6 address, the branch was skipped, $localnic stayed 0 and the node was reported
as not on the deploy network.

The node is now resolved once with getipaddr and accepted by
discovery_address_usable, and the network of a NIC comes from nic_network_key,
which masks IPv6 by bits so a prefix that is not a whole number of bytes keys
correctly. An IPv6 NIC takes its hostname tag from hosttag_for_ipv6_nic:
gethosttag reads an A record and my_if_netmap, which is netstat -rn and prints
IPv4 routes only, so it cannot answer for one.

The IPv4 path is untouched. nic_network_key keeps the arithmetic the caller used,
gethosttag is still asked for an IPv4 NIC, and each test holds an IPv4 case down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 12:59:53 -03:00
Daniel Hilst 225f8882fa Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:19:41 -03:00
Daniel Hilst 0e9e723a23 fix(xcat-core): a node found by sequential discovery gets no DHCPv6 reservation
findme assigned a node and recorded its MAC, its address, its BMC, its position,
its groups and its chain, and never recorded the UUID the request carries.
dhcp6_client_duids builds the DHCPv6 identity of a node from vpd.uuid, so
makedhcp fell back to a DUID-LL derived from the MAC. None of the three boot
stages sends a DUID-LL, so the reservation matched nothing and the node kept an
address from the pool, which xcatd cannot map back to it. The node is discovered
and then cannot be provisioned at the address it was given.

findme now records the UUID through xCAT::DiscoveryUtils::vpd_attribs_from_findme,
which takes the SMBIOS form only. The OpenEmbedded image synthesises
"<machine type>-<serial>-<first mac>" when the firmware reports no product_uuid,
and a DUID built from that string would match no client either.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:19:28 -03:00
Daniel Hilst 673d4727bb Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:08:50 -03:00
Daniel Hilst 2151865bb1 fix(xcat-core): the per-network iPXE boot script has no host over IPv6
mknb wrote http://${next-server} into every URL of the per-network boot scripts
under xcat/ipxe/nets. DHCPv4 fills next-server from the siaddr of the offer.
DHCPv6 has no next-server option, so iPXE leaves the variable empty and an
unknown IPv6 client fetches from a URL with no host. That script is the only one
carrying destiny=discover, so sequential discovery over IPv6 could not start even
once a client class named the script.

ipxe_script_http_base returns the address of the management node facing the
network for an IPv6 network, and keeps ${next-server} for IPv4, so the DHCPv4
scripts are written exactly as before. mknb uses it for the gpxe and the UEFI
scripts of the x86 loaders.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:08:35 -03:00
Daniel Hilst 282adefda5 Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:03:12 -03:00
Daniel Hilst a8d482cdb1 fix(xcat-core): an unknown DHCPv6 client is handed the shim twice
kea_client_classes6 built one class per client architecture, each naming the
signed iPXE shim. That answers the firmware. The shim starts iPXE, which
solicits again carrying the iPXE user class, and a client xCAT has never seen
matches no per-node class: its only match is the same architecture class, so it
is given the shim again and never fetches a kernel. The Genesis image never
runs, no findme reaches xcatd, and sequential discovery over IPv6 cannot start.
The DHCPv4 side has carried this second stage for years in
kea_xnba_network_classes, keyed on option 93.

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:02:56 -03:00
Daniel Hilst d0957a5695 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:48:58 -03:00
Daniel Hilst 0e45012264 fix(xcat-core): choose the UUID byte order of a DUID from the node, not the platform
The implementation for 596450159, which committed only its test.

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:48:54 -03:00
Daniel Hilst 267e996ed7 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:17:48 -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 4303f85640 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:11:18 -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 e2495c4811 Merge feat/ipv6 into releases/2.20.0-rc9
Comment-only: the reason a DUID byte order cannot name a boot stage.
2026-11-08 01:19:16 -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 970cf0fde1 Merge feat/ipv6 into releases/2.20.0-rc9
Carries the DHCPv6 boot-stage split on option 15. The firmware and the iPXE it loads send the
same vpd.uuid in two byte orders, and which client sends which order depends on the platform, so
the reservation of a chainloading node can no longer name a boot file.
2026-11-08 01:11:34 -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 a5a8c5444c Merge feat/ipv6 into releases/2.20.0-rc9
Carries the imgserver fallback: it chose the address with my_ip_facing, which is
IPv4 only, so an IPv6-only node with no noderes.tftpserver was sent to fetch its
image from an address it has no route to.
2026-11-07 19:54:01 -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 279e4de1f2 Merge feat/ipv6 into releases/2.20.0-rc9
Carries the xcatd= address family: destiny.pm chose the address with
my_ip_facing, which is IPv4 only, so an IPv6-only node fetched its Genesis
payload over IPv6 and was told to report to xcatd over IPv4.
2026-11-07 19:38:41 -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 bd696e7689 Merge feat/ipv6 into releases/2.20.0-rc9
Carries the DHCPv6 boot-file gap: a client with no reservation was answered
with an address and no option 59, so a node being discovered over IPv6 had
nothing to boot and sequential discovery could not start.
2026-11-07 19:17:03 -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 590437c812 merge(xcat-core): take feat/ipv6 into releases/2.20.0-rc8
xcat2/xcat-core#7998. Three files carry a semantic conflict, and all three take
the master side.

perl-xCAT/xCAT/KVMUtils.pm and xCAT-server/lib/xcat/plugins/kvm.pm keep master's
firmware_features and add_firmware_features. The two firmware APIs are mutually
exclusive, and the branch's with_firmware_features and secure_boot_request were a
second solution to one defect: a node that asks for firmware:efi states nothing,
so libvirt selects a firmware in its own order, and that order puts a Secure Boot
descriptor with enrolled keys first. xcat2/xcat-core#7973 fixes the same defect on
master's API, is approved, and is in this candidate, so the branch side is dropped
rather than carried beside it.

xCAT-test/unit/kvm_firmware_secureboot.t is removed with them. It calls
with_firmware_features and secure_boot_request, which no longer exist.
xCAT-test/unit/kvm_secureboot_firmware.t covers the surviving API.

xCAT-test/xcattest keeps master's xCAT::Test::Conf path. The branch routed conf
parsing through xCAT::Test::OS to quote a value carrying shell syntax, which the
IPv6 cells need for vmothersetting, and master already does this:
chdef_command quotes what the parser returns. xCAT::Test::OS stays in the tree and
xCAT-test/unit/xcattest_object_quoting.t still exercises it directly.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 08:15:29 -03:00
Daniel Hilst be809100d4 Merge pull request #8012 from VersatusHPC/fix/ipmi-sdr-record-count
fix(ipmi): read the SDR record count as one 16-bit value
2026-11-07 07:37:39 -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
Vinícius Ferrão 944ac3f6e9 fix(install): keep custom partition files out of the install log
pre.rhels8 and pre.rhels10 print /tmp/partitionfile into the
pre-install log, so that the partition scheme can be inspected after
the installation. A custom partitionfile can hold credentials, such as
the --passphrase of an encrypted partition or a boot loader --password,
and the log then holds them in clear text. With site.xcatdebugmode 1 or
2, %pre also traces the decoding of a custom partitionfile or partition
script, and the trace spells out every decoded byte.

The pre-install log now shows the partition scheme only when xCAT
generated it, and says that a custom partition file is not logged. The
decoding of a custom partitionfile or partition script runs untraced.
/tmp/partitionfile, which anaconda reads, is unchanged.
2026-11-06 23:10:32 -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 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