File: ipmDevGlobal_cmd.rst

package info (click to toggle)
python-ipmi 0.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,132 kB
  • sloc: python: 12,645; makefile: 2
file content (132 lines) | stat: -rw-r--r-- 5,060 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
IPM Device "Global" Commands
============================

This section describes the high level :abbr:`API (Application Programming Interface)` for the commands that are common to all :abbr:`IPM (Intelligent Platform Management)` devices that follow the :abbr:`IPMI (Intelligent Platform Management Interface)` standard. The `IPMI standard`_ defines the following IPM Device "Global" commands:

+-------------------------------+-----+---------+-----+
| Command                       | O/M | Support | API |
+===============================+=====+=========+=====+
| Get Device ID                 | M   | Yes     | Yes |
+-------------------------------+-----+---------+-----+
| Cold Reset                    | O   | Yes     | Yes |
+-------------------------------+-----+---------+-----+
| Warm Reset                    | O   | Yes     | Yes |
+-------------------------------+-----+---------+-----+
| Get Self Test Results         | M   | Yes     | No  |
+-------------------------------+-----+---------+-----+
| Manufacturing Test On         | O   | Yes     | No  |
+-------------------------------+-----+---------+-----+
| Get ACPI Power State          | O   | No      | No  |
+-------------------------------+-----+---------+-----+
| Set ACPI Power State          | O   | No      | No  |
+-------------------------------+-----+---------+-----+
| Get Device GUID               | O   | No      | No  |
+-------------------------------+-----+---------+-----+

.. note::
 
   - O/M - Optional/Mandatory command as stated by the IPMI standard
   - Support - Supported command by **send_message_with_name** method
   - API - High level API support implemented in this library

Get Device ID Command
~~~~~~~~~~~~~~~~~~~~~

You can retrieve the Intelligent Devices's HW revision, FW/SW revision, and information regarding additional logical device functionality with

+------------------------------+
| **get_device_id()**          |
+------------------------------+

where the returned object has the following attributes shown in the order as appear in the table of the `IPMI standard`_:

  * ``device_id``
  * ``provides_sdrs``
  * ``revision``
  * ``available``
  * ``fw_revision (fw_revision.major, fw_revision.minor)``
  * ``ipmi_version (ipmi_version.major, ipmi_version.minor)``
  * ``supported_functions``
  * ``manufacturer_id``
  * ``product_id``
  * ``aux``

The returned object also has a method ``supports_function(func_name)`` where the argument can be one of the following (not case sensitive):

  * **'sensor'**
  * **'sdr_repository'**
  * **'sel'**
  * **'fru_inventory'**
  * **'ipmb_event_receiver'**
  * **'ipmb_event_generator'**
  * **'bridge'**
  * **'chassis'**

The method returns **'True'** if the given function is supported by the **Target**, otherwise is **'False'**.

For example:

.. code:: python

    device_id = ipmi.get_device_id()
    
    print("--- Printing Device ID ---")
    functions = (
            ('SENSOR', 'Sensor Device', 11),
            ('SDR_REPOSITORY', 'SDR Repository Device', 3),
            ('SEL', 'SEL Device', 14),
            ('FRU_INVENTORY', 'FRU Inventory Device', 4),
            ('IPMB_EVENT_RECEIVER', 'IPMB Event Receiver', 5),
            ('IPMB_EVENT_GENERATOR', 'IPMB Event Generator', 4),
            ('BRIDGE', 'Bridge', 18),
            ('CHASSIS', 'Chassis Device', 10))
    ChkBox=['[ ]','[X]']
    print('''
    Device ID:                  %(device_id)s
    Provides Device SDRs:       %(provides_sdrs)s
    Device Revision:            %(revision)s
    Device Available:           %(available)d
    Firmware Revision:          %(fw_revision)s
    IPMI Version:               %(ipmi_version)s
    Manufacturer ID:            %(manufacturer_id)d (0x%(manufacturer_id)04x)
    Product ID:                 %(product_id)d (0x%(product_id)04x)
    Aux Firmware Rev Info:      %(aux)s
    Additional Device Support: '''[1:-1] % device_id.__dict__)
    for n, s, l in functions:
        if device_id.supports_function(n):
            print('        %s%s%s' % (s,l*' ',ChkBox[1]))
        else:
            print('        %s%s%s' % (s,l*' ',ChkBox[0]))


Cold Reset Command
~~~~~~~~~~~~~~~~~~

This command directs the **Target** to perform a 'Cold Reset' of itself. The device reinitalizes its event, communcation, and sensor funtioncs. Self Test, if implemented, will be also run.

+------------------------------+
| **cold_reset()**             |
+------------------------------+

For example:

.. code:: python

   ipmi.cold_reset()

Warm Reset Command
~~~~~~~~~~~~~~~~~~

This command directs the **Target** to perform a 'Warm Reset' of itself. Communication interfaces are reset, but current configurations of interrupt enables, thresholds, etc. will be left alone, and no Self Test initiated.

+------------------------------+
| **warm_reset()**             |
+------------------------------+

For example:

.. code:: python

   ipmi.warm_reset()

.. _IPMI standard: https://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/ipmi-second-gen-interface-spec-v2-rev1-1.pdf