A Pure python IPMI library
Go to file
Ilya Etingof 524821fa31 Switch to stestr
According to OpenStack summit session [1], stestr is
maintained project to which all OpenStack projects should
migrate.

Let's switch to stestr as other projects have already
moved to it.

Uses environment inclusions which need tox 2.8.1 due to
a bug fix. So increase the tox minversion.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: If6eded0dd802cbdfe49ad72c64004585d4a1484b
2018-08-10 14:36:57 +02:00
bin Update to newer hacking 2018-05-15 11:39:15 -04:00
doc/source Pyghmi does not follow the pep8 standard 2017-06-23 08:37:20 +08:00
playbooks/legacy/tempest-devstack-ironic-pxe_ipmitool-pyghmi-src Do not run functional (API) tests in the CI 2018-05-07 15:46:04 +02:00
pyghmi Fix notification of custom keepalive on broken 2018-08-07 10:57:26 -04:00
zuul.d add lower-constraints 2018-05-16 15:38:38 +02:00
.coveragerc Switch to stestr 2018-08-10 14:36:57 +02:00
.gitignore Add base for unittests and fix docs 2017-01-05 15:52:14 +00:00
.gitreview Update .gitreview for new namespace 2015-10-17 22:36:04 +00:00
.stestr.conf Switch to stestr 2018-08-10 14:36:57 +02:00
.zuul.yaml Update to newer hacking 2018-05-15 11:39:15 -04:00
LICENSE Place project under Apache license 2.0 2013-06-24 14:15:39 -04:00
MANIFEST.in Align to OpenStack Build Standards. 2013-06-30 14:21:20 -04:00
README Install scripts as well as library 2014-05-08 14:06:01 -04:00
README.md Fix bullet points in README.md 2016-10-28 13:57:44 +01:00
buildrpm Implement support for ThinkSystem servers 2017-06-20 13:30:32 -04:00
lower-constraints.txt Switch to stestr 2018-08-10 14:36:57 +02:00
python-pyghmi.spec Require python-cryptography 2018-07-09 09:47:26 -04:00
requirements.txt Switch to stestr 2018-08-10 14:36:57 +02:00
setup.cfg Add base for unittests and fix docs 2017-01-05 15:52:14 +00:00
setup.py Add license parameter to setup.py 2015-12-01 14:30:01 -05:00
test-requirements.txt Switch to stestr 2018-08-10 14:36:57 +02:00
tox.ini Switch to stestr 2018-08-10 14:36:57 +02:00

README.md

pyghmi

Pyghmi is a pure Python (mostly IPMI) server management library.

Building and installing

(These instructions have been tested on CentOS 7)

Clone the repository, generate the RPM and install it:

$ git clone https://github.com/openstack/pyghmi.git
$ cd pyghmi/
$ python setup.py bdist_rpm
$ sudo rpm -ivh dist/pyghmi-*.noarch.rpm

Using

There are a few use examples in the bin folder:

  • fakebmc: simply fakes a BMC that supports a few IPMI commands (useful for testing)
  • pyghmicons: a remote console based on SOL redirection over IPMI
  • pyghmiutil: an IPMI client that supports a few direct uses of pyghmi (also useful for testing and prototyping new features)
  • virshbmc: a BMC emulation wrapper using libvirt

Extending

If you plan on adding support for new features, you'll most likely be interested in adding your methods to pyghmi/ipmi/command.py. See methods such as get_users and set_power for examples of how to use internal mechanisms to implement new features. And please, always document new methods.

Sometimes you may want to implement OEM-specific code. For example, retrieving firmware version information is not a part of standard IPMI, but some servers are known to support it via custom OEM commands. If this is the case, follow these steps:

  • Add your generic retrieval function (stub) to the OEMHandler class in pyghmi/ipmi/oem/generic.py. And please, document its intent, parameters and expected return values.
  • Implement the specific methods that your server supports in subdirectories in the oem folder (consider the lenovo submodule as an example). A OEM folder will contain at least one class inheriting from OEMHandler, and optionally helpers for running and parsing custom OEM commands.
  • Register mapping policies in pyghmi/ipmi/oem/lookup.py so pyghmi knows how to associate a BMC session with the specific OEM code you implemented.

A good way of testing the new feature is using bin/pyghmiutil. Just add an extension for the new feature you just implemented (as a new command) and call it from the command line:

$ IPMIPASSWORD=passw0rd bin/pyghmiutil [BMC IP address] username my_new_feature_command