From: Jenkins Date: Thu, 1 Oct 2015 02:56:18 +0000 (+0000) Subject: Merge "VMware: Remove VMDK driver for ESX server" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3c367411326a509d3764507bd42834cc7872a4ea;p=openstack-build%2Fcinder-build.git Merge "VMware: Remove VMDK driver for ESX server" --- 3c367411326a509d3764507bd42834cc7872a4ea diff --cc cinder/volume/drivers/vmware/vmdk.py index d70240337,27cd12266..e331519ba --- a/cinder/volume/drivers/vmware/vmdk.py +++ b/cinder/volume/drivers/vmware/vmdk.py @@@ -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: