]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove the export creation during volume creation for migration
authorVincent Hou <sbhou@cn.ibm.com>
Mon, 13 Apr 2015 03:20:35 +0000 (11:20 +0800)
committerVincent Hou <sbhou@cn.ibm.com>
Mon, 13 Apr 2015 03:22:19 +0000 (11:22 +0800)
Since create_export was moved from create_volume to
initialize_connection, the migrate_volume part should change
accordingly.

Change-Id: I42637c5d861670fb125e78918c2b5b2b13ea43d4
Closes-bug: #1278289

cinder/volume/drivers/lvm.py
cinder/volume/manager.py

index 9b4d0465ee0f36914945e457a77505670463de3a..6208fbab4842438e06ce287e89a7e97a04d6067a 100644 (file)
@@ -557,7 +557,6 @@ class LVMVolumeDriver(driver.VolumeDriver):
                                   executor=self._execute,
                                   lvm_conf=lvm_conf_file)
 
-            self.remove_export(ctxt, volume)
             self._create_volume(volume['name'],
                                 self._sizestr(volume['size']),
                                 lvm_type,
@@ -570,9 +569,8 @@ class LVMVolumeDriver(driver.VolumeDriver):
                                  self.configuration.volume_dd_blocksize,
                                  execute=self._execute)
             self._delete_volume(volume)
-            model_update = self.create_export(ctxt, volume, vg=dest_vg)
 
-            return (True, model_update)
+            return (True, None)
         else:
             message = (_("Refusing to migrate volume ID: %(id)s. Please "
                          "check your configuration because source and "
index 3adfa8c83a500f250c2b8075690659714ec8c2d0..cf43b6518d136749b57f2bddde5d3aac744b477b 100644 (file)
@@ -1449,16 +1449,7 @@ class VolumeManager(manager.SchedulerDependentManager):
                     updates = {'migration_status': None}
                     if status_update:
                         updates.update(status_update)
-                    try:
-                        model_update = self.driver.create_export(ctxt,
-                                                                 volume_ref)
-                        if model_update:
-                            updates.update(model_update)
-                    except Exception:
-                        LOG.exception(_LE("Failed to create export for "
-                                          "volume: %s"), volume_ref['id'])
-                    finally:
-                        self.db.volume_update(ctxt, volume_ref['id'], updates)
+                    self.db.volume_update(ctxt, volume_ref['id'], updates)
         if not moved:
             try:
                 self._migrate_volume_generic(ctxt, volume_ref, host,
@@ -1468,16 +1459,7 @@ class VolumeManager(manager.SchedulerDependentManager):
                     updates = {'migration_status': None}
                     if status_update:
                         updates.update(status_update)
-                    try:
-                        model_update = self.driver.create_export(ctxt,
-                                                                 volume_ref)
-                        if model_update:
-                            updates.update(model_update)
-                    except Exception:
-                        LOG.exception(_LE("Failed to create export for "
-                                          "volume: %s"), volume_ref['id'])
-                    finally:
-                        self.db.volume_update(ctxt, volume_ref['id'], updates)
+                    self.db.volume_update(ctxt, volume_ref['id'], updates)
 
     @periodic_task.periodic_task
     def _report_driver_status(self, context):