Log CDM structure before+after executing strategy
In this changeset, I added debug logs to dump the cluster data model copy structure (as XML) before and after the execution of the strategy. By doing so, we can see the cluster data model structure that is expected after the execution of the corresponding action plan. Change-Id: I81c23e148a78d9b176154f7620087a322a5bce28
This commit is contained in:
@@ -479,3 +479,4 @@ class BasicConsolidation(base.ServerConsolidationBaseStrategy):
|
||||
released_compute_nodes_count=self.number_of_released_nodes,
|
||||
instance_migrations_count=self.number_of_migrations,
|
||||
)
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
@@ -230,6 +230,8 @@ class OutletTempControl(base.ThermalOptimizationBaseStrategy):
|
||||
if not self.compute_model:
|
||||
raise wexc.ClusterStateNotDefined()
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
def do_execute(self):
|
||||
# the migration plan will be triggered when the outlet temperature
|
||||
# reaches threshold
|
||||
@@ -284,3 +286,5 @@ class OutletTempControl(base.ThermalOptimizationBaseStrategy):
|
||||
def post_execute(self):
|
||||
self.solution.model = self.compute_model
|
||||
# TODO(v-francoise): Add the indicators to the solution
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
@@ -293,6 +293,8 @@ class UniformAirflow(base.BaseStrategy):
|
||||
if not self.compute_model:
|
||||
raise wexc.ClusterStateNotDefined()
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
def do_execute(self):
|
||||
self.threshold_airflow = self.input_parameters.threshold_airflow
|
||||
self.threshold_inlet_t = self.input_parameters.threshold_inlet_t
|
||||
@@ -345,3 +347,5 @@ class UniformAirflow(base.BaseStrategy):
|
||||
def post_execute(self):
|
||||
self.solution.model = self.compute_model
|
||||
# TODO(v-francoise): Add the indicators to the solution
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
@@ -498,6 +498,8 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy):
|
||||
if not self.compute_model:
|
||||
raise exception.ClusterStateNotDefined()
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
def do_execute(self):
|
||||
"""Execute strategy.
|
||||
|
||||
@@ -548,3 +550,5 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy):
|
||||
released_compute_nodes_count=self.number_of_migrations,
|
||||
instance_migrations_count=self.number_of_released_nodes,
|
||||
)
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
@@ -283,6 +283,8 @@ class WorkloadBalance(base.WorkloadStabilizationBaseStrategy):
|
||||
if not self.compute_model:
|
||||
raise wexc.ClusterStateNotDefined()
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
def do_execute(self):
|
||||
"""Strategy execution phase
|
||||
|
||||
@@ -344,3 +346,5 @@ class WorkloadBalance(base.WorkloadStabilizationBaseStrategy):
|
||||
This can be used to compute the global efficacy
|
||||
"""
|
||||
self.solution.model = self.compute_model
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
@@ -363,7 +363,7 @@ class WorkloadStabilization(base.WorkloadStabilizationBaseStrategy):
|
||||
|
||||
def create_migration_instance(self, mig_instance, mig_source_node,
|
||||
mig_destination_node):
|
||||
"""Create migration VM """
|
||||
"""Create migration VM"""
|
||||
if self.compute_model.migrate_instance(
|
||||
mig_instance, mig_source_node, mig_destination_node):
|
||||
self.add_migration(mig_instance.uuid, 'live',
|
||||
@@ -437,3 +437,5 @@ class WorkloadStabilization(base.WorkloadStabilizationBaseStrategy):
|
||||
This can be used to compute the global efficacy
|
||||
"""
|
||||
self.fill_solution()
|
||||
|
||||
LOG.debug(self.compute_model.to_string())
|
||||
|
||||
Reference in New Issue
Block a user