Explorar el Código

Add 'storage_mappings' to conductor call stack.

Nashwan Azhari hace 7 años
padre
commit
7c3d9ae7a1

+ 8 - 5
coriolis/conductor/rpc/client.py

@@ -135,8 +135,9 @@ class ConductorClient(object):
 
     def create_instances_replica(self, ctxt, origin_endpoint_id,
                                  destination_endpoint_id,
-                                 destination_environment,
-                                 instances, network_map, notes=None):
+                                 destination_environment, instances,
+                                 network_map, storage_mappings,
+                                 notes=None):
         return self._client.call(
             ctxt, 'create_instances_replica',
             origin_endpoint_id=origin_endpoint_id,
@@ -144,7 +145,8 @@ class ConductorClient(object):
             destination_environment=destination_environment,
             instances=instances,
             notes=notes,
-            network_map=network_map)
+            network_map=network_map,
+            storage_mappings=storage_mappings)
 
     def get_replicas(self, ctxt, include_tasks_executions=False):
         return self._client.call(
@@ -173,7 +175,7 @@ class ConductorClient(object):
 
     def migrate_instances(self, ctxt, origin_endpoint_id,
                           destination_endpoint_id, destination_environment,
-                          instances, network_map, notes=None,
+                          instances, network_map, storage_mappings, notes=None,
                           skip_os_morphing=False):
         return self._client.call(
             ctxt, 'migrate_instances',
@@ -183,7 +185,8 @@ class ConductorClient(object):
             instances=instances,
             notes=notes,
             skip_os_morphing=skip_os_morphing,
-            network_map=network_map)
+            network_map=network_map,
+            storage_mappings=storage_mappings)
 
     def deploy_replica_instances(self, ctxt, replica_id, clone_disks=False,
                                  force=False, skip_os_morphing=False):

+ 6 - 3
coriolis/conductor/rpc/server.py

@@ -387,7 +387,7 @@ class ConductorServerEndpoint(object):
     def create_instances_replica(self, ctxt, origin_endpoint_id,
                                  destination_endpoint_id,
                                  destination_environment, instances,
-                                 network_map, notes=None):
+                                 network_map, storage_mappings, notes=None):
         origin_endpoint = self.get_endpoint(ctxt, origin_endpoint_id)
         destination_endpoint = self.get_endpoint(ctxt, destination_endpoint_id)
         self._check_endpoints(ctxt, origin_endpoint, destination_endpoint)
@@ -402,6 +402,7 @@ class ConductorServerEndpoint(object):
         replica.info = {}
         replica.notes = notes
         replica.network_map = network_map
+        replica.storage_mappings = storage_mappings
 
         db_api.add_replica(ctxt, replica)
         LOG.info("Replica created: %s", replica.id)
@@ -495,6 +496,7 @@ class ConductorServerEndpoint(object):
         migration.destination_endpoint_id = replica.destination_endpoint_id
         migration.destination_environment = replica.destination_environment
         migration.network_map = replica.network_map
+        migration.storage_mappings = replica.storage_mappings
         migration.instances = instances
         migration.replica = replica
         migration.info = replica.info
@@ -583,8 +585,8 @@ class ConductorServerEndpoint(object):
 
     def migrate_instances(self, ctxt, origin_endpoint_id,
                           destination_endpoint_id, destination_environment,
-                          instances, network_map, skip_os_morphing=False,
-                          notes=None):
+                          instances, network_map, storage_mappings,
+                          skip_os_morphing=False, notes=None):
         origin_endpoint = self.get_endpoint(ctxt, origin_endpoint_id)
         destination_endpoint = self.get_endpoint(ctxt, destination_endpoint_id)
         self._check_endpoints(ctxt, origin_endpoint, destination_endpoint)
@@ -598,6 +600,7 @@ class ConductorServerEndpoint(object):
         migration.destination_endpoint = destination_endpoint
         migration.destination_environment = destination_environment
         migration.network_map = network_map
+        migration.storage_mappings = storage_mappings
         execution = models.TasksExecution()
         execution.status = constants.EXECUTION_STATUS_RUNNING
         execution.number = 1

+ 3 - 3
coriolis/migrations/api.py

@@ -10,12 +10,12 @@ class API(object):
 
     def migrate_instances(self, ctxt, origin_endpoint_id,
                           destination_endpoint_id, destination_environment,
-                          instances, network_map, notes=None,
+                          instances, network_map, storage_mappings, notes=None,
                           skip_os_morphing=False):
         return self._rpc_client.migrate_instances(
             ctxt, origin_endpoint_id, destination_endpoint_id,
-            destination_environment, instances, network_map, notes,
-            skip_os_morphing)
+            destination_environment, instances, network_map, storage_mappings,
+            notes, skip_os_morphing)
 
     def deploy_replica_instances(self, ctxt, replica_id, clone_disks=False,
                                  force=False, skip_os_morphing=False):

+ 4 - 2
coriolis/replicas/api.py

@@ -9,10 +9,12 @@ class API(object):
         self._rpc_client = rpc_client.ConductorClient()
 
     def create(self, ctxt, origin_endpoint_id, destination_endpoint_id,
-               destination_environment, instances, network_map, notes=None):
+               destination_environment, instances, network_map,
+               storage_mappings, notes=None):
         return self._rpc_client.create_instances_replica(
             ctxt, origin_endpoint_id, destination_endpoint_id,
-            destination_environment, instances, network_map, notes)
+            destination_environment, instances, network_map, storage_mappings,
+            notes)
 
     def delete(self, ctxt, replica_id):
         self._rpc_client.delete_replica(ctxt, replica_id)