Преглед изворни кода

Merge pull request #91 from aznashwan/validation-task-order

Schedule VALIDATE_SOURCE tasks before GET_INSTANCE.
Nashwan Azhari пре 6 година
родитељ
комит
e2cb280066
1 измењених фајлова са 12 додато и 8 уклоњено
  1. 12 8
      coriolis/conductor/rpc/server.py

+ 12 - 8
coriolis/conductor/rpc/server.py

@@ -334,15 +334,17 @@ class ConductorServerEndpoint(object):
         execution.type = constants.EXECUTION_TYPE_REPLICA_EXECUTION
         execution.type = constants.EXECUTION_TYPE_REPLICA_EXECUTION
 
 
         for instance in execution.action.instances:
         for instance in execution.action.instances:
-            get_instance_info_task = self._create_task(
-                instance, constants.TASK_TYPE_GET_INSTANCE_INFO,
-                execution)
-
             validate_replica_source_inputs_task = self._create_task(
             validate_replica_source_inputs_task = self._create_task(
                 instance,
                 instance,
                 constants.TASK_TYPE_VALIDATE_REPLICA_SOURCE_INPUTS,
                 constants.TASK_TYPE_VALIDATE_REPLICA_SOURCE_INPUTS,
                 execution)
                 execution)
 
 
+            get_instance_info_task = self._create_task(
+                instance,
+                constants.TASK_TYPE_GET_INSTANCE_INFO,
+                execution,
+                depends_on=[validate_replica_source_inputs_task.id])
+
             validate_replica_destination_inputs_task = self._create_task(
             validate_replica_destination_inputs_task = self._create_task(
                 instance,
                 instance,
                 constants.TASK_TYPE_VALIDATE_REPLICA_DESTINATION_INPUTS,
                 constants.TASK_TYPE_VALIDATE_REPLICA_DESTINATION_INPUTS,
@@ -728,15 +730,17 @@ class ConductorServerEndpoint(object):
             # to prevent the Replica disks from being cloned:
             # to prevent the Replica disks from being cloned:
             migration.info[instance] = {"clone_disks": False}
             migration.info[instance] = {"clone_disks": False}
 
 
-            get_instance_info_task = self._create_task(
-                instance, constants.TASK_TYPE_GET_INSTANCE_INFO,
-                execution)
-
             validate_migration_source_inputs_task = self._create_task(
             validate_migration_source_inputs_task = self._create_task(
                 instance,
                 instance,
                 constants.TASK_TYPE_VALIDATE_MIGRATION_SOURCE_INPUTS,
                 constants.TASK_TYPE_VALIDATE_MIGRATION_SOURCE_INPUTS,
                 execution)
                 execution)
 
 
+            get_instance_info_task = self._create_task(
+                instance,
+                constants.TASK_TYPE_GET_INSTANCE_INFO,
+                execution,
+                depends_on=[validate_migration_source_inputs_task.id])
+
             validate_migration_destination_inputs_task = self._create_task(
             validate_migration_destination_inputs_task = self._create_task(
                 instance,
                 instance,
                 constants.TASK_TYPE_VALIDATE_MIGRATION_DESTINATION_INPUTS,
                 constants.TASK_TYPE_VALIDATE_MIGRATION_DESTINATION_INPUTS,