]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "VMware: Remove VMDK driver for ESX server"
authorJenkins <jenkins@review.openstack.org>
Thu, 1 Oct 2015 02:56:18 +0000 (02:56 +0000)
committerGerrit Code Review <review@openstack.org>
Thu, 1 Oct 2015 02:56:18 +0000 (02:56 +0000)
1  2 
cinder/volume/drivers/vmware/vmdk.py

index d7024033772b05e5257cb052bf554fa5eefdbb0c,27cd12266e68700d211a82d37e68c9027ac16a2b..e331519babd8805475ed9623d86c6ded0cfd062f
@@@ -1787,54 -1636,36 +1636,36 @@@ class VMwareVcVmdkDriver(driver.VolumeD
          tmp_vmdk_name = uuidutils.generate_uuid()
          with self._temporary_file(suffix=".vmdk",
                                    prefix=tmp_vmdk_name) as tmp_file_path:
 -                LOG.debug("Using temporary file: %(tmp_path)s for restoring "
 -                          "backup: %(backup_id)s.",
 -                          {'tmp_path': tmp_file_path,
 -                           'backup_id': backup['id']})
 -                with open(tmp_file_path, "wb") as tmp_file:
 -                    LOG.debug("Calling backup service to restore backup: "
 -                              "%(backup_id)s to file: %(tmp_path)s.",
 -                              {'backup_id': backup['id'],
 -                               'tmp_path': tmp_file_path})
 -                    backup_service.restore(backup, volume['id'], tmp_file)
 -                    LOG.debug("Backup: %(backup_id)s restored to file: "
 -                              "%(tmp_path)s.",
 -                              {'backup_id': backup['id'],
 -                               'tmp_path': tmp_file_path})
 -                self._restore_backing(context, volume, backing, tmp_file_path,
 -                                      backup['size'] * units.Gi)
 -
 -                if backup['size'] < volume['size']:
 -                    # Current backing size is backup size.
 -                    LOG.debug("Backup size: %(backup_size)d is less than "
 -                              "volume size: %(vol_size)d; extending volume.",
 -                              {'backup_size': backup['size'],
 -                               'vol_size': volume['size']})
 -                    self.extend_volume(volume, volume['size'])
 -
 -                LOG.debug("Backup: %(backup_id)s restored to volume: "
 -                          "%(name)s.",
 +            LOG.debug("Using temporary file: %(tmp_path)s for restoring "
 +                      "backup: %(backup_id)s.",
 +                      {'tmp_path': tmp_file_path,
 +                       'backup_id': backup['id']})
 +            with open(tmp_file_path, "wb") as tmp_file:
 +                LOG.debug("Calling backup service to restore backup: "
 +                          "%(backup_id)s to file: %(tmp_path)s.",
                            {'backup_id': backup['id'],
 -                           'name': volume['name']})
 +                           'tmp_path': tmp_file_path})
 +                backup_service.restore(backup, volume['id'], tmp_file)
 +                LOG.debug("Backup: %(backup_id)s restored to file: "
 +                          "%(tmp_path)s.",
 +                          {'backup_id': backup['id'],
 +                           'tmp_path': tmp_file_path})
 +            self._restore_backing(context, volume, backing, tmp_file_path,
 +                                  backup['size'] * units.Gi)
 +
 +            if backup['size'] < volume['size']:
 +                # Current backing size is backup size.
 +                LOG.debug("Backup size: %(backup_size)d is less than "
 +                          "volume size: %(vol_size)d; extending volume.",
 +                          {'backup_size': backup['size'],
 +                           'vol_size': volume['size']})
 +                self.extend_volume(volume, volume['size'])
 +
 +            LOG.debug("Backup: %(backup_id)s restored to volume: "
 +                      "%(name)s.",
 +                      {'backup_id': backup['id'],
 +                       'name': volume['name']})
  
- class VMwareVcVmdkDriver(VMwareEsxVmdkDriver):
-     """Manage volumes on VMware vCenter server."""
-     # Minimum supported vCenter version.
-     MIN_SUPPORTED_VC_VERSION = dist_version.LooseVersion('5.1')
-     # PBM is enabled only for vCenter versions 5.5 and above
-     PBM_ENABLED_VC_VERSION = dist_version.LooseVersion('5.5')
-     def _do_deprecation_warning(self):
-         # no deprecation warning for vCenter vmdk driver
-         pass
-     def __init__(self, *args, **kwargs):
-         super(VMwareVcVmdkDriver, self).__init__(*args, **kwargs)
-         self._session = None
      @property
      def session(self):
          if not self._session: