2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-04 20:17:58 +00:00
Commit Graph

6831 Commits

Author SHA1 Message Date
Jarrod Johnson 5df20a92ac Merge pull request #292 from Obihoernchen/fix/sdr-init-caching
Do not cache an SDR that failed to build
2026-09-03 08:57:03 -04:00
Markus Hilger 497a7abffb Do not cache an SDR that failed to build
init_sdr assigned self._sdr before initialize() ran, so a failure left the
half built object in the cache. The next call saw a non-None _sdr and handed
back that partial repository rather than trying again.

The visible symptom is a first call raising and the second appearing to
succeed. The real cost is on a bmc where the read fails once: the client
keeps the incomplete sdr for the life of the session and every later sensor
lookup answers from it without complaint.
2026-09-03 02:15:22 +02:00
Jarrod Johnson 7afbbca691 Merge pull request #291 from Obihoernchen/fix/multi-nic-refusal
Say which interfaces a multi-homed BMC has, rather than crash
2026-09-02 10:29:29 -04:00
Jarrod Johnson d4c5fd850a Merge pull request #290 from Obihoernchen/fix/report-failures-not-crashes
Let a failed request report itself
2026-09-02 10:16:16 -04:00
Jarrod Johnson 26c69e6cc0 Merge pull request #289 from Obihoernchen/fix/health-optional-collections
Handle Redfish services that omit optional collections
2026-09-02 10:13:26 -04:00
Jarrod Johnson fb0ecb50f7 Merge pull request #288 from Obihoernchen/fix/parse-fractional-seconds
Read a fractional second as a fraction
2026-09-02 10:12:03 -04:00
Jarrod Johnson 626d9ba15f Merge pull request #287 from Obihoernchen/fix/ipmi-identify-refusal
Say that IPMI cannot read an identify state
2026-09-02 10:10:35 -04:00
Jarrod Johnson 42ac4d064b Merge pull request #286 from Obihoernchen/fix/cli-exit-codes
Set the exit code when a read fails
2026-09-02 10:09:17 -04:00
Jarrod Johnson 514dc32499 Merge pull request #285 from Obihoernchen/fix/crypt-without-stdlib
Run on a Python that has no crypt module
2026-09-02 10:08:14 -04:00
Markus Hilger 9012888cc0 Report a refused XCC web login instead of returning None
get_webclient falls off its end when /api/login answers anything but 200, so
it returned None. wc() passes that back, and thirty of the thirty-four call
sites use it unchecked, so a refused login arrived as "'NoneType' object has
no attribute 'grab_json_response'" from wherever it landed.

Raised where the failure is known, and with the status: 404 is firmware with
no web api, or a Redfish-only capture of one, while 401 is credentials it
will not take. Neither was distinguishable before.

The other four call sites are the inventory reads, and they always did check.
They answer partially when the web interface is out of reach, which is why
nodeinventory still says something useful. They ask through wc_if_available
now, so that tolerance is stated rather than resting on a None.
2026-09-01 23:52:49 +02:00
Markus Hilger 7a7bd758a4 Let a failed request report itself
Two places where the code that exists to explain a failure fails instead, and
the caller is shown the second failure rather than the first.

_do_web_request builds its message from the response body when that body is
not the JSON error document the spec asks for. An html 404 page is exactly
that, the body is bytes, and str + bytes raised TypeError. The status and the
body never reached anyone.

LenovoFirmwareConfig raised a bare Exception when python-lxml and
python-eficompressor are absent. Confluent has no handler for one, so a
missing dependency showed as "Unexpected Error" and hid a message that
already said what to install.

Neither changes what fails, only what the caller is told.
2026-09-01 23:52:49 +02:00
Markus Hilger 1d8dcae6b0 Refuse plainly when a BMC lists no interfaces at all
Same function, one line above. EthernetInterfaces is optional, and when it is
absent the None went into a request and raised TypeError from the url library
rather than saying what was missing.

Kept beside the ambiguous case because the two are one question asked twice.
2026-09-01 23:52:25 +02:00
Markus Hilger 6909d1b5df Say which interfaces a multi-homed BMC has, rather than crash
Dedicated plus shared is how BMCs are built, so several NICs is ordinary.
_get_bmc_nic_url only reaches the count when the address the session came in
on matches none of them, which is what a tunnel or a NAT does, and it then
raised the bare PyghmiException base class.

Confluent has no handler for the base class, so it fell through to the
generic one and showed "Unexpected Error" plus a traceback, for a machine
doing nothing wrong. UnsupportedFunctionality now, which the redfish plugin
already reports plainly and which stays inside PyghmiException.

The message said "does not have exactly one interface" without saying how
many, which ones, or what to do. Every caller takes a name, so it lists the
candidates, and the empty case reads differently from the ambiguous one.
2026-09-01 23:52:25 +02:00
Markus Hilger 26151c506f Read power and boot from a service that has no system
A Redfish service may publish no Systems collection, and power and cooling
equipment does exactly that. sysurl is then None, and get_power and
get_bootdev handed it straight to a request, raising TypeError from inside
the url library.

sysinfo already guarded the same field. Both now ask through _system_url and
get a refusal naming what is missing. DMTF publish three services of this
shape, which is why they sit commented out in inventory-dmtf.yaml.
2026-09-01 23:51:32 +02:00
Markus Hilger 5d5ad821f4 Read health from a service that publishes no PCIe
PCIeDevices and PCIeFunctions are optional, and get_health indexed both
without checking. _get_adp_urls in the same file already spells it
.get('PCIeDevices', []), so these two were the outliers.

Power and cooling equipment has no PCIe at all. The KeyError escaped the
health read and reached the user as "Unexpected Error" with a traceback
behind it. Reproduces offline against DMTF's public-rackmount1 mockup.
2026-09-01 23:51:32 +02:00
Markus Hilger 5d7fadf615 Set the exit code when a read fails
nodesensors and nodeconfig printed an error and exited 0, so
`nodesensors n1 && next-step` ran next-step after the read it guarded had
already failed.

nodesensors had three of these: the per-node branch never set the exit code,
the top-level branch beside it read `exitcode |= exitcode`, and a normal
return from main() fell off the end of the file. nodeconfig accumulates with
|= all through its read path except the last line, which assigned, so a
failed bmc configuration read was discarded by the system read after it.

The fixed branches now match how nodehealth and client.py spell the same
thing.
2026-09-01 23:51:10 +02:00
Markus Hilger 2e7ce63b51 Read a fractional second as a fraction
parse_time read the digits after the decimal point as whole milliseconds, so
'.5' became 5ms instead of 500ms. Only a three digit fraction came out right,
and a BMC may write either.

'.5', '.50' and '.500' are all 500ms now, '.125' is 125ms. Every other format
parse_time accepts is untouched.
2026-09-01 23:51:00 +02:00
Markus Hilger 492bfeb974 Say that IPMI cannot read an identify state
nodeidentify against an IPMI BMC printed the node name, nothing after it, and
exited 0. A script checking the exit code carries on with an empty value,
which is worse than being turned down.

IPMI can set the identify light and has no command to read it back, so aiohmi
has no get_identify. The empty state was a way of not saying so.

The comment above that branch called identify "read-only", which is the
opposite of the truth.
2026-09-01 23:51:00 +02:00
Jarrod Johnson 31d1d38ac6 Make sure that ls reads the actual size without being confsued by symbolic links 2026-09-01 16:35:56 -04:00
Jarrod Johnson 6d0e364f0e Fixes for media based image boot 2026-09-01 16:23:52 -04:00
Jarrod Johnson c8bc59472f Fix missing close quote 2026-09-01 10:41:50 -04:00
Jarrod Johnson 0b4123fcc3 Add keystrokes for nodeconsole -tv
This allows ctrl-alt and windows key.
2026-09-01 10:33:57 -04:00
Jarrod Johnson 6186d940b6 Move hostname setting to pre.sh in suse16
hostname command is not in the initramfs
2026-09-01 10:00:27 -04:00
Markus Hilger 0d2b23de2f Run on a Python that has no crypt module
crypt left the standard library in 3.13 and both imports of it here are
unconditional, so the server does not start on a 3.13 distro that ships no
crypt shim of its own.

legacycrypt and crypt_r both reach the same libcrypt call, tried in that
order because legacycrypt is pure ctypes while crypt_r wants a compiler.
Both were checked byte for byte against the stdlib for the $6$ salts used
here, and a hash written under the stdlib verifies under either, so stored
crypted.* attributes keep working.

Recommends rather than Requires, and only above 3.12: el9 and el10 still
ship the stdlib module, and some 3.13 distros package no candidate at all,
where a hard dependency would make the rpm uninstallable.
2026-09-01 06:03:16 +02:00
Jarrod Johnson 7ba1798848 Fix SUSE16 identity image deployment
First, give an additional grace period in case identity image is slow to appear compared to other disks.

Also, set hostname according to nodename.
2026-08-31 12:05:45 -04:00
Jarrod Johnson 3fdda3adac Merge remote-tracking branch 'lenovo/master' 2026-08-28 15:58:55 -04:00
Jarrod Johnson aec404e134 Normalize scan to async
Also, for lots of pending nodes, yield between nodes for responsiveness
2026-08-28 15:51:13 -04:00
Jarrod Johnson 306fa83fd7 Merge remote-tracking branch 'xcat/master' 2026-08-28 15:50:27 -04:00
Jarrod Johnson e9649dcb0a Normalize async def scan, also break up pending_nodes by yielding 2026-08-28 15:49:51 -04:00
Jarrod Johnson 054ca63600 Fix macmap offload startup concurrency
State of offloader was never checked after acquiring the lock.

Fix by checking with the lock held.

Also, neaten up by putting all the offload startup inside the function to start it up.
2026-08-28 13:23:16 -04:00
Jarrod Johnson 66488f3041 Merge pull request #284 from robertcaliman/fix-linux-7mm-regex
Update string for 7mm to the correct form and change 7mm identification
2026-08-28 09:51:15 -04:00
Robert Caliman 1e57488f0d Add changes for 7mm disk without a RAID volume 2026-08-28 14:30:32 +03:00
Robert Caliman 84cf69ac4f Update string for 7mm to the correct form 2026-08-28 12:44:55 +03:00
Jarrod Johnson 48280ee5d3 Enhance VROC member criteria
Try to propogate form factor of member disk to array.

Also, even if cannot detect m.2, assume a two-member vroc array of nvme is m.2.  Not guaranteed, but most likely.  This is to deal with lack of DMI information indicating the physical form factor.
2026-08-27 16:55:18 -04:00
Jarrod Johnson 2cf9162d6c Relocate onboot.d scripts in media based image 2026-08-27 16:08:59 -04:00
Jarrod Johnson 724818111c Merge pull request #283 from robertcaliman/rcaliman/add-more-m2-models
Add some more RAID models to the PRIORITY_MODELS
2026-08-27 15:49:45 -04:00
Jarrod Johnson b6d10e5e9b Continue to tweak the Media based image boot of a confluent diskless 2026-08-27 15:47:53 -04:00
Robert Caliman 252b644f34 Remove the 16i models 2026-08-27 22:45:08 +03:00
Jarrod Johnson 34e7a10cfc Refer to self instead of non-existant disk 2026-08-27 15:43:17 -04:00
Jarrod Johnson 116d4aeb04 Make m.2 form factor drives a high priority as a matter of course for OS install 2026-08-27 15:41:49 -04:00
Robert Caliman 9c51577652 Add some more RAID models to the PRIORITY_MODELS 2026-08-27 22:39:56 +03:00
Jarrod Johnson 0c89f041e1 Merge pull request #282 from robertcaliman/rcaliman/m2-esxi-fix
Change the getinstalldisk logic to account for M2 standalone disks
2026-08-27 15:30:50 -04:00
Robert Caliman bdfd1ddfe8 Change the getinstalldisk logic to account for M2 standalone disks 2026-08-27 21:27:46 +03:00
Jarrod Johnson 687b8e47e4 Rework ownership/permission staging and cleanup
Directories are left as 'boring' confluent directories to enable staging.

Then the ownership/permssions on directories are fixed up.

Then after completion, make sure ownership is back to boring before asking rmtree.
2026-08-27 11:46:33 -04:00
Jarrod Johnson 1da744fcab Draft media based images
Prepare for media based diskless images
2026-08-26 16:13:34 -04:00
Jarrod Johnson bbad91369f Tighten permissions on netplan files 2026-08-26 15:36:27 -04:00
Jarrod Johnson 6d1733817e Fix empty kernelargs handling 2026-08-25 15:04:47 -04:00
Jarrod Johnson fff6875d33 Limit host based key types used by ansible
By default, ansible prefers to try host based authentication, which is good.

But when it doesn't work, it tries every key attempt, which is normally fine.

However, SSH counts key attempts the same as passwords, so hardening that restirct password attempts are fouled before it can even get to try a public key.  Thus let host based only consume one attempt.
2026-08-25 10:59:29 -04:00
Jarrod Johnson 8a57216803 Block user from naming group/node the same thing
If a node and a group have the same name, things can get very confusing and hard to deal with.
2026-08-25 10:47:39 -04:00
Jarrod Johnson 7a0a2d0e48 Create a copy instead of rename of /etc/hosts
By copying, we leave the /etc/hosts with original ownership/permissions/etc.

Otherwise we create a new /etc/hosts, which is subject to new permissions and such.
2026-08-25 10:35:35 -04:00