]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "fix name 'update_volume_status' to 'update_volume_stats'"
authorJenkins <jenkins@review.openstack.org>
Thu, 25 Jul 2013 17:51:41 +0000 (17:51 +0000)
committerGerrit Code Review <review@openstack.org>
Thu, 25 Jul 2013 17:51:41 +0000 (17:51 +0000)
1  2 
cinder/tests/test_volume.py
cinder/volume/driver.py
cinder/volume/drivers/gpfs.py
cinder/volume/drivers/lvm.py
cinder/volume/drivers/storwize_svc.py

Simple merge
Simple merge
Simple merge
index 2a9af298166e3cb09dffaec8c9c7c738202de546,9b26468948a37aa409d60b14d9f1a6986df186ce..a94a9dd0f70a4504463527f77701a64ea803b791
@@@ -538,44 -530,8 +538,44 @@@ class LVMISCSIDriver(LVMVolumeDriver, d
  
          self.tgtadm.remove_iscsi_target(iscsi_target, 0, volume['id'])
  
 +    def migrate_volume(self, ctxt, volume, host):
 +        """Optimize the migration if the destination is on the same server.
 +
 +        If the specified host is another back-end on the same server, and
 +        the volume is not attached, we can do the migration locally without
 +        going through iSCSI.
 +        """
 +        false_ret = (False, None)
 +        if 'location_info' not in host['capabilities']:
 +            return false_ret
 +        info = host['capabilities']['location_info']
 +        try:
 +            (dest_type, dest_hostname, dest_vg) = info.split(':')
 +        except ValueError:
 +            return false_ret
 +        if (dest_type != 'LVMVolumeDriver' or dest_hostname != self.hostname):
 +            return false_ret
 +
 +        self.remove_export(ctxt, volume)
 +        self._create_volume(volume['name'],
 +                            self._sizestr(volume['size']),
 +                            dest_vg)
 +        volutils.copy_volume(self.local_path(volume),
 +                             self.local_path(volume, vg=dest_vg),
 +                             volume['size'],
 +                             execute=self._execute)
 +        self._delete_volume(volume)
 +        model_update = self._create_export(ctxt, volume, vg=dest_vg)
 +
 +        return (True, model_update)
 +
 +    def rename_volume(self, volume, orig_name):
 +        self._execute('lvrename', self.configuration.volume_group,
 +                      orig_name, volume['name'],
 +                      run_as_root=True)
 +
      def get_volume_stats(self, refresh=False):
-         """Get volume status.
+         """Get volume stats.
  
          If 'refresh' is True, run update the stats first.
          """
Simple merge