A Pure python IPMI library
Go to file
luyf5 5f58618c3b miss to add field "ControllerIndex" in drive.py
Changes are from:
f107bd2795 (64105) Fix raid drive parameter

Change-Id: I6097e14e62db83a86e4e31ff9cca8e587f252614
2021-09-18 14:38:52 +08:00
doc Do not use openstackdocstheme 2021-02-17 11:05:53 +01:00
playbooks/legacy/tempest-devstack-ironic-pxe_ipmitool-pyghmi-src Replace openstack.org git:// URLs with https:// 2019-03-24 20:35:47 +00:00
pyghmi miss to add field "ControllerIndex" in drive.py 2021-09-18 14:38:52 +08:00
zuul.d Use most recent python tests 2021-04-07 18:13:00 +02:00
.coveragerc Switch to stestr 2018-08-10 14:36:57 +02:00
.gitignore Add more file patterns for git to ignore 2018-08-10 12:42:20 +02:00
.gitreview OpenDev Migration Patch 2019-04-19 19:49:52 +00:00
.stestr.conf Switch to stestr 2018-08-10 14:36:57 +02:00
builddeb Fix building under wheezy 2020-02-20 08:58:24 -05:00
buildrpm Enable package builds without pbr 2019-02-04 15:59:18 -05:00
CONTRIBUTING.rst Update package documentation 2018-08-17 12:04:36 +02:00
LICENSE Place project under Apache license 2.0 2013-06-24 14:15:39 -04:00
makesetup Enable package builds without pbr 2019-02-04 15:59:18 -05:00
MANIFEST.in Align to OpenStack Build Standards. 2013-06-30 14:21:20 -04:00
py27-constraints.txt Reconfigure tox 2021-01-29 15:36:11 +00:00
python-pyghmi.spec Add dateutil requirement for python2 users 2020-06-22 10:13:54 -04:00
python-pyghmi.spec.tmpl Add a spec template for rpm build 2019-09-24 16:33:15 -04:00
README Install scripts as well as library 2014-05-08 14:06:01 -04:00
README.md Fix minor .spec issues 2018-08-17 11:08:56 +02:00
requirements.txt Reconfigure tox 2021-01-29 15:36:11 +00:00
setup.cfg Reconfigure tox 2021-01-29 15:36:11 +00:00
setup.py Refactor console scripts into entry points 2018-08-10 13:56:22 +02:00
setup.py.tmpl Add OEM extensibility framework to pyghmi redfish 2019-04-18 13:58:24 -04:00
test-requirements.txt Reconfigure tox 2021-01-29 15:36:11 +00:00
tox.ini Remove 2.7 from test 2021-04-05 16:56:16 -04:00
wheezy.patch Update the Wheezy patch 2019-02-08 15:22:53 -05:00

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