RFE: Add hook to skip all cleaning on specific block device to HardwareManager

Bug #2057668 reported by Daniel King
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ironic-python-agent
Triaged
Wishlist
Daniel King

Bug Description

It may occur that a user with a custom hardware manager may wish to programmatically reject all cleaning on a specific block device, including the metadata, at runtime rather than by specifying it in properties.skip_block_devices as a device hint. For instance, a user might wish to check for any drives which contain an lvm and a volume group of a specific name, or they might wish to look for certain files or backups on a server with multiple disks and choose that those block devices should not be cleaned.

Currently, there is already the expectation that a user may wish to skip devices based upon skip_block_devices, which is retrieved from HardwareManager.get_skip_list_from_node(). Unfortunately, this presumes that the user knows ahead of time a device hint which will target the desired nodes. It does not allow for custom checks.

What I am proposing is some sort of hook, and abstract member of HardwareManager, which is called using dispatch_to_managers which can allow specific block devices to not be cleaned.

An example of how this might be done is to extend the functionality already being used by HardwareManager.get_skip_list_from_node(). It would be good to leave that code as is, but create a wrapper function HardwareManager.get_skip_list(self, node, block_devices=None, just_raids=False), which is used in each place where get_skip_list_from_node is called. That new method then calls get_skip_list_from_node to collect its skip_list, but additionally combines the output of a call to dispatch_to_managers to load another new method, get_additional_skip_list(self, node, block_devices=None), which is a new abstract method in HardwareManager returning IncompatibleHardwareMethodError, and the GenericHardwareManager could implement it to return an empty skip_list.

The result would be that new custom HardwareManager classes could add a method get_additional_skip_list to run their own custom code to check the list of devices, and if any are desired to be skipped, they could return them in an array.

Tags: rfe-approved
Revision history for this message
Jay Faulkner (jason-oldos) wrote :

RFE approved during Ironic meeting here: https://meetings.opendev.org/irclogs/%23openstack-ironic/%23openstack-ironic.2024-03-25.log.html#t2024-03-25T15:42:33

Some notes:
- Please ensure a detailed release note comes with the patch
- Please create a new example hardware manager providing a usage example with comments

tags: added: rfe-approved
removed: rfe
Changed in ironic-python-agent:
importance: Undecided → Critical
importance: Critical → Wishlist
status: New → Triaged
Changed in ironic-python-agent:
assignee: nobody → Daniel King (dankingtech)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.