ironic_python_agent.numa_inspector module

ironic_python_agent.numa_inspector.collect_numa_topology_info(data, failures)[source]

Collect the NUMA topology information.

The data is gathered from /sys/devices/system/node/node<X> and /sys/class/net/ directories. The information is collected in the form of:

{
  "numa_topology": {
    "ram": [{"numa_node": <numa_node_id>, "size_kb": <memory_in_kb>},
             ...],
    "cpus": [
      {
        "cpu": <cpu_id>, "numa_node": <numa_node_id>,
        "thread_siblings": [<list of sibling threads>]
      },
      ...,
    ],
    "nics": [
      {"name": "<network interface name>", "numa_node": <numa_node_id>},
      ...,
    ]
  }
}
Parameters
  • data – mutable data that we’ll send to inspector

  • failures – AccumulatedFailures object

Returns

None

ironic_python_agent.numa_inspector.get_nodes_cores_info(numa_node_dirs)[source]

Collect the NUMA nodes cpu’s and thread’s information.

NUMA nodes path: /sys/devices/system/node/node<node_id>

Thread dirs path: /sys/devices/system/node/node<node_id>/cpu<thread_id>

CPU id file path: /sys/devices/system/node/node<node_id>/cpu<thread_id>/

topology/core_id

The information is returned in the form of:

"cpus": [
      {
        "cpu": <cpu_id>, "numa_node": <numa_node_id>,
        "thread_siblings": [<list of sibling threads>]
      },
      ...,
    ]
Parameters

numa_node_dirs – A list of NUMA node directories

Raises

IncompatibleNumaFormatError: when unexpected format data in NUMA node

Returns

A list of cpu information with NUMA node id and thread siblings

ironic_python_agent.numa_inspector.get_nodes_memory_info(numa_node_dirs)[source]

Collect the NUMA nodes memory information.

The information is returned in the form of:

"ram": [{"numa_node": <numa_node_id>, "size_kb": <memory_in_kb>}, ...]
Parameters

numa_node_dirs – A list of NUMA node directories

Raises

IncompatibleNumaFormatError: when unexpected format data in NUMA node

Returns

A list of memory information with NUMA node id

ironic_python_agent.numa_inspector.get_nodes_nics_info(nic_device_path)[source]

Collect the NUMA nodes nics information.

The information is returned in the form of:

"nics": [
      {"name": "<network interface name>",
       "numa_node": <numa_node_id>},
      ...,
    ]
Parameters

nic_device_path – nic device directory path

Raises

IncompatibleNumaFormatError: when unexpected format data in NUMA node

Returns

A list of nics information with NUMA node id

ironic_python_agent.numa_inspector.get_numa_node_id(numa_node_dir)[source]

Provides the NUMA node id from NUMA node directory

Parameters

numa_node_dir – NUMA node directory

Raises

IncompatibleNumaFormatError: when unexpected format data in NUMA node dir

Returns

NUMA node id