selinux_cn_diskless_disabled_by_design named three boot-configuration paths and
none of them is the iPXE node script, so the case failed on every cell whose
compute node is netboot=ipxe.
selinux_cn_diskless_disabled_by_design looks for the boot configuration of the
compute node in three places: the xnba node directory, pxelinux.cfg by node
name, and petitboot. A node with netboot=ipxe has its script in
/tftpboot/xcat/ipxe/nodes/<node>.uefi instead, which the list does not name, so
the case reports
BOOTCFG-BAD: the node has no boot configuration
BOOTCFG-BAD: no boot configuration carries selinux=0
and fails on every iPXE cell. xcat54-cn of el10-x86_64-devel is netboot=ipxe, so
build 78 of xcat-test-el10-x86_64 failed there after its other checks passed:
the node reported SELinux disabled and the case still could not confirm the flag
reached the boot configuration.
Both path lists now name the iPXE script, the UEFI one first, which is the file
a UEFI client fetches. nodeset/ipxe_secureboot_shim.sh already reads that path.
The paths stay absolute, so the check still fails when no boot configuration
carries selinux=0.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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.
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>
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.
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>
destiny.pm chooses the address for the xcatd= kernel argument with my_ip_facing,
which resolves the peer with OnlyV4. An IPv6-only node shares the link with the
management node, so that call succeeds and answers with the IPv4 address.
Measured on xcat88-mn, whose compute node holds only 2001:db8:188::20:
imgfetch -n kernel http://[2001:db8:188::1]/tftpboot/xcat/genesis.kernel.x86_64
imgargs kernel ... xcatd=192.168.88.1:3001 destiny=shell
The payload is fetched over IPv6 and the node is then told to report over IPv4.
An IPv4 pool on the same network hid this. Without one the node holds no IPv4
address, so Genesis cannot reach xcatd and discovery never completes.
genesis_xcatd_address_family.t asserts that the resolver picks the family from
the node, that a resolver error travels rather than becoming a false address,
and that an IPv6 literal is bracketed in the argument. Five of its seven
assertions fail without the fix.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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.
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>
Sequential discovery over IPv6 starts with a node xCAT has never seen. It has
no DUID in the dhcp6duid table, so kea_node_reservations6 writes no reservation
for it, and option 59 (bootfile-url) is written only inside a reservation. The
subnet carries a dynamicrange, so Kea answers the node with an address and no
boot file.
Measured on xcat88-mn: an unknown client took 2001:db8:188::1000 from the pool,
and the running kea-dhcp6.conf held no client-classes at all.
dhcp6_boot_client_classes.t asserts that render_dhcp6_config carries
client-classes, that _render_subnet6 scopes a class to its subnet, and that the
class builder names a loader per architecture from option 61. Without the fix
10 of its 11 assertions fail.
dhcp_kea_plugin_intent.t gains four assertions on the wiring: that
kea_subnet6_intent carries the classes and evaluates them only for its own
subnet. Emptying the class list in kea_subnet6_intent fails those four and no
other test in the file.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Brings the upstream merges of #7973 (feat/secureboot-ipxe) and #7974
(fix/buildrpms-lock-recovery). Both branches' content was already carried on
rc8, so this records the upstream lineage and changes no file.
xCAT-buildkit, xCAT-client, xCAT-test and xCAT-vlan each hold two %else
in the pod converter BuildRequires block, so rpmbuild -bs stops with
"%else after %else" and the EL core build fails for every architecture
before it can index a repository.
The feat/ipv6 merge produced the structure. Both sides rewrite the same
%if block, master as "%if 0%{?suse_version}" and feat/ipv6 as the
inverted "%if !0%{?suse_version}", and they touch different lines, so
git merged both bodies without a conflict.
This change keeps master's form and removes the second branch. The two
branches ask for the same package on the same condition, so no
BuildRequires changes.
spec_conditional_nesting.t reports all four files before this change and
none after.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
rpmbuild rejects a spec that holds two %else in one conditional, and
nothing in the tree checked for it. A merge where both sides rewrite the
same %if block can produce that structure with no git conflict, so the
fault reaches a build host instead of a test.
spec_conditional_nesting.t reads every *.spec in the tree and tracks the
%if / %else / %elif / %endif nesting in Perl. It reports a second %else,
an %elif after %else, a directive with no open conditional, and an
unterminated conditional. A probe at the end of the file confirms the
check itself reports a second %else.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An Ubuntu 26.04 diskless node freezes in the initial ramdisk at 1.78 s with
'Failed to isolate default target: Unit rescue.service not found'. genimage writes an
exclusive dracutmodules list, dracut 110 drops 35network-legacy, so 11systemd-networkd is
selected, 80base then makes systemd the init, and the list names neither systemd-initrd nor
dracut-systemd, so there is no default target. rh/genimage already names those three for
dracut 105 and later.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An Ubuntu 26.04 diskless compute node boots the netboot image and stops at
systemd[1]: Failed to isolate default target: Unit rescue.service not found.
systemd[1]: Freezing execution.
1.78 seconds into the kernel, which is the initial ramdisk and not the root
image. imgutils::dracut_netboot_modules returns "xcat nfs base network
kernel-modules" when the image holds no network-legacy module, and dracut
reads that list as the whole module set. dracut-ng, which resolute ships as
dracut 110, has no network-legacy module, so 40network selects
systemd-networkd, which depends on the systemd module. The base module
installs the shell /init only when systemd is out, so /init becomes systemd,
and the list names no systemd-initrd, so there is no initrd.target. systemd
falls back to rescue.target, whose rescue.service is also absent.
Name systemd, systemd-initrd and dracut-systemd as well, each one only when
the image holds it, and only for an image whose dracut has no network-legacy
module. The EL genimage names the same three for dracut 107 on el10. noble
keeps network-legacy and its dracut.conf does not change, so the 24.04 lists
that 9c311c894 gave dracut still build the ramdisk they build today.
xCAT-test/unit/imgutils_dracut_netboot_modules.t fails three of six
assertions without this commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An Ubuntu 26.04 diskless node freezes in the initial ramdisk:
systemd[1]: Failed to isolate default target: Unit rescue.service not found.
systemd[1]: Freezing execution.
The netboot dracut.conf names an exclusive module list, "xcat nfs base
network kernel-modules". dracut-ng, which resolute ships as dracut 110,
removed the network-legacy module, so 40network selects systemd-networkd,
which depends on the systemd module. The base module then skips the shell
/init, and systemd becomes /init. The list names neither systemd-initrd nor
dracut-systemd, so the initial ramdisk holds no initrd.target.
Move the list into imgutils::dracut_netboot_modules, which takes the image
module directory and returns the list, and call it from both dracut.conf
writes in the Ubuntu genimage. The new
xCAT-test/unit/imgutils_dracut_netboot_modules.t holds the noble list down
and asks for the systemd modules on a dracut that has no network-legacy.
Three of its six assertions fail on this commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The case asserted rc == 0 on a grep -rhl over three per-node bootloader paths. GNU grep exits 2 for a file it cannot open and keeps that status even when it matched elsewhere, so only one bootloader writes a file per node and the case could never pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
firmware_features returned no feature for a node whose vm.othersettings says
firmware:efi, so the domain stated nothing about Secure Boot. libvirt then runs
firmware autoselection and takes the descriptor of highest priority that fits
the guest. The descriptors are ordered by file name, and the first x86_64 one of
an EL 10 host is 30-edk2-ovmf-x64-sb-enrolled.json, so the node starts with
Secure Boot on and with keys enrolled. The firmware then refuses the unsigned
kernel the node netboots. The same node boots on a host whose first descriptor
is 50-edk2-ovmf-x64-nosb.json, because the order is host policy.
firmware_features now returns the secure-boot feature disabled for a UEFI guest
that does not ask for Secure Boot, which is the requirement libvirt filters the
descriptors by. It says nothing about enrolled-keys, which only a firmware with
secure-boot reads. A guest with no firmware still asks for no feature, because
libvirt refuses a <firmware> feature where no firmware autoselection runs.
kvm_secureboot_firmware.t covers both, and its four new checks fail without
this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node with vm.othersettings firmware:efi asks for UEFI and states nothing
about Secure Boot. libvirt then picks the firmware descriptor of highest
priority that fits the guest. On an EL 10 host the first x86_64 descriptor is
30-edk2-ovmf-x64-sb-enrolled.json, so that node starts with Secure Boot on and
with keys enrolled, and the firmware refuses its unsigned kernel. The same node
boots on another host, because descriptor priority is host policy.
The checks say firmware_features returns the secure-boot feature disabled for a
node that asks for UEFI alone, and no feature at all for a BIOS node, where
libvirt reads no feature.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
rinstall prints "Failed to run 'nodeset' against the node: <node>" and returns
1, while nodeset against the same node exits 0 and reports no error. rinstall
returns before rnetboot and rpower, so the node is never powered on and every
provisioning case waits for a machine that nobody booted.
xCAT::Utils::runxcmd returns $::RUNCMD_RC. runxcmd_output ORs the errorcode of
each response into that global, and xCAT::Utils::runcmd and the service helpers
assign their own exit status to it, so the last command of any plugin in the
subrequest replaces the result. makedhcp supplies that command: its ISC branch
restarts dhcpd6 whenever /etc/dhcp/dhcpd6.conf is absent or written by another
program, which is every run of a cluster with no IPv6 network, and the restart
fails with no subnet to serve. A Kea cell restarts kea-dhcp6 only for a run
that has DHCPv6 work, so only ISC cells fail.
runxcmd now collects the errorcodes in $::xcmd_errorcode and assigns that to
$::RUNCMD_RC after the subrequest, so a command of the subrequest can neither
set nor clear the result. dhcp6_restart_needed restarts dhcpd6 only for a run
that serves an IPv6 network.
runxcmd_subrequest_errorcode.t and dhcp_isc_dhcp6_restart.t fail on the parent
commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
The rendered post.rhels8, run in a sandbox with a fixture sysfs, must turn
on the PCI NICs with link, a USB Ethernet adapter with its own driver,
and a NIC with no sysfs entry, and leave a cdc_ether NIC with link down.
When only the cdc_ether NIC has link, it must fall back to the
connections active in the installer.
post.rhels8 turns on every NIC that has link during the installation.
The USB NIC of a BMC host interface always has link, so the installed
node starts DHCP on it at boot, gets no lease, and
NetworkManager-wait-online fails.
post.rhels8 now skips NICs bound to a USB class driver: cdc_ether,
cdc_ncm, cdc_eem or rndis_host, which Linux binds to the USB gadget of a
BMC. USB Ethernet adapters with their own driver, the other NICs with
link, and NICs without a sysfs entry come up as before.
Run the rendered %post --nochroot blocks of each kickstart template
whose %pre writes /tmp/pre-install.log the way anaconda runs them: in
the installer, with its own /tmp and the installed system at
/mnt/sysimage. Each run must append the log to a new or an existing
xcat.log. The riscv64 profile test now keeps the installer's /tmp out
of the installed root too. Both fail on the old templates, whose chroot
%post reads a /tmp that does not hold the log.
Run the new test in the profile artifact job.
The EL8 and later kickstart templates append /tmp/pre-install.log to
/var/log/xcat/xcat.log in the chroot %post. Anaconda runs that block in
the installed system, whose /tmp does not hold the installer's log, so
the %pre output, such as the install disk and the partition layout,
never reaches the node's xcat.log.
Copy the log in a %post --nochroot block before the main %post, from
the installer's /tmp to the installed system at /mnt/sysimage. The EL6
and EL7 templates use %include for this and are unchanged.
Render the rhels9 and rhels10 kickstarts with no partitionfile, a custom
partitionfile and a custom partition script, each with xcatdebugmode 0,
1 and 2, and run %pre in a sandbox. The custom input holds credentials
in the =, separated, quoted, escaped and split option forms, a boot
loader password and a root password. The pre-install log must show the
generated partition scheme, or a notice for custom input, with neither a
credential nor a traced decoded byte of the custom input, and anaconda
must still get the custom partition definitions.
Run the new test in the profile artifact job.
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.
Each kickstart template with #SELINUXRELABEL#, rendered for an enforcing
node and run in a sandbox through its downloaded postscript, must call
restorecon once, after the postscript ran and post.rhels8 or post.rhels10
disabled the vendor repository. A disabled node must get no relabel.
The riscv64 profile test runs every rendered %post block as if it ran in
the installed system. Anaconda runs a --nochroot block in the installer,
with the installed system at /mnt/sysimage, so give such a block that
view.
post.rhels8 and post.rhels10 end with exit 0. The kickstart templates
include them inline in the %post script, so the exit ends that script
before #SELINUXRELABEL#, and restorecon never runs on an enforcing or
permissive node.
Both scripts now end with their last command, so the templates reach
the relabel after the xCAT post scripts wrote their files.
The stateless xcatroot of dracut_047, run in a chroot with NetworkManager
leases of the dhclient and internal clients in the initrd, must copy
both into the root under their own names. CI now runs the xcatroot test
as root.
xcatroot passes the DHCP lease of the initrd to the root image only from
/tmp/dhclient.*.lease, which the old dracut network scripts write. An
initrd that runs NetworkManager keeps its lease in /var/lib/NetworkManager.
The NetworkManager of the root takes over the same connection, finds no
lease and starts again with DHCPDISCOVER while the address stays on the
interface. A DHCP server that does not answer in time makes
NetworkManager-wait-online fail, and when the DHCP timeout expires
NetworkManager removes the address from the boot interface.
xcatroot now also copies the NetworkManager leases, so the root renews
the lease of the initrd with a DHCPREQUEST. Only the stateless xcatroot
of dracut_047 changes; statelite and the other dracut modules keep their
handoff.
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>
ra_interface_is_served looks up the interface name literally, so
dhcpinterfaces=* serves no interface and radvd gets no configuration.
When the last IPv6 network is removed, configure_router_advertisements
returns early and radvd keeps the old prefix and route. The Kea callers
do not call it at all when no DHCPv6 subnet remains.
These tests fail on the current tree. The other Kea tests that run
kea_process_request now stub the radvd step, so they do not read or
change the radvd configuration of the host.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
With mac.duid=canonical the ISC host named after the node answers
iPXE, but it gets the shim, so iPXE never loads the node script.
makedhcp -d on ISC does not remove the <node>-firmware host.
After a change from netboot=ipxe to grub2, the Kea entry of iPXE holds
no hostname and no address, so neither the update nor makedhcp -d
removes it. The ISC host <node>-ipxe also stays.
These tests fail on the current tree.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>