2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 04:27:55 +00:00
Commit Graph

27526 Commits

Author SHA1 Message Date
Daniel Hilst 0f12faa0fc fix(xcat-core): do not add a second syncfiles when the node already defers it
A node may list syncfiles in both postscripts and postbootscripts -- once for the install and
once for the booted node. The deferral prepended its own copy regardless, so the booted node ran
syncfiles twice in a row inside a marker block that made it look like xCAT had generated the
duplicate.

Keep the entry the node already has and still remove the install-time one, which is the copy
that cannot work in the in-target chroot.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-28 09:45:56 -03:00
Daniel Hilst e62a66c70d docs(xcat-core): note the memory an Ubuntu diskful install needs
toram copies the live filesystem into RAM, so the node needs memory for it on top of the
installer -- about 1.5G on 24.04 and growing per release. Nothing enforced or documented that.

A node with too little fails part-way and reboots into the installer, which looks like a
boot-flip failure rather than an out-of-memory condition, so the troubleshooting page says
where to look and how to raise vmmemory.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-28 09:41:42 -03:00
Daniel Hilst 1cbdad2531 fix(xcat-core): correct the boot-flip comment
The comment blamed mawk: updateflag.awk needs gawk's |& and Ubuntu's /usr/bin/awk is mawk. That
is wrong on this path -- compute.subiquity.tmpl has installed gawk in the target since Ubuntu
20.04 support was added, so updateflag.awk would have found it.

The flip was going unanswered because xcatd's install monitor, which serves port 3002, dies and
is never re-forked. That is fixed in #7759. The /dev/tcp exchange here is hardening: it retries
and reports, rather than reinstalling in silence.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-28 09:38:44 -03:00
Daniel Hilst a0c8f7eae7 fix(xcat-core): trim the commentary around the Subiquity diskful fix
Three passes of the same reasoning had accumulated: in the code, in the POD of the routines the
previous commit extracted, and again in the test headers. Say each once, where the reader needs it.

The POD blocks were the worst of it -- extracting subiquity_kcmdline() and
defer_syncfiles_to_postboot() moved the essays out of the routines but did not shorten them. The
toram paragraph ran eleven lines for one kernel argument; the exact systemd-shutdown message and
the size of the 24.04 layers are colour, not reasoning.

The template's two comments and the apt-sources pair are trimmed the same way: the sources.list
explanation lives in Template.pm, and the test says which case it is checking and points there.

That the tests still pass after rewriting the template is the point of the previous commit -- a
test matching its text would have broken here.

47 comment and POD lines removed, no behaviour change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-27 16:00:57 -03:00
Daniel Hilst 00ef09add2 test(xcat-core): assert the Subiquity install behaviour instead of the source that implements it
The tests added with this fix matched regexes against the text of debian.pm, Postage.pm and
compute.subiquity.tmpl. A source match cannot tell whether the code it found ever runs: moving
the Subiquity command line into its own routine leaves every one of those assertions passing,
and reformatting a line fails them while the behaviour is untouched. One of them pinned Perl
syntax outright, qr/\$kcmdline\s*\.=\s*" ---";/, and another matched the text of a substitution.

Run the code instead.

Two decisions were lifted out of the routines that had grown around them, so a test can call
them: subiquity_kcmdline() in debian.pm builds the installer command line from its inputs, and
defer_syncfiles_to_postboot() in Postage.pm returns the adjusted postscript lists. Both are pure
and carry the reasoning that used to sit inline. The callers keep their behaviour exactly.

The template's two shell fragments are extracted and executed: the boot flip runs against a
stand-in for xcatd on the install-monitor port, and the resolv.conf step runs with a getent that
answers as the case requires.

Every assertion now fails when the behaviour it describes is removed, which is what the source
matches only appeared to do:

  boot=casper dropped from the command line     1 assertion fails
  toram dropped                                 1 assertion fails
  nfsroot given the host name instead of the IP 2 assertions fail
  the deferral made a no-op                     7 assertions fail
  the wrong token sent to xcatd                 1 assertion fails
  the failed-flip log line removed              3 assertions fail
  the retry loop reduced to one attempt         2 assertions fail
  resolv.conf given the host name               3 assertions fail
  the resolution fallback removed               2 assertions fail

ubuntu_subiquity_bootparams.t is removed. Its three matches are covered by execution in
debian_subiquity_netboot.t, and it demonstrated the problem: it still passed after the command
line moved into another routine.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-26 17:31:46 -03:00
Daniel Hilst a6f77a9732 fix(xcat-core): complete the Ubuntu Subiquity diskful install
Boot the live installer correctly. Add boot=casper so casper actually processes
netboot=nfs instead of scanning local disks and panicking, resolve the install server
to a literal IP because casper mounts the live filesystem with klibc's nfsmount which
has no resolver, and add toram so casper copies the squashfs into RAM and unmounts the
NFS source. That last one is what lets the node reboot at all: with the NFS root still
mounted, systemd-shutdown waits forever on an lvm/pvscan wedged in uninterruptible I/O
on it and the node never power-cycles into the disk it just installed. casper has no
cmdline knob for NFS mount options -- it parses only nfsroot= and takes the whole value
as the path -- so toram is its supported way to avoid a network root.

Write the installer's resolv.conf nameserver as an IP. glibc's resolver discards a
hostname given on a nameserver line, so the xcatmaster name left the installer, and
the in-target apt that inherits the file, with no DNS at all.

Add the online archive through apt `sources:` on classic-sources releases, where
Subiquity renders the target sources.list from the install media alone and in-target
apt cannot find packages the ISO does not carry. Deb822 releases are excluded: their
primary mirror already lands in ubuntu.sources, so legacy .list files would configure
the same suites twice.

Flip the node to local-disk boot from the live installer over bash's /dev/tcp instead
of relying on updateflag.awk, which needs gawk's |& coprocess while Ubuntu's
/usr/bin/awk is mawk. The exchange is checked, and a failure is recorded in the
install log rather than silently PXE-looping into another install.

Defer syncfiles to the postbootscripts on the diskful install path, so it runs on the
booted node with sshd up rather than inside the in-target chroot where the MN cannot
reach it.

Make the test harness's provision wait overridable through WAIT_FOR_PROVISION; the
default stays short so a boot loop still fails fast.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-24 15:41:32 -03:00
Daniel Hilst d8a01bcf15 test(xcat-core): capture the Ubuntu Subiquity diskful install never completing
The gating reg_linux_diskfull_installation_flat case cannot pass on Ubuntu: the
compute node never reaches a booted, installed OS, and the case only ever reports
"ssh: connect ... port 22: Connection refused". It is not one defect but a chain, each
reachable only once the one before it is fixed.

The installer never boots. Without boot=casper, casper never processes netboot=nfs --
it scans the local disks, finds no live media and panics "Unable to find a medium
containing a live file system". nfsroot must also be a literal IP: casper mounts the
live filesystem with klibc's nfsmount, which cannot resolve a hostname. And with the
NFS root still mounted at end of install, systemd-shutdown blocks forever on an
lvm/pvscan wedged in uninterruptible I/O on it, so the node never power-cycles into
the disk it just installed.

The installer has no usable DNS. A nameserver line in /etc/resolv.conf must hold an IP
-- glibc's resolver discards a hostname written there -- so writing the xcatmaster name
leaves the installer, and the in-target apt that inherits the file, hanging on
archive.ubuntu.com.

In-target apt cannot find its packages on classic-sources releases, because Subiquity
renders the target sources.list from the install media alone.

The node never leaves the installer. The boot flip to local disk goes through
updateflag.awk, which needs gawk's |& /inet coprocess, but Ubuntu's /usr/bin/awk is
mawk -- so the flip fails silently and the node reinstalls forever.

And syncfiles runs inside the in-target chroot, asking the MN to scp files into a node
that has no sshd yet, so it times out and the node reports failed on a good install.

Cover each stage. All fail today.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-24 15:41:32 -03:00
Daniel Hilst f2f96b67fc Merge pull request #7728 from VersatusHPC/fix/xml-external-entity
fix(xcatd): block XML external entities on the legacy parser path
2026-08-24 14:23:48 -03:00
Daniel Hilst 5ca148889c Merge pull request #7749 from VersatusHPC/fix/nodestat-usefping-option
fix(nodestat): accept the fping option that the usage message gives
2026-08-24 12:42:21 -03:00
Daniel Hilst bcf6f9059a Merge pull request #7750 from VersatusHPC/fix/dbobjutils-exact-only-if-values
fix(dbobjutils): match exact only-if values
2026-08-24 12:39:34 -03:00
Daniel Hilst 14feebce2f Merge pull request #7753 from VersatusHPC/fix/genesis-lzma-via-xz
fix(mknb): compress the genesis image with xz when lzma is absent
2026-08-24 12:36:26 -03:00
Daniel Hilst ca5d1cfa86 Merge pull request #7751 from VersatusHPC/refactor/dbobjutils-remove-legacy-group-matcher
refactor(dbobjutils): remove redundant group matcher
2026-08-24 12:29:02 -03:00
Daniel Hilst 8c3aaa4471 Merge pull request #7727 from VersatusHPC/refactor/kea-shared-service-mapping
refactor(kea): reuse shared service mapping
2026-08-24 12:27:38 -03:00
Daniel Hilst a7f4c770b5 Merge pull request #7631 from VersatusHPC/refactor/ipmi-rmcp-response-identity
refactor(ipmi): centralize RMCP response identity check
2026-08-24 12:27:17 -03:00
Daniel Hilst 7b70d8085f Merge pull request #7752 from VersatusHPC/refactor/networkutils-netmask-helpers
refactor(network): reuse shared netmask helpers
2026-08-24 12:19:07 -03:00
Vinícius Ferrão eaa1e94a32 test(nodestat): pin the fping option and the usemon abbreviations
Add a unit test for the option that selects fping instead of nmap.

The test takes the specification out of the plugin source and gives it to
Getopt::Long with the settings that the daemon uses, so it drives the
specification that the plugin ships.

It shows that -f, --usefping and the older --useping each select fping, that
--use and --us still select usemon and do not select fping, that the bundles
-mf and -fm select both options, and that both places parse through the one
specification.
2026-08-23 22:38:41 -03:00
Vinícius Ferrão 73b145d7ff test(mknb): pin which program compresses the genesis image
Add a unit test for the routine that chooses the compression program. The
test lifts the routine out of the plugin source, because the plugin needs a
management node to load.

The test shows that lzma is used when it is there, that xz stands in when it
is not, and that xz is asked for the lzma container rather than its own. It
also shows that the caller takes the command from the routine, that the file
keeps its name and its suffix, and that the gzip fallback and the rename into
place both remain.
2026-08-23 22:38:41 -03:00
Vinícius Ferrão d5f882291d fix(nodestat): accept the fping option that the usage message gives
The manual page and the usage message of nodestat give the option
-f|--usefping. The preprocessor of the request knows no option f, and the
handler of the request spells the long name useping, so --usefping does
nothing. An administrator who follows the manual page gets the nmap path, and
gets no message that says why.

The two places also read different specifications, so an option that one
place accepts can reach the other place and take a different meaning. Put the
specification in one routine, and let both places read that routine.

Give the name usefping to the option, and keep useping as a second name. That
spelling has worked since 2.14.2, so a site can have it in a script.

The long name of the fping option starts with the same letters as usemon, so
--use and --us become names that Getopt::Long cannot decide. Those two
abbreviations select usemon today. Keep them with usemon, or an administrator
who monitors with them loses the monitoring and gets no message.

The change has two other effects. The abbreviations --use and --us no longer
select fping as well, which they did only because the two places read
different specifications. The bundles -mf and -fm now select both options,
which they did not do before.

Recovered from the lenovobuild branch.
2026-08-23 22:38:41 -03:00
Vinícius Ferrão c390570e95 fix(mknb): compress the genesis image with xz when lzma is absent
The genesis image goes into a file whose name ends with .lzma. The plugin
writes that file only when /usr/bin/lzma is there, and it falls back to gzip
when it is not.

Red Hat ships no lzma binary. On AlmaLinux 9 and on AlmaLinux 10 that test
fails, the plugin falls back to gzip, and it gives no message that says why.
The image is larger on each run of mknb. Debian and Ubuntu ship lzma as a
second name for xz, so those systems still get the smaller image.

Ask xz for the same container when lzma is absent. The command
"xz --format=lzma" writes the same bytes as "lzma", so the file keeps its
name, its container and its size. Keep the gzip fallback for a system that
has neither program.

Recovered from the lenovobuild branch, which asked xz for the xz container.
That container is not the lzma container, and the name of the file says lzma.
2026-08-23 22:38:41 -03:00
Vinícius Ferrão d3d0f86abf test(network): cover shared netmask behavior 2026-08-23 13:51:39 -03:00
Vinícius Ferrão b6d9bc6643 refactor(network): reuse shared netmask helpers 2026-08-23 13:50:00 -03:00
Vinícius Ferrão 7afa152f8d test(dhcp): prepare shared network helper stubs 2026-08-23 13:49:15 -03:00
Vinícius Ferrão 1e8917ebe0 test(dbobjutils): guard only-if routing invariants 2026-08-23 13:13:16 -03:00
Vinícius Ferrão c42f42f194 refactor(dbobjutils): remove redundant group matcher 2026-08-23 13:13:16 -03:00
Vinícius Ferrão 21755f8f93 test(dbobjutils): cover exact only-if value matching 2026-08-23 11:38:55 -03:00
Vinícius Ferrão 3aa826df92 fix(dbobjutils): match exact only-if values 2026-08-23 11:38:55 -03:00
Vinícius Ferrão 5d39fc30d4 test(utils): cover comma-list membership 2026-08-23 11:08:59 -03:00
Vinícius Ferrão 6e43843712 refactor(utils): centralize comma-list membership 2026-08-23 11:08:24 -03:00
Daniel Hilst 7733d16f8d Merge pull request #7721 from VersatusHPC/feature/genesis-openembedded
feat(genesis): build images with OpenEmbedded
2026-08-21 20:36:20 -03:00
Vinícius Ferrão 9da2d71b90 test(genesis): cover legacy destiny retries 2026-08-21 20:11:31 -03:00
Vinícius Ferrão b22676a099 fix(genesis): retry legacy destiny only on failures 2026-08-21 20:11:30 -03:00
Daniel Hilst 0f4b8c9794 Merge pull request #7744 from VersatusHPC/fix/getinstdisk-selection-order
fix(getinstdisk): decide the install disk by driver group, and scan Xen disks
2026-08-21 12:54:24 -03:00
Daniel Hilst c70d87af5d Merge pull request #7742 from VersatusHPC/fix/getinstdisk-single-script
fix(getinstdisk): serve every installer from one script
2026-08-21 10:57:10 -03:00
Vinícius Ferrão c4938a2d28 Merge pull request #7740 from VersatusHPC/fix/getinstdisk-modern-devices
fix(getinstdisk): rank direct attached disks ahead of RAID volumes
2026-08-21 10:28:44 -03:00
Vinícius Ferrão 5424af302c style(genesis): trim source comments 2026-08-21 03:26:13 -03:00
Vinícius Ferrão c6c11d70a1 test(genesis): cover the action boot gate 2026-08-21 02:13:19 -03:00
Vinícius Ferrão 395e85ed1c fix(genesis): gate the action service 2026-08-21 02:13:19 -03:00
Vinícius Ferrão 4c50b4da50 test(genesis): cover disappearing devices 2026-08-21 02:12:56 -03:00
Vinícius Ferrão 07bc26f15d fix(genesis): tolerate incomplete inventory 2026-08-21 02:12:56 -03:00
Vinícius Ferrão 53c8538e4a test(genesis): cover logging failures 2026-08-21 02:12:22 -03:00
Vinícius Ferrão c20ce284eb fix(genesis): keep logging non-fatal 2026-08-21 02:12:22 -03:00
Vinícius Ferrão a47c7f8e7c test(genesis): cover long kernel command lines 2026-08-21 02:10:23 -03:00
Vinícius Ferrão d28e72a92c fix(genesis): read the full kernel command line 2026-08-21 02:10:22 -03:00
Vinícius Ferrão 9fc3d52b81 test(getinstdisk): follow the log lines of the new selection
The install disk autotests read the log of a provisioned node. The
choice files no longer carry the identifier in their name, and the
selection message names the driver group and the identifier instead of
the previous wording, so read the new lines. The reinstall case reads
the record of its disk without naming a group, as it did before.
2026-08-21 01:13:50 -03:00
Vinícius Ferrão 492f9171a2 test(getinstdisk): cover the driver group against the identifier
Cover a RAID volume that reports a WWN against a direct attached disk
that reports none, in both scan orders, which the previous readback
decided by identifier. Keep the identifier rules of one group under
test as well: the disk that reports a WWN wins, the lower WWN wins
between two, and a path wins over no identifier at all.
2026-08-21 01:13:16 -03:00
Vinícius Ferrão 7e8994e1b9 test(getinstdisk): pin the single script layout
Assert that the RHEL 10 copy is gone, that the RHEL 10 installer
includes the common script, and that the common script keeps the VROC
fallback, the Xen fallback and the guarded failure log.
2026-08-21 01:13:15 -03:00
Vinícius Ferrão 27aaa960fa fix(getinstdisk): choose the driver group before the identifier
The scan wrote each disk into a file named after the identifier it
reported, wwn, path or neither, and read back the groups of one such
file only. Two disks that reported different identifiers therefore
never competed on their driver group: a disk without a WWN was dropped
as soon as another disk reported one, and when the last disk scanned
reported a WWN the readback opened the WWN files alone. A direct
attached boot disk that reports no WWN thus lost to a RAID volume that
reports one, which is the case the driver groups exist to decide.

Write every disk into the file of its driver group and keep the
identifier as the sort key inside that group, ranked so that a WWN
sorts ahead of a path and a path ahead of no identifier. The driver
group now decides first for every disk, the identifier still decides
between disks of one group, and no disk is dropped from the scan.
2026-08-21 01:13:15 -03:00
Vinícius Ferrão 3ca2a9f8aa fix(getinstdisk): serve every installer from one script
The RHEL 10 support added a second copy of the script. The copy carries
the Xen fallback and a failure log that the common script does not, and
the common script carries the Intel RSTe/VROC fallback that the copy
does not. A RHEL 10 node whose OS disk is a VROC volume therefore fell
back to /dev/sda, and every later fix to disk selection had to be
written twice to reach both.

Fold the Xen fallback and the failure log into the common script and
delete the copy. The RHEL 10 installer includes the common script, as
the other installers already do. The failure log runs only when the
including script defines msgutil_r, because the subiquity path does
not.
2026-08-21 01:13:15 -03:00
Vinícius Ferrão bbd1a7e9d3 test(getinstdisk): cover the Xen disk scan
Cover a guest whose only disk is a Xen disk, which the scan has to
select rather than leave to the fallback, and a guest with two Xen
disks, where the driver group decides. Against the previous filter both
cases fail.
2026-08-21 01:13:15 -03:00
Vinícius Ferrão 046c97ba2a test(getinstdisk): target the common script only
The RHEL 10 copy of the script is about to go away, so stop naming it
here first. The cases keep running against the common script, so the
coverage does not change.
2026-08-21 01:13:15 -03:00