2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-12-04 08:07:04 +00:00
Commit Graph

29770 Commits

Author SHA1 Message Date
Robert Externbrink cfeee7a03a Add inlet pole and overcurrent protector readings to genpdu rvitals 2026-11-23 14:27:13 +01:00
Daniel Hilst b1cdbf15fd Merge pull request #7998 from VersatusHPC/feat/ipv6
feat(ipv6): IPv6-only provisioning of management and compute nodes
2026-11-13 17:14:58 -03:00
Daniel Hilst 7431bdeafa fix(xcat-test): updatenode_syncfile_MERGE locks every login out of an enforcing node
The case saves /etc/passwd, /etc/group and /etc/shadow on the compute
node to /tmp, and puts them back with mv -f. mv keeps the tmp_t label
of the copy in /tmp. On a node that runs SELinux enforcing, sshd then
cannot read /etc/shadow, so every later xdsh to the node fails. On the
el9 and el10 CI cells about sixty later cases failed for this reason.

Put the files back with cp -f, which keeps the label of the file in
/etc.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 20903fce1c)
(cherry picked from commit 7d8af9ecc8a6b3701ff1b8ae482c57b9493d2b17)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2.20.0
2026-11-12 23:42:49 -03:00
Daniel Hilst e26793b19c fix(xcat-test): the SELinux suite requires an enforcing compute node
selinux_cn_diskful_enforcing provisions a diskful compute node with
SELinux enforcing and expects no xCAT denial on it. The SELinux support
covers the management node only: xcatd runs in xcat_t and the image
build in xcat_image_t, and no policy is shipped for a compute node.
The case therefore cannot pass, and its failure reads as a defect in
the management-node policy.

Remove the case from testcase/selinux/cases1 and from selinux.bundle.
selinux_bundle.t still passes: every remaining case is in a bundle.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 3c254f221a)
(cherry picked from commit f85106929cc94872d0e9cdc02b735f5387f45615)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-12 23:42:49 -03:00
Daniel Hilst 1361288dd2 fix(xcat-core): the Ubuntu 26.04 netboot node cannot fetch its root or name itself
With the initramfs network fixed, xcatroot still printed "Failed to
download image". It then failed name resolution, and the booted node
called itself localhost, so the postscripts did not identify it.

Under initramfs-tools the kernel arguments reached xcatroot as
variables, and dhclient wrote resolv.conf and set the hostname. Under
systemd, dracut-initqueue runs xcatroot without the arguments, and
systemd-networkd keeps DNS and the hostname in its lease files. The
image also links resolv.conf to the systemd-resolved stub, which does
not resolve a short name, and the copy of resolv.conf went through
that link.

xcatroot now reads the arguments with getarg, writes resolv.conf from
the lease when it names no server, replaces the stub link in the new
root, and writes the hostname from the lease when the image has none.
xcatroot_rootimg_checksum.bats fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 426a522879f380979d026d22798f4072c285cd2e)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-12 23:42:48 -03:00
Daniel Hilst 3afa5cca80 test(xcat-core): the Ubuntu 26.04 netboot node cannot fetch its root or name itself
Five cases in xcatroot_rootimg_checksum.bats run the Ubuntu xcatroot
as a systemd initial ramdisk runs it:

- with imgurl, XCAT and rootimgchecksum only on the kernel command
  line, not in the environment;
- with the DNS servers and domain only in the systemd-networkd lease;
- with an image whose resolv.conf links to the systemd-resolved stub;
- with an image whose hostname file is empty.

Three of them fail on this tree. The other two check that a
resolv.conf and a hostname which are already set are kept.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit e221262d91de99299341d0ca35248c9360dab342)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-12 23:42:48 -03:00
Daniel Hilst 0933429e85 fix(xcat-core): the Ubuntu 26.04 netboot initramfs never gets a lease
On Ubuntu 26.04 a stateless node fetches kernel and initrd and then
enters dracut emergency mode. Kea sees no DHCP from the initramfs and
httpd sees no request for rootimg.cpio.gz.

systemd-network-generator turns BOOTIF= into 70-BOOTIF.network with no
DHCP setting. That file exists, so dracut's networkd-config.sh does not
install its DHCP default, and the boot NIC stays unconfigured. Also,
xcat-cmdline.sh wrote its finished condition to /initqueue-finished
and /lib/dracut/hooks, which dracut 110 does not read. With an empty
initqueue/finished, dracut-initqueue ends before networkd-run.sh calls
the online hook and /sbin/netroot.

The module now installs a drop-in that sets DHCP=ipv4 for
70-BOOTIF.network, and xcat-cmdline.sh writes the finished condition
to $hookdir/initqueue/finished. ubuntu_netboot_initqueue.bats fails
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 29cfd1c0182631e2f91c1a37be7b34860f80742a)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-12 23:42:48 -03:00
Daniel Hilst 9273a68368 test(xcat-core): the Ubuntu 26.04 netboot initramfs never gets a lease
ubuntu_netboot_initqueue.bats captures two defects in the Ubuntu dracut
module. The boot NIC gets no DHCPv4 lease, because nothing turns on
DHCP for the 70-BOOTIF.network file that systemd-network-generator
writes from BOOTIF=. And xcat-cmdline.sh writes its finished condition
outside $hookdir, so dracut-initqueue ends before the settled hook
that fetches the root runs. Both new cases fail on this tree.

imgutils_ubuntu_dracut_module.t now also checks the inst_simple
sources of the install script.

ubuntu_netboot_root_handler.bats sourced the online hook from sh. On
an Ubuntu host sh is dash, whose "." passes no arguments, so two cases
failed there. The initramfs sh is bash, so the cases now use bash.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 22cf6d78573f3df38c5d395dde4f50fc5c7a3640)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-12 23:42:48 -03:00
Daniel Hilst a3351a2b73 fix(xcat-core): bmcsetup reports failed for a dotted-decimal BMC IPv6 address
An IPv6 address can end in dotted decimal (RFC 4291). ipmitool and
BMCUtils accept 2001:db8:1::192.0.2.20, but ipv6_expand allowed only
hexadecimal digits and colons. bmc_has_address then failed before it read
the BMC, and an OpenBMC reported installstatus failed.

ipv6_expand now converts a dotted-decimal tail into two hexadecimal
groups before it expands the address. It rejects an octet above 255.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-12 12:21:14 -03:00
Daniel Hilst ae2ccc8188 test(xcat-core): bmcsetup reports failed for a dotted-decimal BMC IPv6 address
An IPv6 address can end in dotted decimal: 2001:db8:1::192.0.2.20 and
2001:db8:1::c000:214 are the same address. ipmitool and BMCUtils accept
the dotted form, but ipv6_expand in bmcsetup rejects the dots, so an
OpenBMC configured with that spelling reports installstatus failed.

The new cases check the final OpenBMC status for both spellings, in both
directions, and for a different address. The first case fails on the
current bmcsetup.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-12 12:21:14 -03:00
Daniel Hilst 1ea3ddc8d5 fix(xcat-core): bmcsetup compares BMC addresses as text
An OpenBMC node can report "failed" after its IPv6 address is set
correctly, and "bmcready" when the BMC has a different address.

bmc_has_address in bmcsetup searches the whole lan6 print output for
the configured text. One IPv6 address has many spellings, so
"2001:0db8:0001::0020" does not match "2001:db8:1::20". A substring
match also accepts "2001:db8:1::20" for "2001:db8:1::2". The IPv4 check
has the same substring defect.

bmc_has_address now reads each "Address:" entry of lan6 print and
compares it with the configured address after ipv6_expand writes both
as eight zero-padded lowercase groups without the prefix length.
ipv6_expand uses only bash. The IPv4 check compares the complete
"IP Address" field.

The new tests in genesis_bmcsetup_users.bats fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-11 15:46:57 -03:00
Daniel Hilst df7fb2816c fix(xcat-core): test that bmcsetup compares BMC addresses as text
An OpenBMC node can report "failed" after its IPv6 address is set
correctly, and "bmcready" when the BMC has a different address.
bmc_has_address in bmcsetup searches the lan6 print output for the
configured text, so a different spelling of the same address does not
match, and "2001:db8:1::2" matches "2001:db8:1::20".

The new tests give the BMC equivalent spellings (zero-padded and
compressed, upper and lower case, with and without a prefix length),
and different addresses that share a text prefix, for IPv6 and IPv4.
They fail on this commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-11 15:46:57 -03:00
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 9e744d398b fix(xcat-core): test that 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.

The new test starts a credential listener on ::1 and on 127.0.0.1 and
calls ok_with_node and process_request in frusetter.pm against it. The
IPv6 tests fail on this commit. The IPv4 tests pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 17:55:13 -03:00
Daniel Hilst 9eacb22dff fix(xcat-core): bmcsetup reports BMC status to an invalid IPv6 host
On an IPv6 cluster, bmcsetup in Genesis sends the bmcready status to
"[2001" instead of the management node. An OpenBMC node also reports
"failed" after its IPv6 address is set correctly.

bmcsetup reads the xcatd= kernel argument again and splits it on the
first colon. For "[2001:db8::1]:3001" this gives "[2001", and bmcsetup
writes it over the XCATMASTER that doxcat exported. updateflag.awk and
allowcred.awk then get an invalid host. The OpenBMC check reads the
address back with "lan print", which shows only IPv4 parameters.

bmcsetup now reads a bracketed xcatd= value as doxcat does. The new
bmc_has_address reads an IPv6 address back with "lan6 print" on the LAN
channel, and an IPv4 address as before.

The IPv6 status tests in genesis_bmcsetup_users.bats fail without this
change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 17:38:11 -03:00
Daniel Hilst d2b97cc17b fix(xcat-core): test that bmcsetup reports BMC status to an invalid IPv6 host
On an IPv6 cluster, bmcsetup in Genesis sends the bmcready status to
"[2001" instead of the management node. An OpenBMC node also reports
"failed" after its IPv6 address is set correctly.

The new tests run bmcsetup with xcatd=[2001:db8::1]:3001 on the kernel
command line and XCATMASTER in the environment, as doxcat starts it.
They record the host that updateflag.awk and allowcred.awk receive. The
OpenBMC tests supply the lan6 print output of the BMC. The IPv6 tests
fail on this commit. The IPv4 tests pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 17:38:11 -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 4b293bfa66 fix(xcat-core): test that 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, so getipmi retries and
bmcsetup never configures the BMC.

The new test starts a credential listener on ::1 and on 127.0.0.1 and
calls ok_with_node and process_request in bmcconfig.pm against it. The
IPv6 tests fail on this commit. The IPv4 tests pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 17:37:09 -03:00
Daniel Hilst 8cd641f09a fix(xcat-core): the Genesis credential listener ignores the doxcat master
On an IPv6 cluster, xcatd cannot confirm a credential request from a
Genesis node, so the node gets no certificate. getcert and bmcsetup
start allowcred.awk with the environment that doxcat exports.

allowcred.awk selects the listener family from MASTER_IP or MASTER.
doxcat exports neither. It exports XCATMASTER, so the listener is
always IPv4 and the IPv6 callback from xcatd gets no answer.

The Genesis allowcred.awk now reads XCATMASTER first. MASTER_IP and
MASTER stay as fallbacks.

The tests in ipv6_genesis_awk_inet6.bats that use the doxcat
environment fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 17:35:23 -03:00
Daniel Hilst cfbc953a32 fix(xcat-core): test that the Genesis credential listener ignores the doxcat master
On an IPv6 cluster, getcert and bmcsetup in Genesis start allowcred.awk
with the environment that doxcat exports. doxcat exports XCATMASTER.
allowcred.awk reads only MASTER_IP and MASTER, so it opens an IPv4
listener. xcatd calls back over IPv6, gets no answer and issues no
certificate.

The existing tests set MASTER_IP, so they do not see this failure.

The new tests start the Genesis allowcred.awk with only XCATMASTER,
XCATPORT and XCATDEST set, as doxcat does, and connect over the family
of that address. The IPv6 test fails on this commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 17:35:23 -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 c84048cd7a fix(xcat-core): the DHCPv6 DUID test expects no boot file for an unknown client
dhcp_dhcpv6_duid.t fails 5 checks on Kea. A client without a
reservation gets the iPXE loader, and the test expects no bootfile-url.

The test is stale. 69737e20f gave each IPv6 network Kea client classes,
so that an unknown UEFI x86_64 client gets the iPXE loader and can start
sequential discovery. kea_client_classes6 adds that class only when the
loader is in site.tftpdir. The GitHub runner installs the loader, so the
pool clients of the test get it. The unit suite failed before this file
ran on every push since then, so no run reported the change.

The test now sets site.tftpdir to a private directory that holds the
loader, and expects the loader for the Kea clients without a
reservation. The ISC checks do not change, because the ISC backend has
no such class. The result no longer depends on the files of the host.

On a tree before 69737e20f the new checks fail, 5 of 64. On the current
tree they pass, with and without the loader in /tftpboot.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 09:31:37 -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 62c8622f0f test(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 installer logged "No carrier
detected" and stopped in the dracut emergency shell.

The test expects rd.net.timeout.carrier=120 in the static IPv6 boot
arguments of the EL and openEuler installer. It fails before the fix.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:25:36 -03:00
Daniel Hilst cd27d21e13 fix(xcat-core): the Genesis bats sandbox stops a slow run after 20 s
run_genesis stops the Genesis script after 20 s. On a riscv64 host,
tests 2 and 3 of genesis_secondary_dhcp6_order.bats take about 34 s
each, so they fail with exit 124 although the script is correct.

The cap is now 120 s, and GENESIS_SANDBOX_TIMEOUT overrides it. With
GENESIS_SANDBOX_TIMEOUT=10 on x86_64, tests 2 and 3 fail with exit
124, which is the failure seen on riscv64.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:24:57 -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 331a1dd87b test(xcat-core): makehosts keeps the old line of a node moved to IPv6
After chdef <node> ip=<IPv6> and makehosts <node>, /etc/hosts holds the
old IPv4 line and the new IPv6 line of the node. node_address_family
answers 4, and nodeset renders an IPv4 install with no warning.

The test runs makehosts with and without a noderange on a node that
changed family, and on a dual-stack node, whose two lines must stay.
The three family-change assertions fail before the fix. The dual-stack
and makehosts -m assertions pass before and after it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:22:56 -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 b5d6bd6e9c test(xcat-core): an IPv6-only Ubuntu diskless node gets no address in the initrd
grub2 adds BOOTIF= to the kernel command line of every node. On Ubuntu
26.04, systemd-network-generator then writes 70-BOOTIF.network with no
address. It drops an ip= that names no interface, and a file for a named
interface sorts after 70-BOOTIF.network. debian.pm gives the static ip=
an empty interface when the node has no installnic or primarynic.

The test drives static_ip6_boot_arg with the net_params of the caller.
It expects rd.bootif=0 on every static ip=, and ifname=xcatboot0:<mac>
when the node has no installnic. 5 of its 9 assertions fail before the
fix.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:21:24 -03:00
Daniel Hilst b5300555a6 fix(xcat-core): an installed KVM node sends a DUID its reservation does not hold
With mac.duid=canonical or firmware, an installed KVM guest whose
domain an earlier mkvm defined sends a DHCPv6 client identifier that
its reservation does not hold.

makedhcp applies the policy to vpd.uuid. configdhcpv6duid applied it to
product_uuid of the node. In such a guest product_uuid is the byte swap
of vpd.uuid, so the script wrote the other UUID order.

mypostscript now exports vpd.uuid as VPDUUID, and configdhcpv6duid
applies the policy to it. The script reads product_uuid only when
VPDUUID holds no UUID.

postscript_dhcpv6_duid.bats asserts the DUID for each policy with a
swapped product_uuid, and the VPDUUID export. The tests fail without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:19:09 -03:00
Daniel Hilst d91dc332d9 test(xcat-core): an installed KVM node sends a DUID its reservation does not hold
makedhcp applies the firmware and canonical policies of mac.duid to
vpd.uuid. configdhcpv6duid applies them to product_uuid of the node. A
KVM domain that an earlier mkvm defined holds the byte swap of
vpd.uuid, so in that guest product_uuid is the swap. With duid=canonical
the installed DHCPv6 client then sends the firmware order, and matches
no reservation.

postscript_dhcpv6_duid.bats gives the script a vpd.uuid in VPDUUID and
a product_uuid that is its swap, and asserts the DUID that makedhcp
reserves for each policy. It also asserts that mypostscript exports
VPDUUID. The five tests fail on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:19:00 -03:00
Daniel Hilst b62fd4cc8a test(xcat-core): genesis_openembedded_duid.t fails on a second enabled unit
genesis_openembedded_duid.t fails in the unit suite. The
xcat-genesis-network recipe enables xcat-genesis-duid.service and
xcat-genesis-bootnic.service, and the test matched SYSTEMD_SERVICE
against a list that holds the first unit alone.

The test now reads SYSTEMD_SERVICE as a list and asserts that it holds
xcat-genesis-duid.service. With that unit removed from the recipe the
assertion fails, and with the recipe as it is the test passes.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:18:28 -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
Daniel Hilst 1607dff88e Merge pull request #8023 from VersatusHPC/fix/updatenode-merge-relabels-shadow
fix(xcat-test): updatenode_syncfile_MERGE locks every login out of an enforcing node
2026-11-09 18:17:55 -03:00
Daniel Hilst 83487a52d3 test(xcat-core): a KVM node reserves its IPv6 address for the order iPXE sends
mkvm now gives the libvirt domain the UUID that the guest reports as
vpd.uuid, through xCAT::KVMUtils::guest_uuid. The firmware of the guest
then sends the byte swap of vpd.uuid, as a physical node does.
dhcp6_firmware_uuid_order still answers canonical for mgt=kvm, because
it was written for the earlier mkvm that swapped the UUID. So makedhcp
reserves the address of a KVM node for the DUID that iPXE sends, and
the firmware, Genesis and the installed node match no address.

dhcp_dhcpv6_duid.t now asserts that a kvm node holds its address on
the byte-swapped order, as a node xCAT does not define does. The
assertion fails on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:16:57 -03:00
Vinícius Ferrão fd65b1e704 fix(kvm): swap the UUID for pc-q35-2.1 and pc-i440fx-utopic
pc-q35-2.1 and the Ubuntu pc-i440fx-utopic store the UUID bytes
unencoded behind an SMBIOS 2.8 entry point, as pc-i440fx-2.1 does, so
their guest reports the domain UUID with the first three fields
swapped. guest_uuid kept the UUID unchanged for them, so mkvm and
clonevm gave the guest a UUID that differed from vpd.uuid, and rinv and
rscan reported the domain UUID.

guest_uuid now swaps the UUID for both machine types. Only QEMU 2.1 to
2.6 provide pc-q35-2.1. pc-i440fx-utopic is the default machine type of
Ubuntu 14.10, and the QEMU of Ubuntu 16.04 keeps it with the 2.1
settings. The QEMU of Ubuntu 15.04 and 15.10 defines it with current
settings, so a guest there reports the UUID unchanged. pc-q35-2.0 uses
SMBIOS 2.4 tables and keeps the UUID unchanged.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:11:01 -03:00
Daniel Hilst 316d463fe3 Merge pull request #8022 from VersatusHPC/fix/selinux-cn-diskful-case-out-of-scope
fix(xcat-test): the SELinux suite requires an enforcing compute node
2026-11-09 18:08:43 -03:00
Daniel Hilst 71c726b32f fix(xcat-core): Ubuntu genimage leaves the online hook out of the dracut module
On Ubuntu 26.04 genimage stops with "dracut[F]: Cannot install a hook
(.../97xcat/xcat-online.sh) that does not exist". install.netboot hooks
xcat-online.sh, but stage_dracut_module does not copy it into 97xcat, so
the stateless image gets no initrd and the node never boots.

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit ed9a23ba7b203cb3aff6583e07455172be6f2394)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 17:59:02 -03:00