ironic.drivers.modules.inspector.hooks.raid_device module

class ironic.drivers.modules.inspector.hooks.raid_device.RaidDeviceHook[source]

Bases: InspectionHook

Hook for learning the root device after RAID creation.

This hook can figure out the root device in 2 runs. In the first run, the node’s inventory is saved as usual, and the hook does not do anything. The second run will check the difference between the recently discovered block devices (as reported by the inspection results) and the previously saved ones (from the previously saved inventory). If there is exactly one new block device, its serial number is saved in node.properties under the ‘root_device’ key.

This way, it helps to figure out the root device hint in cases when Ironic doesn’t have enough information to do so otherwise. One such usecase is DRAC RAID configuration, where the BMC doesn’t provide any useful information about the created RAID disks. Using this hook immediately before and after creating the root RAID device will solve the issue of root device hints.