Dmitry Tantsur (Principal Software Engineer, Red Hat)
dtantsur.github.io/talks/mitaka-inspector-status
Bare metal inspection (or introspection[*]) is a process of finding out hardware properties requried for deployment from the node itself.
The bare minimum for inspection in case of Ironic:
[*] in this context we use both words and treat them as synonyms
Uses vendor BMC features.
Pros: quick and reliable. Cons: highly vendor-specific[*]
with limited customization.
Works by booting a ramdisk on the node.
Pros: can collect essentially anything from a wide
selection of hardware. Cons: slow and more fragile.
Implemented by Ironic Inspector.
[*] The Redfish specification might change this situation.
A separate service under the Bare metal project umbrella.
96 commits by 16 contributors from 8 companies.
5 core team members from 4 companies (not counting the main ironic core team).
Allows writing Python plugins, to extend both processing stages:
class RamdiskErrorHook(ironic_inspector.plugins.base.ProcessingHook):
def before_processing(self, introspection_data, **kwargs):
error = introspection_data.get('error')
if error:
raise RuntimeError(_('Ramdisk reported error: %s') % error)
Collectors extend the introspection process at the data collection stage, i.e. during the ramdisk run.
Adding a new collector requires rebuilding the ramdisk image. Enabling an existing collector is possible via the kernel command line.
def collect_cpuinfo(data, failures):
try:
data['cpuinfo'] = open('/proc/cpuinfo', 'rt').read()
except EnvironmentError as exc:
failures.add('Unable to read cpuinfo: %s', exc)
Introduced in the Liberty release.
Collects a huge number of hardware facts from a node.
Requires the hardware Python package on the ramdisk
Enable extra-hardware collector and extra_hardware processing hook to use.
Can also benchmark CPU, main memory and disks. Pass ipa-inspection-benchmarks=cpu,mem,disk to the IPA kernel command line to enable (takes time!).
Allows a user to define actions to run during the introspection data processing.
Uses a simple JSON-based domain-specific language.
{
"conditions": [
{"op": "lt", "field": "inventory.memory.physical_mb",
"value": 1024}
],
"actions": [
{"action": "fail", "message": "memory is too low"}
]
}
Introduced in the Liberty release.
{
"conditions": [
{"op": "contains",
"field": "inventory.system_vendor.manufacturer",
"value": "Awesome Inc"},
{"op": "eq",
"field": "inventory.disks[*].rotational",
"value": false,
"multiple": "all"}
],
"actions": [
{"action": "set-capability", "name": "awesome-ssd",
"value": "true"}
]
}
Sets a given capability for nodes of a specific vendor with all disks not rotational.
Enrolling of new hardware combined with its inspection.
Enabled by setting the node_not_found_hook configuration option to enroll.
Introspection rules can be used to populate power credentials
Introduced in the Mitaka release.
{
"conditions": [
{"op": "contains",
"field": "inventory.system_vendor.manufacturer",
"value": "Dell"},
{"op": "eq", "field": "auto_discovered", "value": true}
],
"actions": [
{"action": "set-attribute", "path": "/driver",
"value": "pxe_drac"},
{"action": "set-attribute", "path": "/driver_info/drac_host",
"value": "{data[inventory][bmc_address]}"},
{"action": "set-attribute", "path": "/driver_info/drac_username",
"value": "root"},
{"action": "set-attribute", "path": "/driver_info/drac_password",
"value": "calvin"},
]
}