diff --git a/vitrage/notifier/plugins/nova/__init__.py b/vitrage/notifier/plugins/nova/__init__.py index d22bde314..9575afbd1 100644 --- a/vitrage/notifier/plugins/nova/__init__.py +++ b/vitrage/notifier/plugins/nova/__init__.py @@ -20,9 +20,4 @@ OPTS = [ 'nova_notifier.NovaNotifier', help='nova notifier class path', required=True), - cfg.BoolOpt('enable_host_evacuate', default=False, - help='Evacuate a host that is marked as down'), - cfg.BoolOpt('on_shared_storage', default=False, - help='Indicates that all instance files are ' - 'on a shared storage'), ] diff --git a/vitrage/notifier/plugins/nova/nova_notifier.py b/vitrage/notifier/plugins/nova/nova_notifier.py index 26f525e64..a9270959d 100644 --- a/vitrage/notifier/plugins/nova/nova_notifier.py +++ b/vitrage/notifier/plugins/nova/nova_notifier.py @@ -31,15 +31,11 @@ class NovaNotifier(NotifierBase): def __init__(self, conf): super(NovaNotifier, self).__init__(conf) self.client = os_clients.nova_client(conf) - self.enable_evacuate = conf.nova.enable_host_evacuate - self.on_shared_storage = conf.nova.on_shared_storage def process_event(self, data, event_type): if data and data.get(VProps.TYPE) == NOVA_HOST_DATASOURCE: if event_type == NotifierEventTypes.ACTIVATE_MARK_DOWN_EVENT: self._mark_host_down(data.get(VProps.ID), True) - if self.enable_evacuate: - self._evacuate(data.get(VProps.ID)) elif event_type == NotifierEventTypes.DEACTIVATE_MARK_DOWN_EVENT: self._mark_host_down(data.get(VProps.ID), False) @@ -52,29 +48,3 @@ class NovaNotifier(NotifierBase): LOG.info('RESPONSE %s', str(response)) except Exception as e: LOG.exception('Failed to services.force_down - %s', e) - - def _evacuate(self, host_id): - try: - LOG.info('Going to evacuate all instances from host id: %s', - str(host_id)) - hypervisors = self.client.hypervisors.search(host_id, servers=True) - except Exception as e: - LOG.exception('Failed to get hypervisors - %s', e) - return - - for hyper in hypervisors: - if hasattr(hyper, 'servers'): - for server in hyper.servers: - self._evacuate_instance(server) - - def _evacuate_instance(self, server): - try: - LOG.info('Calling Nova servers.evacuate - server: %s, ' - 'on_shared_storage: %s', - str(server), self.on_shared_storage) - response = self.client.servers.evacuate( - server=server['uuid'], - on_shared_storage=self.on_shared_storage) - LOG.info('RESPONSE %s', str(response)) - except Exception as e: - LOG.exception('Failed to evacuate server - %s', e)