Update nova service state
The primitive ChangeNovaServiceState allows us to change the state of the nova-compute by calling nova api. The state of a nova-compute can be ENABLED or DISABLED, however in the current implementation we use OFFLINE and ONLINE. Update the code to use ENABLED or DISABLED. Change-Id: If3d9726bc5ae980b66c7fd4c5b7986f89d8bc690 Closes-Bug: #1523891
This commit is contained in:
@@ -398,7 +398,7 @@ class BasicConsolidation(base.BaseStrategy):
|
||||
self.add_change_service_state(mig_src_hypervisor.
|
||||
uuid,
|
||||
hyper_state.HypervisorState.
|
||||
OFFLINE.value)
|
||||
DISABLED.value)
|
||||
self.number_of_released_nodes += 1
|
||||
|
||||
def calculate_num_migrations(self, sorted_vms, current_model,
|
||||
@@ -455,10 +455,10 @@ class BasicConsolidation(base.BaseStrategy):
|
||||
count = current_model.get_mapping(). \
|
||||
get_node_vms_from_id(hypervisor_id)
|
||||
if len(count) == 0:
|
||||
if hypervisor.state == hyper_state.HypervisorState.ONLINE:
|
||||
if hypervisor.state == hyper_state.HypervisorState.ENABLED:
|
||||
self.add_change_service_state(hypervisor_id,
|
||||
hyper_state.HypervisorState.
|
||||
OFFLINE.value)
|
||||
DISABLED.value)
|
||||
|
||||
while self.get_allowed_migration_attempts() >= unsuccessful_migration:
|
||||
if not first_migration:
|
||||
|
||||
Reference in New Issue
Block a user