Check if nova-service is already disabled

This patch updates VM workload consolidation strategy adding a new
condition to check whether nova-compute service is disabled before
creating the action.

Change-Id: I1accbc7bbd62684dce14ca3b35c92121e923a73a
Closes-Bug: #1591927
This commit is contained in:
Bruno Grazioli 2016-06-17 17:33:40 +02:00
parent 80867703ba
commit b3c2d3af1f
1 changed files with 3 additions and 1 deletions

View File

@ -204,7 +204,9 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy):
:return: None
"""
for hypervisor in model.get_all_hypervisors().values():
if len(model.get_mapping().get_node_vms(hypervisor)) == 0:
if (len(model.get_mapping().get_node_vms(hypervisor)) == 0 and
hypervisor.status !=
hyper_state.HypervisorState.DISABLED.value):
self.add_action_deactivate_hypervisor(hypervisor)
def get_prediction_model(self):