If operator wants customized recovery workflow, so here is guidelines mentioned for how to associate custom tasks from Third Party Library along with standard recovery workflows in Masakari.:
from oslo_log import log as logging
from taskflow import task
LOG = logging.getLogger(__name__)
class Noop(task.Task):
def __init__(self, novaclient):
self.novaclient = novaclient
super(Noop, self).__init__()
def execute(self, **kwargs):
LOG.info("Custom task executed successfully..!!")
return
For example, Third Party Library’s setup.cfg will have following entry points
masakari.task_flow.tasks =
custom_pre_task = <custom_task_class_path_from_third_party_library>
custom_main_task = <custom_task_class_path_from_third_party_library>
custom_post_task = <custom_task_class_path_from_third_party_library>
Note: Entry point in Third Party Library’s setup.cfg should have same key as in Masakari setup.cfg for respective failure recovery.
host_auto_failure_recovery_tasks = {
'pre': ['disable_compute_service_task', 'custom_pre_task'],
'main': ['custom_main_task', 'prepare_HA_enabled_instances_task'],
'post': ['evacuate_instances_task', 'custom_post_task']}
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.