2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 19:57:47 +00:00

409 Commits

Author SHA1 Message Date
Jarrod Johnson
e52c0e3405 Improve SOL responsiveness
In a multi-SOL multiplex case, keepalives could
bring the whole thing to a grinding halt.
Fix this by having a way to request raw_command do
'waitall', which is really just running wait_for_rsp
recursively, as used to happen.  This is not done by default
as for normal synchronous requests, it is a much more expensive
approach at scale.  Reserve it for the special case of wait_for_rsp
which should not hang up on any one response going south.

Change-Id: If8890bf959c2376f58c2b36f0445a5b800280b2b
1.0.11
2016-09-16 16:01:43 -04:00
Jarrod Johnson
77d7d373c3 Handle disconnect notification without session
If session no longer exists, do not try to manipulate it's keepalives.
Remove instances of calling the function where it would be redundant.

Change-Id: I2011f8012175ef12ce83eb34fbf4de9650fb157e
1.0.10
2016-09-14 15:18:18 -04:00
Jarrod Johnson
c35781d4cf Fix error behavior when target has no SOL session
When a system did not have any custom keep alive, the
code to mark the esssion broken erroneously tries to
dereference.

Change-Id: Ic4efe3c65ee4c09c97ef9f08dc30603c4c15d872
2016-09-14 13:02:26 -04:00
Jarrod Johnson
657b75cc86 Fix multiple console object behavior
Software could end up creating duplicate console
objects.  Try to adapt by assuring only the most
recently created one is the sol_handler (by using
existing sol_handler to reach old instance).  Also
unhook a keepalive when we go broken.  When the ipmi
session breaks, notify all custom keepalives active,
rather than just the one currently holding SOL session.

Some of these changes in principle may be duplicate, but
it should be more robust this way.

Change-Id: Id8d3869917de3db723a4b6a79e02643345111b3a
2016-09-13 09:18:21 -04:00
Jenkins
b9dde55f49 Merge "Tolerate client reuse of UDP ports" 1.0.9 2016-08-30 18:33:58 +00:00
Jarrod Johnson
e6bad76e94 Tolerate client reuse of UDP ports
If a system runs many ipmi clients, over time
it may reuse UDP ports.  We currently take this
as a sign of an established relationship in
the same manner we have client to server, but
here clients can be ephemeral.  Cope by
clearing out the current session state
and allowing a new session to come alive.

Change-Id: I2496716d535354616461460f47196d733cde1a87
2016-08-30 13:04:49 -04:00
Jarrod Johnson
d912882c35 Fix errors in IPMI server
If a client used a non-zero IPMI sequence
number, honor the number and separate it
from the LUN.  Also, start session sequence
number at 1 when session is established.

Change-Id: Ife4a03965185160b31e5ca70d455db0e301c4d6f
2016-08-30 09:39:39 -04:00
Jarrod Johnson
f142843bca Fix BMC compatibility with Python 2.6
BMC would try to push a bytearray at unpack.  In
python 2.6, this does not work.  Explicitly denote
changing to bytes to be compatible with python 2.6

Change-Id: I1c919a0050cae9f90c50d89abb6a77774db81381
2016-08-29 16:27:49 -04:00
Fabio Dassan
b60810b4c1 Fix raid driver bitmask
The bitmask used to parse the raid driver parameters was reading a wrong
byte for device state entry. Now this problem is fixed - a new entry was
added (ControllerIndex).

Change-Id: I877075f38737ebd386d3b2c18f5ae4ec7dd3d6f2
2016-08-19 14:54:39 -03:00
Jenkins
faa2ab80a4 Merge "Declare strings explicitly as binary" 2016-08-17 12:18:27 +00:00
xiexs
b1658dacba Support NMI in bmc
In the fix Ib7465ace5b370b31dab5334a34f7216170e1ff2b,
we used cold_reset() as NMI, but it is not correct.
According to [1], we should add a new interface to handle
NMI.

[1]https://sourceforge.net/p/ipmitool/source/ci/
   9caa78be38f2bdf1f3c03571f0c7310a1cb486b7/tree/
   include/ipmitool/ipmi_constants.h

Change-Id: I711053704d27a74a29bb6f50ca85666dd2049d65
2016-08-17 03:01:33 -04:00
Jenkins
4508378650 Merge "Implement identify workaround for ThinkServer SD350" 2016-08-15 14:47:01 +00:00
Jarrod Johnson
613222cdf9 Implement identify workaround for ThinkServer SD350
Thinkserver SD350 chassis identify command does not implement
indefinite activation.  Work around by using an OEM command that
does manage that.

Change-Id: Ic83c42ac39dd18fb6c51d025d1c0c58d75161637
2016-08-15 09:29:57 -04:00
Jarrod Johnson
6bbf650031 Declare strings explicitly as binary
Python 3 requires that strings be explicitly
declared as binary if they need to be treated
as such (implicit strings are unicode rather
than ascii)

Change-Id: I17e5d2ef44ffc106c94b95247585130b07d44417
2016-08-12 14:27:12 -04:00
xiexs
4f16d79001 Supports cold reset in bmc
The spec [1] is trying to support nmi, so that
we should also enhance bmc to support it.

[1] I3dc6561ea7cecf8b8d998717fefa9cf8001d0f4c

Change-Id: Ib7465ace5b370b31dab5334a34f7216170e1ff2b
2016-08-03 00:05:52 -04:00
Jenkins
ff29df14ed Merge "Disable futile attempts to correct uncorrectable time" 1.0.8 2016-07-15 12:42:55 +00:00
Jarrod Johnson
657608ca60 Implement Python3 compatibility
Do strictly the changes associated with
supporting Python 3, no functional changes.

Change-Id: I8b12d48504b67b3a51f3d114d0d3c371b67dc9b4
2016-06-21 13:00:29 -04:00
Derek Higgins
98798b2372 Convert data tuple to a list
The data parameter is defaulted to a tuple, to avoid a TypeError
this needs to be converted to a list before it can be concatenated
with another list.

Change-Id: Iba42196e9f9b9315b684a5ceadf16313f13fdd25
2016-06-21 10:58:48 +01:00
Jarrod Johnson
8ac1385f3c Correct firmware inventory issue on IBM M4 servers
Older IMM systems have a slightly different structure.  Tolerate by skipping the
extended storage data when not available.

Change-Id: Ifc5b9de0e87ceb648c3045b357af434b9e8288e5
1.0.7
2016-06-02 14:06:26 -04:00
Jenkins
ab08846805 Merge "Raise incurred exception if appropriate" 1.0.6 2016-05-25 23:35:23 +00:00
Jenkins
d550969f1c Merge "Fix FPC detection for Lenovo Nextscale" 2016-05-25 23:21:59 +00:00
Jarrod Johnson
b7a789b71b Raise incurred exception if appropriate
While fetching eventlog, if a communication problem
occurs, the exception was ignored and code fell through
to unitialized variable.  Fix this by raising if not the
value known to be ignored.

Change-Id: I7785d0b3695abd84a8cac23059c031956877db58
2016-05-25 16:49:07 -04:00
Jarrod Johnson
413e3c0d32 Fix FPC detection for Lenovo Nextscale
Removing the errant FPC id messed up detection of
real FPCs.  Fix the mistake.

Change-Id: I3fb23979429c98e5c20d5c54dbe915175b670ed4
2016-05-25 16:29:04 -04:00
Jarrod Johnson
eb86ea1ff8 Fix KeyError due to lazy use of raw_command
xraw_command is the version intended to be lazily
used, switch to that version to make the SDR code
more robust.

Change-Id: I1e9b799dd21861fa602db6a1d474334e88915c38
2016-05-25 15:06:06 -04:00
Jenkins
d672a82a19 Merge "Remove support for py33/py26" 1.0.5 2016-05-18 12:42:47 +00:00
Jarrod Johnson
9c14606aba Disable futile attempts to correct uncorrectable time
When an anomaly is detected that suggests the event timeline is
uselessly corrupt, abandon all attempts to correct older entries
and skip or verbatim translate remaining time entries.  The notable
scenario is when an older event has a higher timestamp value than
a newer event (time went backwards, or pre-init to normal) without a
clock sync notification to navigate the change.

Change-Id: I31aa9cd04e20fbdb55d7b955db6f6640da9c75a7
2016-05-18 08:41:42 -04:00
Jenkins
622f401f27 Merge "Remove errant IBM nextscale id" 2016-05-17 14:15:43 +00:00
Jarrod Johnson
b9972f684d Remove errant IBM nextscale id
It erroneously matched an M4 *node* rather than FPC.  Avoid
by not listing the errant ID.

Change-Id: Ieb4947658f65a3e9e8063b2d02e0705c03d690b1
2016-05-16 16:09:34 -04:00
Jarrod Johnson
c794fc3780 Fix agentless error on M4 systems
M4 systems do not support agentless, but return
data differently.  Avoid generating an exception
in this scenario.

Change-Id: I2da1fb67d12a71249ba5e3b6be93a57ba66fcab6
2016-05-16 16:04:42 -04:00
Jarrod Johnson
66f50082c2 Add node status checks to FPC sensors
In nextscale, the FPC has some potentially useful data
about node state with explanation.  Model those as
sensors that may appear in nodehealth

Change-Id: I9dd64740c4934d53d577defe9f3cc7b7a61dc499
2016-05-12 16:29:22 -04:00
Jarrod Johnson
941486e6f8 Add Nextscale total power capacity as a sensor
This indicates the sum of power made available by currently installed
and functional PSUs.

Change-Id: Ic8843cba8f58ce0ec3e6ac62a6c8f9a56374b2a8
2016-05-12 11:19:47 -04:00
Jenkins
461e3dd647 Merge "Extend session keepalive" 1.0.4 2016-05-11 19:07:46 +00:00
Jarrod Johnson
8833dcb817 Extend session keepalive
Since the keepalive is retried, there's no reason to try
to be as frequent as half the specified interval.  The
spec allows inactivity timeout as short as 57 seconds, so
the keepalive interval is extended to 50-55 (allowing some
room for retry to hit in case of dropped packet).

Change-Id: I3b08f2cad1f319759cd0cc54a8793ec16d88d82e
2016-05-11 13:24:33 -04:00
Andreas Jaeger
a1725c1a07 Remove unused pngmath Sphinx extension
There's no RST file that uses ".. math" and thus
the pngmath Sphinx extension is not used and can
get removed.

Change-Id: I3ea4b529025c8ac3c4092f3720124647861e6668
2016-05-10 13:56:06 +00:00
Jenkins
d517799899 Merge "Allows BMCs to configure the event loop timeout" 1.0.3 2016-05-09 13:27:10 +00:00
Lucas Alvares Gomes
f06813cd22 Allows BMCs to configure the event loop timeout
This patch is adding a new parameter called "timeout" to the listen()
method of the Bmc class to allow configuring the right timeout for the
IPMI session. The default timeout continues to be 30 seconds, just like
it was when hardcoded.

Change-Id: Ie00d62157eea321747e02492b0a3d1d6ff991024
2016-05-09 11:36:53 +01:00
Jarrod Johnson
c634450230 Add Hardware inventory from Lenovo Agentless
Lenovo System X systems offer up more inventory over agentless.
Provide this data when the possibility presents itself.

Change-Id: Ic377e951b5a6308157891f98dfdad6311337af48
2016-05-06 16:46:48 -04:00
Jarrod Johnson
6f807ebc42 Fix IPMI server functionality
When data steering was implemented to improve
performance, the server component was not updated
to be able to receive steered data.  Update the server
component with the needed interfaces to be compatible
with the performance enhancement.

Change-Id: I251cfaaf80d7ae45b60f03e39a46a683d913396b
1.0.2
2016-05-04 10:40:05 -04:00
Jarrod Johnson
0a51831bf0 Add disk inventory when possible from Lenovo IMM
Agentless data may have information about firmware of
disks.  This commit adds support for reading it when
available.  Note that some devices may not appear,
depending on the drive controller in use and timing
factors.

Change-Id: I24033a4fe7ed056018dab2747e71845fdcaa5cf0
2016-05-02 16:15:55 -04:00
Jarrod Johnson
3fe1b5f60f Cope with empty agentless fields
Some adapters present empty agentless fields.  For
such scenarios, skip enumerating the key.  This avoids
date parsing errors, among other things.

Change-Id: I3df5f1dd320aa2e915760b6d2cae0f04ec5e09c6
1.0.1
2016-05-02 10:16:08 -04:00
Jarrod Johnson
7b59b7759b Briefly cache adapter data
It is frequent that a client may hammer request
for firmware inventory.  To facilitate this use case,
store and reuse data for 30 seconds, so long as the ipmi
session has not changed.

Change-Id: Ia356e3161a2ccf1c717eec09696e265263d8255b
2016-04-29 16:25:14 -04:00
Jarrod Johnson
deded4f295 Add 'Trusted IMM' to IMM inventory
IMM has an active, backup, and trusted image.  Add
info about the trusted image to IMM inventory to
make that clear.

Change-Id: I771cee6831d11c2b7dbc780475582e9030d7e7b6
2016-04-29 11:16:32 -04:00
Jarrod Johnson
120d5f9a82 Passthrough errors when not sent by BMC in MegaRAC
In the 'has_megarac' call, it erroneously was assumed that
any IpmiException reflected the BMC indicating explicitly that
it didn't understand something about the command.  However
IpmiException is frequently used without a code to indicate
some harder error that can't relate to a system return code.
Address this by raising the exception if it didn't have a
BMC error code initialized.  It may be possible to get even
more specific, but somewhat limited because we could be getting
a 'invalid command' or 'invalid command length' or some 0x80
neighborhood error code, some OEM response.  Fortunately
things are limited since this code should only ever fire
against Lenovo equipment, but still keeping things open ended.

Change-Id: Ia84d1474f7d6787d162c6c7ef448f269d826cc2a
1.0.0
2016-04-25 09:28:41 -04:00
Jenkins
d0f51df896 Merge "Change strategy to identify IMM" 2016-04-24 12:19:34 +00:00
Jarrod Johnson
700dd0c752 Change strategy to identify IMM
Other Lenovo equipment uses the 'get build id' command.  This
switches to a facility more specifically designed to indicate
what class of Lenovo service processor is in play.  As a result,
the firmware inventory function has to fend for itself.

Change-Id: Id0354ebd4dbf57a0ff59860df663195b93adba1c
2016-04-24 08:08:36 -04:00
Jarrod Johnson
52e3eb6874 Do not hook generic vendor identifier
A prerelease system was using 7154 vendor id internally,
but this is not going to be the case when released.  Stop
hooking generic value to avoid being overly aggressive.

Change-Id: I19258e226c03b0158c9a4a3430eaa1de33c10648
2016-04-24 07:39:20 -04:00
Jarrod Johnson
6360d54351 Add support for IPv4-only environments
IPv4-only environments may come in two forms.  It
may not even have kernel support for AF_INET6, detect
and tolerate this by fallback to AF_INET.  Secondly,
it may have AF_INET6 support, but not have any IPv6
addresses, including ::1, so fall back to IPv4 localhost
in that scenario.

Change-Id: I9e2f992afa9f6e71d1210701ac53080d8e788028
2016-04-23 10:29:11 -04:00
Jarrod Johnson
8a7a909b2e Add system X firmware information
This commit adds support for fetching extended System X firmware
information.  This includes, as supported by the model,
extended IMM info, backup IMM, UEFI (primary, backup, and pending),
as well as available firmware from agentless system x options.

Change-Id: Iea09af0dd54938dbfe54b64c0a1084cb7ad2264f
2016-04-23 10:12:23 -04:00
Jarrod Johnson
40eb4c014d Be apathetic about endianness of SOL port number
Some implementations are confused on the endianness of SOL port number.
Recognize both 623 and 28418 as the default.  This poses a challenge
should the day come that non-standard port is desired, but it seems
very unlikely for that to come up...

Change-Id: Ib184a9102fd24a0c27d7a3f5adf86b8d1dca22ea
2016-04-13 11:59:05 -04:00
Jarrod Johnson
a01e705ab7 Fix get_health with a NextScale FPC
There was an oversimplified assumption in play.  Provide
a method to enumerate the generated names as well as
the static names.

Change-Id: I08dbaaafd7c607869d185f57bae0ea70ebf1084e
2016-04-12 14:12:06 -04:00