| Node | A node is a single instance of an ECME. |
| Node.add_macaddr | Add mac address on an interface |
| Node.config_reset | Resets configuration to factory defaults. |
| Node.get_boot_order | Returns the boot order for this node. |
| Node.get_depth_chart | Gets a table indicating the distance from a given node to all other nodes on each fabric link. |
| Node.get_fabric_ipinfo | Gets what ip information THIS node knows about the Fabric. |
| Node.get_fabric_macaddrs | Gets what macaddr information THIS node knows about the Fabric. |
| Node.get_fabric_uplink_info | Gets what uplink information THIS node knows about the Fabric. |
| Node.get_firmware_info | Gets firmware info for each partition on the Node. |
| Node.get_firmware_info_dict | Gets firmware info for each partition on the Node. |
| Node.get_link_stats | Gets the linkstats for the link specified. |
| Node.get_linkmap | Gets the src and destination of each link on a node. |
| Node.get_linkspeed | Get the linkspeed for the node. |
| Node.get_mac_addresses | Gets a dictionary of MAC addresses for this node. The dictionary |
| Node.get_power | Returns the power status for this node. |
| Node.get_power_policy | Return power status reported by IPMI. |
| Node.get_routing_table | Gets the routing table as instantiated in the fabric switch. |
| Node.get_sensors | Get a list of sensor objects that match search criteria. |
| Node.get_sensors_dict | Get a list of sensor dictionaries that match search criteria. |
| Node.get_server_ip | Get the IP address of the Linux server. The server must be powered |
| Node.get_ubootenv | Get the active u-boot environment. |
| Node.get_uplink | Get the uplink a MAC will use when transmitting a packet out of the |
| Node.get_versions | Get version info from this node. |
| Node.get_versions_dict | Get version info from this node. |
| Node.ipmitool_command | Send a raw ipmitool command to the node. |
| Node.is_updatable | Checks to see if the node can be updated with this firmware package. |
| Node.mc_reset | Sends a Master Control reset command to the node. |
| Node.node_id | Returns the numerical ID for this node. |
| Node.rm_macaddr | Remove mac address from an interface |
| Node.set_boot_order | Sets boot-able device order for this node. |
| Node.set_power | Send an IPMI power command to this target. |
| Node.set_power_policy | Set default power state for Linux side. |
| Node.set_uplink | Set the uplink a MAC will use when transmitting a packet out of the |
| Node.tftp_address | Returns the tftp_address (ip:port) that this node is using. |
| Node.update_firmware | Update firmware on this target. |
Bases: object
A node is a single instance of an ECME.
>>> # Typical usage ...
>>> from cxmanage_api.node import Node
>>> node = Node(ip_adress='10.20.1.9', verbose=True)
| Parameters: |
|
|---|
Add mac address on an interface
>>> node.add_macaddr(iface, macaddr)
| Parameters: |
|
|---|---|
| Raises IpmiError: | |
If errors in the command occur with BMC communication. |
|
Resets configuration to factory defaults.
>>> node.config_reset()
| Raises: |
|
|---|
Returns the boot order for this node.
>>> node.get_boot_order()
['pxe', 'disk']
Gets a table indicating the distance from a given node to all other nodes on each fabric link.
| Returns: | Returns a map of target->(neighbor, hops), [other (neighbors,hops)] |
|---|---|
| Return type: | dictionary |
| Raises: |
|
Gets what ip information THIS node knows about the Fabric.
>>> node.get_fabric_ipinfo()
{0: '10.20.1.9', 1: '10.20.2.131', 2: '10.20.0.220', 3: '10.20.2.5'}
| Returns: | Returns a map of node_ids->ip_addresses. |
|---|---|
| Return type: | dictionary |
| Raises: |
|
Gets what macaddr information THIS node knows about the Fabric.
| Returns: | Returns a map of node_ids->ports->mac_addresses. |
|---|---|
| Return type: | dictionary |
| Raises: |
|
Gets what uplink information THIS node knows about the Fabric.
>>> node.get_fabric_uplink_info()
{'0': {'eth0': '0', 'eth1': '0', 'mgmt': '0'},
'1': {'eth0': '0', 'eth1': '0', 'mgmt': '0'},
'2': {'eth0': '0', 'eth1': '0', 'mgmt': '0'},
'3': {'eth0': '0', 'eth1': '0', 'mgmt': '0'},
'4': {'eth0': '0', 'eth1': '0', 'mgmt': '0'}}
| Returns: | Returns a map of {node_id : {interface : uplink}} |
|---|---|
| Return type: | dictionary |
| Raises: |
|
Gets firmware info for each partition on the Node.
>>> node.get_firmware_info()
[<pyipmi.fw.FWInfo object at 0x2019850>,
<pyipmi.fw.FWInfo object at 0x2019b10>,
<pyipmi.fw.FWInfo object at 0x2019610>, ...]
| Returns: | Returns a list of FWInfo objects for each |
|---|---|
| Return type: | list |
| Raises: |
|
Gets firmware info for each partition on the Node.
Note
>>> node.get_firmware_info_dict()
[
{'daddr' : '20029000',
'in_use' : 'Unknown',
'partition' : '00',
'priority' : '0000000c',
'version' : 'v0.9.1',
'flags' : 'fffffffd',
'offset' : '00000000',
'type' : '02 (S2_ELF)',
'size' : '00005000'},
.... # Output trimmed for brevity.
.... # partitions
.... # 1 - 16
{'daddr' : '20029000',
'in_use' : 'Unknown',
'partition' : '17',
'priority' : '0000000b',
'version' : 'v0.9.1',
'flags' : 'fffffffd',
'offset' : '00005000',
'type' : '02 (S2_ELF)',
'size' : '00005000'}
]
| Returns: | Returns a list of FWInfo objects for each |
|---|---|
| Return type: | list |
| Raises: |
|
Gets the linkstats for the link specified.
| Parameters: | link (integer) – The link to get stats for (0-4). |
|---|---|
| Returns: | The linkstats for the link specified. |
| Return type: | dictionary |
| Raises IpmiError: | |
| If the IPMI command fails. | |
Gets the src and destination of each link on a node.
| Returns: | Returns a map of link_id->node_id. |
|---|---|
| Return type: | dictionary |
| Raises: |
|
Get the linkspeed for the node. This returns either the actual linkspeed based on phy controller register settings, or if sent to a primary node, the linkspeed setting for the Profile 0 of the currently active Configuration.
>>> fabric.get_linkspeed()
2.5
| Parameters: |
|
|---|---|
| Returns: | Linkspeed for the fabric.. |
| Return type: | float |
Gets a dictionary of MAC addresses for this node. The dictionary maps each port/interface to a list of MAC addresses for that interface.
>>> node.get_mac_addresses()
{
0: ['fc:2f:40:3b:ec:40'],
1: ['fc:2f:40:3b:ec:41'],
2: ['fc:2f:40:3b:ec:42']
}
| Returns: | MAC Addresses for all interfaces. |
|---|---|
| Return type: | dictionary |
Returns the power status for this node.
>>> # Powered ON system ...
>>> node.get_power()
True
>>> # Powered OFF system ...
>>> node.get_power()
False
| Returns: | The power state of the Node. |
|---|---|
| Return type: | boolean |
Return power status reported by IPMI.
>>> node.get_power_policy()
'always-off'
| Returns: | The Nodes current power policy. |
|---|---|
| Return type: | string |
| Raises IpmiError: | |
| If errors in the command occur with BMC communication. | |
Gets the routing table as instantiated in the fabric switch.
| Returns: | Returns a map of node_id->rt_entries. |
|---|---|
| Return type: | dictionary |
| Raises: |
|
Get a list of sensor objects that match search criteria.
Note
>>> # Get ALL sensors ...
>>> node.get_sensors()
{
'MP Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1e63890>,
'Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1e63410>,
'Temp 1' : <pyipmi.sdr.AnalogSdr object at 0x1e638d0>,
'Temp 2' : <pyipmi.sdr.AnalogSdr object at 0x1e63690>,
'Temp 3' : <pyipmi.sdr.AnalogSdr object at 0x1e63950>,
'VCORE Voltage' : <pyipmi.sdr.AnalogSdr object at 0x1e63bd0>,
'TOP Temp 2' : <pyipmi.sdr.AnalogSdr object at 0x1e63ad0>,
'TOP Temp 1' : <pyipmi.sdr.AnalogSdr object at 0x1e63a50>,
'TOP Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1e639d0>,
'VCORE Current' : <pyipmi.sdr.AnalogSdr object at 0x1e63710>,
'V18 Voltage' : <pyipmi.sdr.AnalogSdr object at 0x1e63b50>,
'V09 Current' : <pyipmi.sdr.AnalogSdr object at 0x1e63990>,
'Node Power' : <pyipmi.sdr.AnalogSdr object at 0x1e63cd0>,
'DRAM VDD Current' : <pyipmi.sdr.AnalogSdr object at 0x1e63910>,
'DRAM VDD Voltage' : <pyipmi.sdr.AnalogSdr object at 0x1e634d0>,
'V18 Current' : <pyipmi.sdr.AnalogSdr object at 0x1e63c50>,
'VCORE Power' : <pyipmi.sdr.AnalogSdr object at 0x1e63c90>,
'V09 Voltage' : <pyipmi.sdr.AnalogSdr object at 0x1e63b90>
}
>>> # Get ANY sensor that 'contains' the substring of search in it ...
>>> node.get_sensors(search='Temp 0')
{
'MP Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1e63810>,
'TOP Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1e63850>,
'Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1e63510>
}
| Parameters: | search (string) – Name of the sensor you wish to search for. |
|---|---|
| Returns: | Sensor information. |
| Return type: | dictionary of pyipmi objects |
Get a list of sensor dictionaries that match search criteria.
>>> node.get_sensors_dict()
{
'DRAM VDD Current':
{
'entity_id' : '7.1',
'event_message_control' : 'Per-threshold',
'lower_critical' : '34.200',
'lower_non_critical' : '34.200',
'lower_non_recoverable' : '34.200',
'maximum_sensor_range' : 'Unspecified',
'minimum_sensor_range' : 'Unspecified',
'negative_hysteresis' : '0.800',
'nominal_reading' : '50.200',
'normal_maximum' : '34.200',
'normal_minimum' : '34.200',
'positive_hysteresis' : '0.800',
'sensor_name' : 'DRAM VDD Current',
'sensor_reading' : '1.200 (+/- 0) Amps',
'sensor_type' : 'Current',
'status' : 'ok',
'upper_critical' : '34.200',
'upper_non_critical' : '34.200',
'upper_non_recoverable' : '34.200'
},
... #
... # Output trimmed for brevity ... many more sensors ...
... #
'VCORE Voltage':
{
'entity_id' : '7.1',
'event_message_control' : 'Per-threshold',
'lower_critical' : '1.100',
'lower_non_critical' : '1.100',
'lower_non_recoverable' : '1.100',
'maximum_sensor_range' : '0.245',
'minimum_sensor_range' : 'Unspecified',
'negative_hysteresis' : '0.020',
'nominal_reading' : '1.000',
'normal_maximum' : '1.410',
'normal_minimum' : '0.720',
'positive_hysteresis' : '0.020',
'sensor_name' : 'VCORE Voltage',
'sensor_reading' : '0 (+/- 0) Volts',
'sensor_type' : 'Voltage',
'status' : 'ok',
'upper_critical' : '0.675',
'upper_non_critical' : '0.695',
'upper_non_recoverable' : '0.650'
}
}
>>> # Get ANY sensor name that has the string 'Temp 0' in it ...
>>> node.get_sensors_dict(search='Temp 0')
{
'MP Temp 0':
{
'entity_id' : '7.1',
'event_message_control' : 'Per-threshold',
'lower_critical' : '2.000',
'lower_non_critical' : '5.000',
'lower_non_recoverable' : '0.000',
'maximum_sensor_range' : 'Unspecified',
'minimum_sensor_range' : 'Unspecified',
'negative_hysteresis' : '4.000',
'nominal_reading' : '25.000',
'positive_hysteresis' : '4.000',
'sensor_name' : 'MP Temp 0',
'sensor_reading' : '0 (+/- 0) degrees C',
'sensor_type' : 'Temperature',
'status' : 'ok',
'upper_critical' : '70.000',
'upper_non_critical' : '55.000',
'upper_non_recoverable' : '75.000'
},
'TOP Temp 0':
{
'entity_id' : '7.1',
'event_message_control' : 'Per-threshold',
'lower_critical' : '2.000',
'lower_non_critical' : '5.000',
'lower_non_recoverable' : '0.000',
'maximum_sensor_range' : 'Unspecified',
'minimum_sensor_range' : 'Unspecified',
'negative_hysteresis' : '4.000',
'nominal_reading' : '25.000',
'positive_hysteresis' : '4.000',
'sensor_name' : 'TOP Temp 0',
'sensor_reading' : '33 (+/- 0) degrees C',
'sensor_type' : 'Temperature',
'status' : 'ok',
'upper_critical' : '70.000',
'upper_non_critical' : '55.000',
'upper_non_recoverable' : '75.000'
},
'Temp 0':
{
'entity_id' : '3.1',
'event_message_control' : 'Per-threshold',
'lower_critical' : '2.000',
'lower_non_critical' : '5.000',
'lower_non_recoverable' : '0.000',
'maximum_sensor_range' : 'Unspecified',
'minimum_sensor_range' : 'Unspecified',
'negative_hysteresis' : '4.000',
'nominal_reading' : '25.000',
'positive_hysteresis' : '4.000',
'sensor_name' : 'Temp 0',
'sensor_reading' : '0 (+/- 0) degrees C',
'sensor_type' : 'Temperature',
'status' : 'ok',
'upper_critical' : '70.000',
'upper_non_critical' : '55.000',
'upper_non_recoverable' : '75.000'
}
}
Note
| Parameters: | search (string) – Name of the sensor you wish to search for. |
|---|---|
| Returns: | Sensor information. |
| Return type: | dictionary of dictionaries |
Get the IP address of the Linux server. The server must be powered on for this to work.
>>> node.get_server_ip()
'192.168.100.100'
| Parameters: |
|
|---|---|
| Returns: | The IP address of the server. |
| Return type: | string |
| Raises: |
|
Get the active u-boot environment.
>>> node.get_ubootenv()
<cxmanage_api.ubootenv.UbootEnv instance at 0x209da28>
| Returns: | U-Boot Environment object. |
|---|---|
| Return type: | UBootEnv |
Get the uplink a MAC will use when transmitting a packet out of the cluster.
>>> fabric.get_uplink(iface=1)
0
| Parameters: | iface (integer) – The interface for the uplink. |
|---|---|
| Returns: | The uplink iface is connected to. |
| Return type: | integer |
| Raises IpmiError: | |
| When any errors are encountered. | |
Get version info from this node.
>>> node.get_versions()
<pyipmi.info.InfoBasicResult object at 0x2019b90>
>>> # Some useful information ...
>>> info.a9boot_version
'v2012.10.16'
>>> info.cdb_version
'v0.9.1'
| Returns: | The results of IPMI info basic command. |
|---|---|
| Return type: | pyipmi.info.InfoBasicResult |
| Raises: |
|
Get version info from this node.
Note
>>> n.get_versions_dict()
{'soc_version' : 'v0.9.1',
'build_number' : '7E10987C',
'uboot_version' : 'v2012.07_cx_2012.10.29',
'ubootenv_version' : 'v2012.07_cx_2012.10.29',
'timestamp' : '1352911670',
'cdb_version' : 'v0.9.1-39-g7e10987',
'header' : 'Calxeda SoC (0x0096CD)',
'version' : 'ECX-1000-v1.7.1',
'bootlog_version' : 'v0.9.1-39-g7e10987',
'a9boot_version' : 'v2012.10.16',
'stage2_version' : 'v0.9.1',
'dtb_version' : 'v3.6-rc1_cx_2012.10.02',
'card' : 'EnergyCard X02'
}
| Returns: | The results of IPMI info basic command. |
|---|---|
| Return type: | dictionary |
| Raises: |
|
Send a raw ipmitool command to the node.
>>> node.ipmitool_command(['cxoem', 'info', 'basic'])
'Calxeda SoC (0x0096CD)\n Firmware Version: ECX-1000-v1.7.1-dirty\n
SoC Version: 0.9.1\n Build Number: A69523DC \n
Timestamp (1351543656): Mon Oct 29 15:47:36 2012'
| Parameters: | ipmitool_args (list) – Arguments to pass to the ipmitool. |
|---|
Checks to see if the node can be updated with this firmware package.
>>> from cxmanage_api.firmware_package import FirmwarePackage
>>> fwpkg = FirmwarePackage('ECX-1000_update-v1.7.1-dirty.tar.gz')
>>> fwpkg.version
'ECX-1000-v1.7.1-dirty'
>>> node.is_updatable(fwpkg)
True
| Returns: | Whether the node is updatable or not. |
|---|---|
| Return type: | boolean |
Sends a Master Control reset command to the node.
>>> node.mc_reset()
| Parameters: | wait (boolean) – Wait for the node to come back up. |
|---|---|
| Raises: |
|
Returns the numerical ID for this node.
>>> node.node_id
0
| Returns: | The ID of this node. |
|---|---|
| Return type: | integer |
Remove mac address from an interface
>>> node.rm_macaddr(iface, macaddr)
| Parameters: |
|
|---|---|
| Raises IpmiError: | |
If errors in the command occur with BMC communication. |
|
Sets boot-able device order for this node.
>>> node.set_boot_order(boot_args=['pxe', 'disk'])
| Parameters: | boot_args (list) – Arguments list to pass on to the uboot environment. |
|---|
Send an IPMI power command to this target.
>>> # To turn the power 'off'
>>> node.set_power(mode='off')
>>> # A quick 'get' to see if it took effect ...
>>> node.get_power()
False
>>> # To turn the power 'on'
>>> node.set_power(mode='on')
| Parameters: | mode (string) – Mode to set the power state to. (‘on’/’off’) |
|---|
Set default power state for Linux side.
>>> # Set the state to 'always-on'
>>> node.set_power_policy(state='always-on')
>>> # A quick check to make sure our setting took ...
>>> node.get_power_policy()
'always-on'
| Parameters: | state (string) – State to set the power policy to. |
|---|
Set the uplink a MAC will use when transmitting a packet out of the cluster.
>>> #
>>> # Set eth0 to uplink 1 ...
>>> #
>>> fabric.set_uplink(uplink=1,iface=0)
| Parameters: |
|
|---|---|
| Raises IpmiError: | |
When any errors are encountered. |
|
Returns the tftp_address (ip:port) that this node is using.
>>> node.tftp_address
'10.20.2.172:35123'
| Returns: | The tftp address and port that this node is using. |
|---|---|
| Return type: | string |
Update firmware on this target.
>>> from cxmanage_api.firmware_package import FirmwarePackage
>>> fwpkg = FirmwarePackage('ECX-1000_update-v1.7.1-dirty.tar.gz')
>>> fwpkg.version
'ECX-1000-v1.7.1-dirty'
>>> node.update_firmware(package=fwpkg)
| Parameters: |
|
|---|---|
| Raises PriorityIncrementError: | |
If the SIMG Header priority cannot be changed. |
|