2
0
mirror of https://opendev.org/x/pyghmi synced 2025-02-14 01:28:54 +00:00

1241 Commits

Author SHA1 Message Date
Jarrod Johnson
a9258c1e9b Add SMM2 VPD to configuration for SMM
Change-Id: Ia7a4b804a645a36c212404f3429c42b26938210e
1.5.45
2022-06-07 13:03:23 -04:00
Jarrod Johnson
5c32d4d11d Add port forwarding over usb to bmc settings
This enables manipluating the feature in XCCs to
allow network connections to forward over USB port.

Change-Id: I577d6952e0dab4b9a9df8b6118fc75ed0173d366
1.5.44
2022-05-26 11:44:17 -04:00
Jarrod Johnson
5f63810884 Allow virtualmedia on Systems instead of Managers
Redfish now allows a system to opt to place virtual media
on system rather than manager.  The rational being that
remote media has to be mapped to specific hosts, and the
manager relationship to that media can be implicit.

Try the system first (more specific) then fallback to traditional
manager location for virtualmedia.

Change-Id: I5d63b5e57572c6a753a2d86adb223335a15a71ea
1.5.43
2022-05-20 07:29:02 -04:00
Jarrod Johnson
d286a8326a Clean up socket on deletion
Some resources are leaked on deletion
of a webclient without explicit close, improve
by destructor.

Change-Id: I91d313125bf79f83c3cd07e12e573b2bdd5a95ef
2022-05-18 16:26:45 -04:00
Jarrod Johnson
582598c2ef Rework the relog logic
Various issues have been associated with trying to
reinitiate a session during a 'timeout' scenario, attempt
to clean up the various scenarios where it wasn't originally
designed to survive across a relogin.

Change-Id: Ifd9c8e98070217a1b0f4a35c8e0851a063b77800
2022-05-17 15:32:37 -04:00
Jarrod Johnson
65c8f4ec32 Execute internal cleanup on logout
If not logged in, continue to skip trying to reach BMC, but
do fire off internal cleanup.

This is technically an oversight, made worse by the recent changes
to 'unlog' as part of retry.

Change-Id: I0825c1f77decb81694f897b904a19a2f59587055
1.5.42
2022-05-11 12:21:08 -04:00
Jarrod Johnson
45dc3bad83 Ignore stub log entries
Some BMCs implement entry logs that are
not actionable.  Trim those out to avoid empty data
for a user to scratch their head at.

Change-Id: I05ea62cdd3a56dfdeea4080774ec5a67a651824f
1.5.41
2022-05-10 08:23:21 -04:00
Jarrod Johnson
68cca2e34f Clean onlogpayload on timeout response
Change-Id: Ic0050140797016f02c7b292bae1ca0f3cd4e8c3a
2022-05-09 15:16:24 -04:00
Jarrod Johnson
64a40abcc3 Handle XCC not sending thermal data in some situations
Treat missing items member as no data to properly move on
from this condition

Change-Id: I14623e513ec91411978019b088e0f9e36889796b
1.5.40
2022-05-09 08:58:53 -04:00
Jarrod Johnson
2a5f9fb7ac Add SMM virtual reseat
Change-Id: I6b9badd2e3e1e13cdf7918cc17b7a715a58a45d8
2022-05-06 09:36:09 -04:00
Jarrod Johnson
a6779e93e1 More aggressively give up on initial connection
Previously, logon retries were not part of the normal
tries and treated separately. Now that
the normal retry logic is in place, a change
is needed to avoid the wait times amplifying.

Change-Id: Ia2e5b4f0790ce4574f17cf7ceb15ebd7a36f8afa
2022-05-05 12:26:12 -04:00
Jarrod Johnson
49973f7474 Go back to trusting XCC health assessment
The health assesment can be much cheaper if the XCC health
assessment is trusted.

The issue would be that if the XCC web shows healthy, but the error LED
is lit, this condition would no longer be seen.

However, the error LED shouldn't be lit unless the XCC detects a fault.
So if such a condition of LED lit without explanation should arise in
the future, it would be better treated as an XCC firmware issue.

Change-Id: I55a4451eda4aba43fcf3d3e8e2307c3ce30b8fcd
1.5.39
2022-04-20 16:41:38 -04:00
Jarrod Johnson
500d31e215 Fix the remote sequence number bug introduced by recent commit
Change-Id: I3d2491fef16329cce4270ef013adc85fb7841af4
1.5.38
2022-04-14 10:35:06 -04:00
Riccardo Pittau
470a0d1471 Fix remseqnumber not initialized
The sequence number is never initialized unless the login already
happened, so we need to check for its existence when retrying failed
login.

Change-Id: Ia2319d4c0255d6ae8616cf0c736aaa30d65e6129
1.5.37
2022-04-07 09:39:56 +02:00
Zuul
af65bac993 Merge "Ensure fresh webclient for SMM interaction" 2022-04-04 20:12:25 +00:00
Jarrod Johnson
6836bfffdd Retry login on dead session
Sometimes a BMC just up and drops an IPMI session without warning.

The only way to recover is to login, so incorporate a login into the
retry logic.

Now a couple of retries are done the 'cheap' way (retransmit) followed
by a full login attempt.

This does mean that SOL sessions are less likely to survive a shared
nic outage during PXE boot or similar,
however we just have to take that hit.

Change-Id: Ica11d29519b1c69cbd151bce9100f8a7517544ca
2022-04-04 15:48:35 -04:00
Jarrod Johnson
15ec552383 Ensure fresh webclient for SMM interaction
Web session being expired should be mitigated by
forcing to start over if the session is more than
30 seconds old.

Change-Id: Iaa2abff9ab401a4e5285ea994028bf5f784ecc40
2022-03-29 09:01:35 -04:00
Jarrod Johnson
4b4ae0eb97 Add water cooled 9-PSU variant
The water cooled chassis has a 9 PSU variant that
must be recognized.

Change-Id: If6b214e0d8e7366f663430a7dc5fcac421c7d9ca
2022-03-02 17:01:22 -05:00
Zuul
2168c171cc Merge "Fix Python2 compat in new SDR cache code" 1.5.36 2022-03-01 13:32:42 +00:00
Jarrod Johnson
37262dd823 Remove the ironic test
It has only ever broken for non-pyghmi reasons,
and consumes a lot of time in the CI.

Change-Id: Ib51410b4d1ceb28f9301e1fa93a72f73ce6ae4e9
2022-03-01 06:51:34 -05:00
Jarrod Johnson
8c07dc6193 Fix Python2 compat in new SDR cache code
Python2 bytes type cannot be compared to number.
Coerce into a bytearray to have python2 treat
them as numbers.

Change-Id: I8522b1eb74f4b7aebfa6a0fa68107a0df947c7f6
2022-03-01 06:30:21 -05:00
Jarrod Johnson
6b43149105 Add check for sharedio on reseat
Reseat returns success even when it
is not performed.  Check for
shared io blocking prior to actually
attempting.  This allows us to catch an error the firmware should have.

Change-Id: I683382236c0dc0683eba69d36e726056782aab10
1.5.35
2022-02-28 11:23:40 -05:00
Jarrod Johnson
adbdc04747 Move away from pickle for cache
Bump the cache version and just move away
from pickle.  Upon closer thought, the
data being retained doesn't warrant a generic
format.

Change-Id: I3ba2b17eb2202cf64c8c0cdbf91addaf1325b5f0
2022-02-23 08:07:07 -05:00
Jarrod Johnson
be58a8ad3e Harden pickling in SDR cache
While a cache is expected to be protected, mitigate
dangers by blocking code from being stored in pickle.

Change-Id: If3b942dd028da8580ec3f74e94081b30446ab8d9
2022-02-22 15:06:19 -05:00
Jarrod Johnson
1b800e3f85 Block FFDC data from FPC
FPC does not implement this feature.

Change-Id: I3aab4983ae48efe6655ccf20ae2cc2fc4e27498e
2022-02-16 17:21:18 -05:00
Jarrod Johnson
51ec034e11 Try iso-8859-1 decode if utf8 fails
Technically, the BMC is in error returning non-utf8 encoded content,
however, of *course* some BMCs fail to do so.  Fallback to iso-8859-1
which will probably have bad data in a value somewhere, but it won't
break the entire parsing.

Change-Id: Id7c3c507a0eeb4c31ca52cfadf6ac77deefa3869
2022-02-15 15:17:50 -05:00
Jarrod Johnson
b5806c3c0a Do not attempt PSU inventory on FPC
FPC does not support the same PSU inventory
that SMM added.

Change-Id: I85961df9d35e99b7bddaedb85eda9d2ad71653ee
2022-02-11 15:38:04 -05:00
Jarrod Johnson
3fcc1d362e Add capping to the Lenovo dense servers
Change-Id: I321a2eed0df49bfc1337af93961425b7f4cd0229
2022-02-11 10:55:15 -05:00
Zuul
3dc4a064c2 Merge "Fix str_to_size logic." 1.5.34 2022-02-09 18:44:05 +00:00
Vlad Spoiala
8a1649df1a Fix str_to_size logic.
Change-Id: I133d1ff24883619a2125320c969b4aabca24e683
2022-02-09 18:12:17 +02:00
Jarrod Johnson
e161caeb2e Have XCC raid configuration proceed with new state
A server may now be in state 3, which allows raid configuration
in addition to state 2.

Change-Id: I5218b9c43391c2c094973d238db526b9fecb8e9e
2022-02-09 09:37:06 -05:00
Jarrod Johnson
dba5fba00f Amend incorrect logic in the redfish push
Somewhere in the back and forth the indentation was
incorrect.

Change-Id: I0556b6891c823e10ee399cc26f078050eed8a5b9
2022-01-28 17:13:24 -05:00
Jarrod Johnson
16de1042ab Have XCC redfish handler use redfish push update
Use redfish push update when supported.

Change-Id: Ief151d8e6be6d0ea5a5c4b250afaf0f32f494bf9
2022-01-28 13:41:52 -05:00
Zuul
521012bdf9 Merge "Detect and use redfish push update" 2022-01-27 23:47:54 +00:00
Jarrod Johnson
db281bb4f0 Detect and use redfish push update
Use redfish updates for newer XCC firmware, for a more straightforward
update procedure.

Change-Id: I5acfb99f2213ccdd987d7362fe154dae22634cca
2022-01-27 17:23:02 -05:00
Zuul
e1e5fa986b Merge "Support newer SMMv2 firmware for PSU" 2022-01-25 14:27:14 +00:00
Zuul
a10ed8cca4 Merge "Adapt to more variants in the capacitystr" 2022-01-25 13:10:32 +00:00
Jarrod Johnson
8c6734b5e8 Support newer SMMv2 firmware for PSU
Change-Id: Id642758f45620db028074474f23cecf23de7a49c
2022-01-25 08:08:04 -05:00
Jarrod Johnson
3b1704bc2f Adapt to more variants in the capacitystr
The capacity str may be GB or GiB or TB or TiB now.
Unfortunately, there's no normalized numeric in the api right now.

Change-Id: Iccfb6e837a0f2d5ac516c3e908c663bbddda2ed3
2022-01-18 12:24:16 -05:00
Jarrod Johnson
fb8b79e40d Fix SMM inventory parameters
Change-Id: Ia909c43c7235b3aa531203aa46de30afab97f88d
2022-01-18 12:21:40 -05:00
Jarrod Johnson
4cfaf03d6c Add iDrac virtual cd/floppy
iDRAC does not support standard
redfish boot devices, provide oem override
in such case to use the OEM interface.

Change-Id: I53d7bb1d82035e621802c20f46000760cc8631a8
1.5.33
2022-01-06 16:03:25 -05:00
Jarrod Johnson
51eebd39fc Update generic redfish remote media for eject/insert
Certain redfish implementation only allow manipulation
of remote media through Actions.  Detect when relevant
Actions are indicated and use them if offered.

Change-Id: I4eac9e5f4edb111f45551280fd98cdbc9c10c178
1.5.32
2022-01-04 11:00:57 -05:00
Jan-Philipp Litza
e2b2f6806b Refactor oemmap lookup
Previously, looking up an unknown OEM resulted in an exception being
logged:

exception while get_oem_handler, oemid:{'device_id': 32, 'device_revision': 1, 'manufacturer_id': 10876, 'product_id': 2414, 'firmware_version': '1.73'}
Traceback (most recent call last):
  File "/omd/sites/plutex/local/lib/python3/pyghmi/ipmi/oem/lookup.py", line 43, in get_oem_handler
    return (oemmap[oemid['manufacturer_id']].OEMHandler(oemid,
KeyError: 10876

So while I was at it, I also reduced duplicate code.

Signed-off-by: Jan-Philipp Litza <jpl@plutex.de>
Change-Id: Ib2483aeb3f92bcafbaa877eb1c0318a385f97474
1.5.31
2021-12-17 15:45:05 +01:00
Jarrod Johnson
3606780826 Better tolerate issues during pause
Unrelated issue can derail an update process. Make pause
unlikely to throw unexpected issues, but print it out
just in case.

Further, give a hint when one specific scenario comes up that was
seen and hard to debug.

Change-Id: I635d3fc8df10b9bee9fc261d88beb7002b689a7e
1.5.30
2021-12-15 09:39:11 -05:00
Zuul
e5d059e389 Merge "remove wrong used ipmicmd in command.py" 2021-12-14 17:40:51 +00:00
Zuul
5b6f52a770 Merge "Fix bmc network configuration over ipv6 client" 2021-12-09 18:23:09 +00:00
Jarrod Johnson
5345a466c6 Fix bmc network configuration over ipv6 client
Change-Id: I62c6f774085a863e28481918d7072faff8594c5e
2021-12-09 11:41:04 -05:00
luyf5
f1ff0a0242 remove wrong used ipmicmd in command.py
Change-Id: Id535d338569caade6c2a32214f64469b33209b53
2021-12-01 11:11:24 +08:00
Zuul
d86b49c104 Merge "ipmi/command.py: Add bridge_request argument to set|get_power" 2021-11-29 12:23:28 +00:00
Jan-Philipp Litza
813de399b5 Fix size of SDR records becoming a float
While receiving the SDR, when the size is uneven, its division by 2
causes it to become a float instead of an integer, leading to a
TypeError later on:

Traceback (most recent call last):
  File "gipmi/sdr.py", line 634, in __init__
    self.read_info()
  File "gipmi/sdr.py", line 665, in read_info
    self.get_sdr()
  File "gipmi/sdr.py", line 740, in get_sdr
    sdrrec = self.ipmicmd.raw_command(netfn=0x0a, command=0x23,
  File "gipmi/command.py", line 500, in raw_command
    rsp = self.ipmi_session.raw_command(netfn=netfn, command=command,
  File "gipmi/private/session.py", line 779, in raw_command
    self._send_ipmi_net_payload(netfn, command, data,
  File "gipmi/private/session.py", line 819, in _send_ipmi_net_payload
    data = bytearray(data)
TypeError: 'float' object cannot be interpreted as an integer

Change-Id: I3e123487b27ef385823b1a20652195c7588f5d6c
2021-11-24 17:01:34 +01:00