Merge "Add glance image colocation feature for Virtuozzo driver"

This commit is contained in:
Zuul 2020-04-29 21:54:37 +00:00 committed by Gerrit Code Review
commit 07a4dd548c
2 changed files with 8 additions and 5 deletions

View File

@ -682,6 +682,8 @@ def _validate_file_format(image_data, expected_format):
def upload_volume(context, image_service, image_meta, volume_path,
volume_format='raw', run_as_root=True, compress=True,
store_id=None, base_image_ref=None):
# NOTE: You probably want to use volume_utils.upload_volume(),
# not this function.
image_id = image_meta['id']
if image_meta.get('container_format') != 'compressed':
if (image_meta['disk_format'] == volume_format):

View File

@ -33,6 +33,7 @@ from cinder import interface
from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers import remotefs as remotefs_drv
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__)
@ -684,11 +685,11 @@ class VZStorageDriver(remotefs_drv.RemoteFSSnapDriver):
if volume_format == DISK_FORMAT_PLOOP:
with PloopDevice(self.local_path(volume),
execute=self._execute) as dev:
image_utils.upload_volume(context,
image_service,
image_meta,
dev,
volume_format='raw')
volume_utils.upload_volume(context,
image_service,
image_meta,
dev,
volume)
else:
super(VZStorageDriver, self)._copy_volume_to_image(context, volume,
image_service,