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

84 Commits

Author SHA1 Message Date
Daniel Hilst dc8c5cefed fix(xcat-core): Genesis sends a DUID the reservation does not hold, and makedns aborts on a /62
Both Genesis images built a DUID-UUID from the nil SMBIOS UUID. makedhcp refuses that UUID,
because nodeimport writes it to every PowerKVM node, and reserves the hardware address instead,
so the client sent an identifier no reservation held and the node took a pool address with no
boot file. genesis-duid and doxcat now keep the DUID-LL for it, which is what Kea reads the
hardware address out of.

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

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 10:20:52 -03:00
Daniel Hilst f2688f9d5a fix(xcat-core): Genesis hands an unbracketed IPv6 address to openssl
Parsing the xcatd= argument was only half of it. doxcat re-joined XCATMASTER and
XCATPORT at twenty call sites, and /bin/getcert and /bin/getdestiny pass that string
to openssl s_client -connect, which rejects an unbracketed IPv6 address:

  openssl s_client -connect 2001:db8:190::1:3001
    s_client: -connect argument or target parameter malformed or ambiguous
  openssl s_client -connect [2001:db8:190::1]:3001
    depth=1 CN=xCAT CA

Measured on an IPv6-only node whose cmdline parsed correctly: /etc/xcat held
certkey.pem and privkey.pem but no cert.pem, and nodelist.status stayed empty.

doxcat now derives XCATDEST once, bracketing an address that holds a colon, and every
call site uses it. getcert already honoured XCATDEST as an environment variable.
dodiscovery falls back to the old form when doxcat did not export it.

The mutation keeps the variable and changes only its value: 4 of the 7 bats cases go
red, the IPv6 ones, and the 3 IPv4 and default-port cases pass.

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

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

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

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 17:07:51 -03:00
Vinícius Ferrão dda0435e12 fix(genesis): report the system UUID that the kernel prints
Genesis discovery swapped the first three fields of product_uuid before
it sent the UUID. When that was written, the kernel printed the SMBIOS
bytes in their stored order, and the swap gave the UUID that dmidecode
prints. Since Linux 3.8 product_uuid is that UUID already, so the swap
stores vpd.uuid in SMBIOS byte order. makedhcp then reverses it again,
and the DHCPv6 reservation does not match the DUID that UEFI firmware
sends.

Discovery now reports product_uuid as it is, as the OpenEmbedded
Genesis does. doxcat keeps the swap in the DUID that it writes for
dhclient, because the swap gives the DUID that the firmware sends.
Windows provisioning links the node file under both UUID orders and
does not change.

(cherry picked from commit 1a6cd4259ca8b71fc12aa03e61b88b60705d7889)
(cherry picked from commit dfdc48b96d)
2026-10-26 15:27:22 -03:00
Vinícius Ferrão 5ea05d0e60 refactor(fips): share shell policy across runtime artifacts
Generate the Genesis and postscript policy blocks from one POSIX source.
Keep the runtime libraries self-contained and reject stale generated blocks
before RPM or Debian builds.

Preserve the existing state predicate, key algorithms, key sizes and
public-key export fallbacks. Keep caller-specific helpers separate.
2026-10-17 02:53:25 -03:00
Vinícius Ferrão f7621a6cae refactor(genesis): share BMC configuration field reads 2026-10-15 15:09:10 -03:00
Vinícius Ferrão e70cd9a961 refactor(genesis): share BMC LAN field queries 2026-10-15 15:09:09 -03:00
Vinícius Ferrão d909b3f6fa refactor(genesis): share destiny protocol operations 2026-10-13 22:16:49 -03:00
Vinícius Ferrão 3908b13960 fix(discovery): use FIPS-compatible bootstrap keys 2026-10-05 22:55:27 -03:00
Vinícius Ferrão 750ed7e5a5 fix(ssh): skip optional DSA host keys in FIPS mode 2026-10-05 18:14:20 -03:00
Daniel Hilst 772f11c257 fix(xcat-core): the el10 Genesis image carries no openssl, so getcert never returns
A compute node that boots the legacy Genesis image built on el10 stops after
"Getting initial certificate --> <mn>:3001". /etc/xcat is empty, getdestiny never runs and
the node reports no destiny, so xcatd leaves nodelist.status at powering-on. On the node,
openssl reports "command not found" and the getcert process stays alive.

xCAT-genesis-base.spec never build-requires openssl. el8 and el9 hold /usr/bin/openssl in
the build root as a dependency of another package, and el10 does not, so dracut_install in
dracut_105/el/module-setup.sh installed nothing and reported nothing. getcert line 8 waits
for openssl with no bound, which turns the missing command into a wait instead of an error.

The spec now build-requires openssl on every release. verify-genesis-payload reads the
command names back from the dracut module with --commands-from and requires each one in the
payload, so the next name the build root does not supply fails the build. getcert reports a
missing openssl and stops, and bounds the wait for /etc/xcat/certkey.pem at 600 seconds,
which is far longer than the background 4096 bit key needs.

The spec read %{_target_cpu} after BuildArch: noarch, where rpm has already set it to
noarch, so the dmidecode and efibootmgr build-requires never applied and a sed deleted their
dracut_install line on every architecture. Every shipped image lacks both. The spec now
reads %{tarch}, and the dracut module installs whichever of the two the build root carries,
because ppc64le packages neither.

xCAT-test/unit/genesis_getcert_missing_openssl.t, genesis_payload_verification.t and
genesis_base_spec_buildrequires.t fail on the test commit before this one.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-04 23:50:47 -03:00
Daniel Hilst 279207cf0a fix(xcat-core): the legacy Genesis image for el10 carries no DHCP client
A compute node that boots the legacy Genesis image on el10 x86_64 never acquires an
address. Its serial console reports "/usr/bin/doxcat: line 293: dhclient: command not
found" and then "It seems to be taking a while to acquire an IPv4 address". The DHCP
server side is sound: Kea leases the address and the node never asks for it.

AlmaLinux 10 and EPEL 10 package no ISC dhcp-client. dracut_install reports a missing
binary and returns, so module-setup.sh named dhclient, the build kept going and the image
shipped without a client. doxcat then named dhclient at six call sites with no
alternative.

doxcat now chooses its client at run time. genesis_dhcp_command() returns the command
line for one interface and one address family, and genesis_start_dhcp() runs it and
reports when the image carries none. The ISC client keeps its command line where a
release packages it, so el8 and el9 are unchanged. Where it is absent, dhcpcd stands in:
AlmaLinux 10 baseos packages it at 236 KB, and it carries its own resolv.conf, hostname
and ntp hooks, so it needs no dhclient-script. dhcpcd on a single interface exits when
its 30 second timeout expires and de-configures the interface as it goes, so it is asked
for -t 0 and -p.

The dracut module installs whichever client the build root carries, together with the
hooks dhcpcd runs on every lease. The spec build-requires dhcpcd from rhel 10 on, and
verify-genesis-payload now requires usr/sbin/dhcpcd there, so an image that ships with no
client fails the build instead of reaching a node.

genesis_dhcp_client.t drives both routines with the clients shadowed by recording stubs.
It fails on the parent commit, and deleting the dhcpcd branch turns five of its
assertions red.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit b9329998c80383bb0397d16a558f66a6bb9db399)
2026-09-04 19:26:23 -03:00
Vinícius Ferrão 4aa1db0dce refactor(getadapter): share PCI adapter scan 2026-09-02 23:02:45 -03:00
Vinícius Ferrão 435bfaf29c refactor(getadapter): share result transmission 2026-09-01 12:19:57 -03:00
Vinícius Ferrão cbfc72b6a0 fix(genesis): configure eligible secondary NICs with DHCP
Legacy Genesis excludes every secondary interface with IFF_UP, even when firmware only raised it and no address is configured. Let eligible interfaces join the existing secondary-interface DHCP path when they are physical, not enslaved, unaddressed, and not owned by the TSM or IMM management paths. Existing DOWN interfaces keep their prior path.

Recovered from the unmerged lenovobuild branch (original 9a1381f6), adapted to leave preconfigured and management-owned interfaces untouched.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-08-30 20:01:59 -03:00
Vinícius Ferrão c6c7df99bd genimage: resolve Mellanox defaults from target kernel
Resolve optional Mellanox network drivers against the target image's selected kernel. Keep real mlx_en modules, fall back to mlx4_en, include available mlx5_core, and omit missing defaults without changing explicitly requested netdrivers.
2026-08-28 12:48:17 -03:00
Vinícius Ferrão b22676a099 fix(genesis): retry legacy destiny only on failures 2026-08-21 20:11:30 -03:00
Vinícius Ferrão 6c534cb888 fix(genesis): stop destiny requests cleanly 2026-08-20 22:39:46 -03:00
Vinícius Ferrão 1a8574397d fix(genesis): preserve destiny client behavior 2026-08-20 22:38:45 -03:00
Vinícius Ferrão b632a6a94f feat(genesis): add provisioning runtime 2026-08-20 22:29:55 -03:00
Daniel Hilst b4a5a86b4b Merge pull request #7665 from VersatusHPC/harvest/genesis-ib-support
fix(genesis): find the boot NIC over InfiniBand (IPoIB)
2026-07-28 11:01:51 -03:00
Daniel Hilst 5fb329d2dc Merge pull request #7671 from VersatusHPC/harvest/bmcsetup-robustness
fix(bmcsetup): settle after IBM port change and support long BMC passwords
2026-07-27 15:28:14 -03:00
Daniel Hilst 38c0674394 Merge pull request #7663 from VersatusHPC/harvest/bmcsetup-walker-pass
fix(bmcsetup): support Intel Walker Pass (S9200WK) BMC LAN
2026-07-27 10:35:59 -03:00
Daniel Hilst db9da9667f Merge pull request #7646 from VersatusHPC/harvest/bmcsetup-verify-before-set
fix(bmcsetup): skip BMC LAN settings that already match (verify before set)
2026-07-27 07:58:09 -03:00
Vinícius Ferrão 563a083627 fix(bmcsetup): settle after IBM port change and support long BMC passwords
Two small robustness fixes for bmcsetup:

- After changing the BMC network port on IBM boards (IPMIMFG 2), the BMC LAN
  configuration was not yet ready; add a 15s settle before continuing. Gated
  inside the IBM branch, so no other vendor is affected.

- Set a password longer than 16 characters using ipmitool's 20-byte form, but
  only when the password actually exceeds 16 chars, so a BMC that supports only
  16-byte passwords is never asked for a length it cannot store.

Recovered from the unmerged lenovobuild branch (949532f3, 78fa7758; the password
change adapted to use the 20-byte form only for long passwords).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-23 21:14:01 -03:00
Vinícius Ferrão 9a33f64257 fix(genesis): find the boot NIC over InfiniBand (IPoIB)
When a node boots from an InfiniBand interface, doxcat could not match BOOTIF
to the netdev, so boot-nic detection failed. Load ib_ipoib and, if the normal
Ethernet lookup finds nothing, fall back to matching the InfiniBand device by
its (shorter) IPoIB address.

modprobe ib_ipoib is harmless where there is no IB hardware (the module simply
loads no devices), and the IB lookup only runs when the Ethernet lookup fails,
so non-IB nodes are unaffected.

Not lab-validated (no InfiniBand fabric available; the SR635's Mellanox card is
in Ethernet mode).

Recovered from the unmerged lenovobuild branch (aeeebd5f).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-23 19:19:23 -03:00
Vinícius Ferrão 49c3e94a09 fix(bmcsetup): support Intel Walker Pass (S9200WK) BMC LAN
Intel Walker Pass (S9200WK) boards in dedicated-LAN mode use IPMI channel 3;
the auto-detect loop does not find it. Set the channel explicitly for these
boards, gated on IPMIMFG=343 && XPROD=149, and extend the existing S2600BP
channel-setaccess (343/124) to cover 149 as well.

Gated on the Intel manufacturer/product IDs, so no other BMC is affected.
Not lab-validated (no Walker Pass hardware available).

Recovered from the unmerged lenovobuild branch (2357c298).
2026-07-23 19:15:43 -03:00
Vinícius Ferrão c1e0452da8 Merge pull request #7656 from VersatusHPC/harvest/bmcsetup-sr635-sr655
fix(bmcsetup): enable BMC setup for Lenovo SR635/SR655
2026-07-23 17:41:51 -03:00
Vinícius Ferrão 6dbc16c216 fix(bmcsetup): enable BMC setup for Lenovo SR635/SR655
The original Lenovo SR635/SR655 (IPMI manufacturer 19046, product 1287) use an
AMI "TSM" BMC reached over a LAN-over-USB interface, which needs OEM raw commands
to bring the interface up, select the LAN channel, and restart TSM networking
once configured. Add a dedicated vendor branch for it -- gated on the same
IPMIMFG/XPROD check the script already uses for IBM, Dell, Supermicro, OpenPOWER
and other Lenovo machines -- plus a udev rule and helper that bring up the USB
NIC (169.254.0.120) so in-band ipmitool can reach the TSM. The user-slot
auto-scan is skipped for these machines, which use a fixed slot.

Everything is behind IPMIMFG=19046 && XPROD=1287 (or the 046b:ffb0 USB device),
so no other BMC is affected.

Recovered from the unmerged lenovobuild branch (922dfe18, 42357f9d, 02da8a6b,
765e2ad3, 408cf2b3), adapted to master's bmcsetup structure. The global MD5 LAN
auth removal that rode along in 42357f9d is intentionally left out -- SR635/SR655
IPMI authentication is already handled in master by #7586 (retry cipher suite 3
on a zero RAKP2 HMAC), so dropping MD5 for all BMCs is neither needed nor wanted
here.

Not lab-validated: this targets the original SR635/SR655 (product 1287); no such
machine was available to test (an SR635 V3 reports product 1601 and uses a
different, directly-reachable BMC). The code is gated so it cannot affect other
hardware.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-23 16:43:41 -03:00
Vinícius Ferrão 8d7ccc2d89 fix(bmcsetup): skip BMC LAN settings that already match (verify before set)
bmcsetup unconditionally re-set the BMC IP source, address, netmask, gateway
and VLAN on every run. On a re-run or re-discovery where the BMC is already
configured, that re-applies settings needlessly and can briefly churn the BMC
network. Read the current value first and only issue the set when it differs;
the VLAN check maps an "off" target to the "Disabled" the BMC reports.

Validated read-only on a Lenovo ThinkSystem SR635 (MegaRAC BMC): the address
and VLAN guards evaluate to skip when the target matches the current value.

Recovered from the unmerged lenovobuild branch (fd194005); the RD350-specific
snooze and manufacturer-ID hunks are omitted as master's vendor handling has
since diverged.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-23 01:29:04 -03:00
Vinícius Ferrão f24457cddf fix(genesis): stop ethtool link-wait loops from spinning forever
For each secondary NIC in NICSTOBRINGUP, doxcat backgrounds a loop that polls
`ethtool $nic` until the link reports "detected: yes" before running dhclient.
A NIC that is never connected keeps that loop (and its `sleep 5`) running for
the life of the genesis environment, leaking background shells and needlessly
churning.

Add a second exit condition so each loop also stops once /tmp/netinitted
exists, and touch that file once the boot NIC has completed network init. A
link that never appears no longer waits indefinitely.

Recovered from the unmerged lenovobuild branch (original 9ece12e4).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-21 17:11:01 -03:00
Vinícius Ferrão e239e04843 genesis-scripts: improve shell quoting and syntax hygiene
Replace backtick command substitutions with $(), quote variable
expansions to prevent word splitting, replace useless cat pipes with
redirections, use grep -q instead of redirecting to /dev/null, and use
bash parameter expansion for case conversion.

Based on the work from PR #6366, rebased and adapted to current master.
Shebangs already merged separately via df64bf8fe are excluded.

Co-Authored-By: Samveen <samveen@yahoo.com>
2026-05-07 18:17:00 -03:00
Vinícius Ferrão 7c1444335e fix: skip disabled IPMI user slots in bmcsetup
bmcsetup iterated every user slot and retried ipmitool user disable for slots that were already disabled. Lenovo XCC reports those attempts as Invalid data field in request, so discovery can spend minutes retrying no-op disables.

Read the current user table once per BMC, keep the old fallback when the table cannot be read, and disable only non-target slots whose IPMI Msg flag is true. Also use the loop's current username when resolving the target slot and keep the intended userslot 2 fallback assignment.

Fixes xcat2/xcat-core#5065
2026-05-06 23:54:02 -03:00
davidmonro 6c2480fb5e dodiscovery: when parsing DMI FRU data, only ignore the product name if it is entirely whitespace, rather than just containing some (#7500) 2025-05-31 01:33:20 +02:00
Markus Hilger d8ce286412 Merge pull request #7460 from abhishek-sa1/master
Genesis fix for x86_64
2024-09-10 17:17:26 +02:00
Kilian Cavalotti 787ea2191e bmcsetup: enhance BMC port configuration for Dell systems
Add optional values to ipmi.bmcport to support more fine-grained
configuration for Dell servers, and mirror the `ipmitool delloem`
capabilities:

   lan set <Mode>
    sets the NIC Selection Mode :
        dedicated, shared with lom<idx>

   lan set <Shared Failover Mode>
    sets the shared Failover Mode :
        shared with failover lom<idx>
        shared with failover all loms,
        shared with failover none.

This patch introduces the possibility to provide 3 (space-separated)
values for ipmi.bmcport:
  1st value:  0 = shared / 1 = dedicated
  2nd value   shared LOM (1-4)   (0 or no value means first available LOM)
  3rd value:  failover LOM (1-4) (0 means no failover, no value means all LOMs)

To ensure maximum compatibility with the default 0/1 shared/dedicated
scheme, the 2nd and 3rd values are optional, and will retain the
previous behavior when not specified.

Examples:

ipmi.bmcport value      BMC interface configuration
0                       Shared with first available interface, failover with
                        all LOMs (catch-all mode)
0 1                     Shared with LOM1, failover all LOMs
0 1 2                   Shared with LOM1, failover LOM2
0 2 0                   Shared with LOM2, no failover
1                       Dedicated
2024-08-12 13:20:16 -07:00
Abhishek S A f89fb8763d Update doxcat 2024-07-31 08:56:28 +05:30
abhishek-sa1 88447104e5 Update doxcat 2024-07-31 08:54:55 +05:30
abhishek-sa1 5e7e00ffac xcat genesis fix for x86_64 2024-07-26 16:05:15 +05:30
Kilian Cavalotti 7ef19295f1 bmcsetup: add support for setting bmcport on Supermicro servers (#7318)
* bmcsetup: add support for setting bmcport on Supermicro servers

* bmcsetup: set real shared mode for Supermicro BMC interface, and add web reference
2024-07-12 16:15:52 +02:00
Kilian Cavalotti 255ff27d8f bmcsetup: revert previous meaning of bmcport for Dell servers (#7317)
* bmcsetup: revert previous meaning of bmcport for Dell servers, to
conform with other server types: 0=shared, 1=dedicated

* bmcsetup: remove dependency on `ipmitool delloem` and use raw cmds instead

ipmitool delloem may not work on all Dell server generations,
functionnality depends on ipmitool versions (see
https://github.com/ipmitool/ipmitool/issues/18).

So removing thatdependency and using raw IPMI commands seems more robust.
2024-07-12 16:05:54 +02:00
Markus Hilger df64bf8feb Add missing shebang lines 2024-05-07 16:31:30 +02:00
Obihörnchen 86c8b3310d Merge pull request #7398 from stanford-rc/mtm_empty_fru
Fix MTM detection for incomplete FRU pages
2024-02-19 19:13:16 +01:00
Kilian Cavalotti 7f7d7db591 use \s to handle all types of whitespace 2023-12-11 14:50:10 -08:00
Kilian Cavalotti 7e4f11119d fix FRU parsing when empty values are provided 2023-07-27 14:12:13 -07:00
Kilian Cavalotti 6bbabb551e retab 2023-07-27 14:12:03 -07:00
besawn 8bad3917fb Added missing shebang to postscripts 2023-02-28 15:43:03 -05:00
Obihörnchen 108943ee74 Load ipmi_powernv for ppc64 arch 2022-12-09 17:59:34 +01:00
Markus Hilger 4c3404619f Add ipmi_si module to be able to run bmcsetup manually 2022-09-30 15:04:29 +02:00
Mark Gurevich e58074ad4a Update doxcat discovery script to run on Fedora34 generated image 2021-09-30 17:42:07 -04:00