| Fabric | The Fabric class provides management of multiple nodes. |
| Fabric.add_macaddr | Add a new macaddr to a node/interface in the fabric. |
| Fabric.apply_factory_default_config | Sets the fabric config to factory default |
| Fabric.config_reset | Resets the configuration on all nodes to factory defaults. |
| Fabric.get_boot_order | Gets the boot order from all nodes. |
| Fabric.get_depth_chart | Get the depth_chart for the fabric. |
| Fabric.get_firmware_info | Gets the firmware info from all nodes. |
| Fabric.get_firmware_info_dict | Gets the firmware info from all nodes. |
| Fabric.get_ipaddr_base | The base IPv4 address for a range of static IP addresses used |
| Fabric.get_ipsrc | Return the ipsrc for the fabric. |
| Fabric.get_link_stats | Get the link_stats for each node in the fabric. |
| Fabric.get_link_users_factor | Get the global link users factor for the fabric. |
| Fabric.get_linkmap | Get the linkmap for each node in the fabric. |
| Fabric.get_linkspeed | Get the global linkspeed for the fabric. |
| Fabric.get_linkspeed_policy | Get the global linkspeed policy for the fabric. |
| Fabric.get_mac_addresses | Gets MAC addresses from all nodes. |
| Fabric.get_power | Returns the power status for all nodes. |
| Fabric.get_power_policy | Gets the power policy from all nodes. |
| Fabric.get_routing_table | Get the routing_table for the fabric. |
| Fabric.get_sensors | Gets sensors from all nodes. |
| Fabric.get_server_ip | Get the server IP address from all nodes. The nodes must be powered |
| Fabric.get_ubootenv | Gets the u-boot environment from all nodes. |
| Fabric.get_uplink | Get the uplink for an interface to xmit a packet out of the cluster. |
| Fabric.get_uplink_info | Gets the fabric uplink info. |
| Fabric.get_versions | Gets the version info from all nodes. |
| Fabric.get_versions_dict | Gets the version info from all nodes. |
| Fabric.ipmitool_command | Run an arbitrary IPMItool command on all nodes. |
| Fabric.is_updatable | Checks to see if all nodes can be updated with this fw package. |
| Fabric.mc_reset | Resets the management controller on all nodes. |
| Fabric.nodes | List of nodes in this fabric. |
| Fabric.primary_node | The node to use for fabric config operations. |
| Fabric.rm_macaddr | Remove a macaddr to a node/interface in the fabric. |
| Fabric.set_boot_order | Sets the boot order on all nodes. |
| Fabric.set_ipsrc | Set the ipsrc for the fabric. |
| Fabric.set_link_users_factor | Set the global link users factor for the fabric. |
| Fabric.set_linkspeed | Set the global linkspeed for the fabric. |
| Fabric.set_linkspeed_policy | Set the global linkspeed policy for the fabric. |
| Fabric.set_power | Send an IPMI power command to all nodes. |
| Fabric.set_power_policy | Sets the power policy on all nodes. |
| Fabric.set_uplink | Set the uplink for an interface to xmit a packet out of the cluster. |
| Fabric.tftp | Returns the tftp server for this Fabric. |
| Fabric.update_config | Push out updated configuration data for all nodes in the fabric. |
| Fabric.update_firmware | Updates the firmware on all nodes. |
Bases: object
The Fabric class provides management of multiple nodes.
>>> from cxmanage_api.fabric import Fabric
>>> fabric = Fabric('10.20.1.9')
| Parameters: |
|
|---|
Add a new macaddr to a node/interface in the fabric.
>>> fabric.add_macaddr(3, 1, "66:55:44:33:22:11")
| Parameters: |
|
|---|
Sets the fabric config to factory default
>>> fabric.apply_factory_default_config()
Resets the configuration on all nodes to factory defaults.
>>> fabric.config_reset()
{0: None, 1: None, 2: None, 3: None}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Command object (can get status, etc.). |
|---|
Gets the boot order from all nodes.
>>> fabric.get_boot_order()
{
0: ['disk', 'pxe'],
1: ['disk', 'pxe'],
2: ['disk', 'pxe'],
3: ['disk', 'pxe']
}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Command object (can get status, etc.). |
|---|---|
| Returns: | The boot order of each node on this fabric. |
| Return type: | dictionary or Task |
Get the depth_chart for the fabric.
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Task object (can get status, etc.). |
|---|---|
| Returns: | The depth_chart for the fabric. |
| Return type: | dictionary |
Gets the firmware info from all nodes.
>>> fabric.get_firmware_info()
{
0: [<pyipmi.fw.FWInfo object at 0x2808110>, ...],
1: [<pyipmi.fw.FWInfo object at 0x28080d0>, ...],
2: [<pyipmi.fw.FWInfo object at 0x2808090>, ...],
3: [<pyipmi.fw.FWInfo object at 0x7f35540660d0>, ...]
}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Command object (can get status, etc.). |
|---|---|
| Returns: | THe firmware info for all nodes. |
| Return type: | dictionary or Task |
Gets the firmware info from all nodes.
>>> fabric.get_firmware_info_dict()
{0:
[
#
# Each dictionary (in order) in this list represents the
# corresponding partition information
#
{# Partition 0
'daddr' : '20029000',
'flags' : 'fffffffd',
'in_use' : 'Unknown',
'offset' : '00000000',
'partition' : '00',
'priority' : '0000000c',
'size' : '00005000',
'type' : '02 (S2_ELF)',
'version' : 'v0.9.1'
},
# Partitions 1 - 17
],
#
# Output trimmed for brevity ... The remaining Nodes in the Fabric
# would display all the partition format in the same manner.
#
}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Command object (can get status, etc.). |
|---|---|
| Returns: | The firmware info for all nodes. |
| Return type: | dictionary or Task |
The base IPv4 address for a range of static IP addresses used for the nodes in the fabric
>>> fabric.get_ipaddr_base()
'192.168.100.1'
| Returns: | The first IP address in the range of static IP addresses |
|---|---|
| Return type: | string |
Return the ipsrc for the fabric.
>>> fabric.get_ipsrc()
2
| Returns: | 1 for static, 2 for DHCP |
|---|---|
| Return type: | integer |
Get the link_stats for each node in the fabric.
| Parameters: |
|
|---|---|
| Returns: | The link_stats for each link on each node. |
| Return type: | dictionary |
Get the global link users factor for the fabric. In the partition world this means the link users factor for Configuration 0, Partition 0, Profile 0.
>>> fabric.get_link_users_factor()
1
| Returns: | Link users factor for the fabric. |
|---|---|
| Return type: | integer |
Get the linkmap for each node in the fabric.
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Task object (can get status, etc.). |
|---|---|
| Returns: | The linkmap for each node. |
| Return type: | dectionary |
Get the global linkspeed for the fabric. In the partition world this means the linkspeed for Configuration 0, Partition 0, Profile 0.
>>> fabric.get_linkspeed()
2.5
| Returns: | Linkspeed for the fabric. |
|---|---|
| Return type: | float |
Get the global linkspeed policy for the fabric. In the partition world this means the linkspeed for Configuration 0, Partition 0, Profile 0.
>>> fabric.get_linkspeed_policy()
1
| Returns: | Linkspeed Policy for the fabric. |
|---|---|
| Return type: | integer |
Gets MAC addresses from all nodes.
>>> fabric.get_mac_addresses()
{
0: ['fc:2f:40:3b:ec:40', 'fc:2f:40:3b:ec:41', 'fc:2f:40:3b:ec:42'],
1: ['fc:2f:40:91:dc:40', 'fc:2f:40:91:dc:41', 'fc:2f:40:91:dc:42'],
2: ['fc:2f:40:ab:f7:14', 'fc:2f:40:ab:f7:15', 'fc:2f:40:ab:f7:16'],
3: ['fc:2f:40:88:b3:6c', 'fc:2f:40:88:b3:6d', 'fc:2f:40:88:b3:6e']
}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Task object (can get status, etc.). |
|---|---|
| Returns: | The MAC addresses for each node. |
| Return type: | dictionary |
Returns the power status for all nodes.
>>> fabric.get_power()
{0: False, 1: False, 2: False, 3: False}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Command object (for cmd status, etc.). |
|---|---|
| Returns: | The power status of each node. |
| Return type: | dictionary or Task |
Gets the power policy from all nodes.
>>> fabric.get_power_policy()
{0: 'always-on', 1: 'always-on', 2: 'always-on', 3: 'always-on'}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Command object (can get status, etc.). |
|---|---|
| Returns: | The power policy for all nodes on this fabric. |
| Return type: | dictionary or Task |
Get the routing_table for the fabric.
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Task object (can get status, etc.). |
|---|---|
| Returns: | The routing_table for the fabric. |
| Return type: | dictionary |
Gets sensors from all nodes.
>>> fabric.get_sensors()
{
0: {
'DRAM VDD Current' : <pyipmi.sdr.AnalogSdr object at 0x1a1eb50>,
'DRAM VDD Voltage' : <pyipmi.sdr.AnalogSdr object at 0x1a1ef10>,
'MP Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1a1ec90>,
'Node Power' : <pyipmi.sdr.AnalogSdr object at 0x1a1ed90>,
'TOP Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1a1ecd0>,
'TOP Temp 1' : <pyipmi.sdr.AnalogSdr object at 0x1a1ed50>,
'TOP Temp 2' : <pyipmi.sdr.AnalogSdr object at 0x1a1edd0>,
'Temp 0' : <pyipmi.sdr.AnalogSdr object at 0x1a1ead0>,
'Temp 1' : <pyipmi.sdr.AnalogSdr object at 0x1a1ebd0>,
'Temp 2' : <pyipmi.sdr.AnalogSdr object at 0x1a1ec10>,
'Temp 3' : <pyipmi.sdr.AnalogSdr object at 0x1a1ec50>,
'V09 Current' : <pyipmi.sdr.AnalogSdr object at 0x1a1ef90>,
'V09 Voltage' : <pyipmi.sdr.AnalogSdr object at 0x1a1ee90>,
'V18 Current' : <pyipmi.sdr.AnalogSdr object at 0x1a1ef50>,
'V18 Voltage' : <pyipmi.sdr.AnalogSdr object at 0x1a1ee50>,
'VCORE Current' : <pyipmi.sdr.AnalogSdr object at 0x1a1efd0>,
'VCORE Power' : <pyipmi.sdr.AnalogSdr object at 0x1a1ee10>,
'VCORE Voltage' : <pyipmi.sdr.AnalogSdr object at 0x1a1eed0>
},
#
# Output trimmed for brevity ... The output would be the same
# (format) for the remaining 3 ECMEs on this system.
#
},
Note
| Parameters: |
|
|---|
Get the server IP address from all nodes. The nodes must be powered on for this to work.
>>> fabric.get_server_ip()
{
0: '192.168.100.100',
1: '192.168.100.101',
2: '192.168.100.102',
3: '192.168.100.103'
}
| Parameters: |
|
|---|---|
| Returns: | Server IP addresses for all nodes.. |
| Return type: | dictionary or Task |
Gets the u-boot environment from all nodes.
>>> fabric.get_ubootenv()
{
0: <cxmanage_api.ubootenv.UbootEnv instance at 0x7fc2d4058098>,
1: <cxmanage_api.ubootenv.UbootEnv instance at 0x7fc2d4058908>,
2: <cxmanage_api.ubootenv.UbootEnv instance at 0x7fc2d40582d8>,
3: <cxmanage_api.ubootenv.UbootEnv instance at 0x7fc2d40589e0>
}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Task object (can get status, etc.). |
|---|---|
| Returns: | UBootEnvironment objects for all nodes. |
| Return type: | dictionary or Task |
Get the uplink for an interface to xmit a packet out of the cluster.
>>> fabric.get_uplink(0)
0
| Parameters: | iface (integer) – The interface for the uplink. |
|---|---|
| Returns: | The uplink iface is using. |
| Return type: | integer |
Gets the fabric uplink info.
>>> fabric.get_uplink_info()
{
0: {0: 0, 1: 0, 2: 0}
1: {0: 0, 1: 0, 2: 0}
2: {0: 0, 1: 0, 2: 0}
3: {0: 0, 1: 0, 2: 0}
}
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Task object (can get status, etc.). |
|---|---|
| Returns: | The uplink info for each node. |
| Return type: | dictionary |
Gets the version info from all nodes.
>>> fabric.get_versions()
{
0: <pyipmi.info.InfoBasicResult object at 0x1f74150>,
1: <pyipmi.info.InfoBasicResult object at 0x1f745d0>,
2: <pyipmi.info.InfoBasicResult object at 0x1f743d0>,
3: <pyipmi.info.InfoBasicResult object at 0x1f74650>
}
See also
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Command object (can get status, etc.). |
|---|---|
| Returns: | The basic SoC info for all nodes. |
| Return type: | dictionary or Task |
Gets the version info from all nodes.
>>> fabric.get_versions_dict()
{0:
{
'a9boot_version' : 'v2012.10.16',
'bootlog_version' : 'v0.9.1-39-g7e10987',
'build_number' : '7E10987C',
'card' : 'EnergyCard X02',
'cdb_version' : 'v0.9.1-39-g7e10987',
'dtb_version' : 'v3.6-rc1_cx_2012.10.02',
'header' : 'Calxeda SoC (0x0096CD)',
'soc_version' : 'v0.9.1',
'stage2_version' : 'v0.9.1',
'timestamp' : '1352911670',
'uboot_version' : 'v2012.07_cx_2012.10.29',
'ubootenv_version' : 'v2012.07_cx_2012.10.29',
'version' : 'ECX-1000-v1.7.1'
},
#
# Output trimmed for brevity ... Each remaining Nodes get_versions
# dictionary would be printed.
#
}
See also
| Parameters: | async (boolean) – Flag that determines if the command result (dictionary) is returned or a Task object (can get status, etc.). |
|---|---|
| Returns: | The basic SoC info for all nodes. |
| Return type: | dictionary or Task |
Run an arbitrary IPMItool command on all nodes.
>>> # Gets eth0's MAC Address for each node ...
>>> fabric.ipmitool_command(['cxoem', 'fabric', 'get', 'macaddr',
>>> ...'interface', '0'])
{
0: 'fc:2f:40:3b:ec:40',
1: 'fc:2f:40:91:dc:40',
2: 'fc:2f:40:ab:f7:14',
3: 'fc:2f:40:88:b3:6c'
}
| Parameters: |
|
|---|---|
| Returns: | IPMI command response. |
| Return type: | string |
Checks to see if all nodes can be updated with this fw package.
>>> fabric.is_updatable(package=fwpkg)
{0: True, 1: True, 2: True, 3: True}
| Parameters: |
|
|---|---|
| Returns: | Whether or not a node can be updated with the specified firmware package. |
| Return type: | dictionary or Task |
Resets the management controller on all nodes.
>>> fabric.mc_reset()
| Parameters: |
|
|---|
List of nodes in this fabric.
>>> fabric.nodes
{
0: <cxmanage_api.node.Node object at 0x2052710>,
1: <cxmanage_api.node.Node object at 0x2052790>,
2: <cxmanage_api.node.Node object at 0x2052850>,
3: <cxmanage_api.node.Node object at 0x2052910>
}
Note
| Returns: | A mapping of node ids to node objects. |
|---|---|
| Return type: | dictionary |
The node to use for fabric config operations.
Today, this is always node 0.
>>> fabric.primary_node
<cxmanage_api.node.Node object at 0x210d790>
| Returns: | Node object for primary node |
|---|---|
| Return type: | Node object |
Remove a macaddr to a node/interface in the fabric.
>>> fabric.rm_macaddr(3, 1, "66:55:44:33:22:11")
| Parameters: |
|
|---|
Sets the boot order on all nodes.
>>> fabric.set_boot_order(boot_args=['pxe', 'disk'])
| Parameters: |
|
|---|
Set the ipsrc for the fabric.
>>> fabric.set_ipsrc(2)
| Parameters: | ipsrc_mode (integer) – 1 for static, 2 for DHCP |
|---|
Set the global link users factor for the fabric. In the partition world this means the link users factor for Configuration 0, Partition 0, Profile 0.
>>> fabric.set_link_users_factor(10)
| Parameters: | lu_factor (integer) – Multiplying factor for topological linkspeeds |
|---|
Set the global linkspeed for the fabric. In the partition world this means the linkspeed for Configuration 0, Partition 0, Profile 0.
>>> fabric.set_linkspeed(10)
| Parameters: | linkspeed (float) – Linkspeed specified in Gbps. |
|---|
Set the global linkspeed policy for the fabric. In the partition world this means the linkspeed policy for Configuration 0, Partition 0, Profile 0.
>>> fabric.set_linkspeed_policy(1)
| Parameters: | linkspeed (integer) – Linkspeed Policy. 0: Fixed, 1: Topological |
|---|
Send an IPMI power command to all nodes.
>>> # On ...
>>> fabric.set_power(mode='on')
>>> # Off ...
>>> fabric.set_power(mode='off')
>>> # Sanity check ...
>>> fabric.get_power()
{0: False, 1: False, 2: False, 3: False}
| Parameters: |
|
|---|
Sets the power policy on all nodes.
>>> fabric.set_power_policy(state='always-off')
>>> # Check to see if it took ...
>>> fabric.get_power_policy()
{0: 'always-off', 1: 'always-off', 2: 'always-off', 3: 'always-off'}
| Parameters: |
|
|---|
Set the uplink for an interface to xmit a packet out of the cluster.
>>> fabric.set_uplink(0,0)
| Parameters: |
|
|---|
Returns the tftp server for this Fabric.
>>> fabric.tftp
<cxmanage_api.tftp.InternalTftp object at 0x7f5ebbd20b10>
| Returns: | The tftp server. |
|---|---|
| Return type: | Tftp |
Push out updated configuration data for all nodes in the fabric.
>>> fabric.update_config()
Updates the firmware on all nodes.
>>> fabric.update_firmware(package=fwpkg)
| Parameters: |
|
|---|