Merge "Add glance image colocation feature for Virtuozzo driver"
This commit is contained in:
commit
07a4dd548c
@ -682,6 +682,8 @@ def _validate_file_format(image_data, expected_format):
|
|||||||
def upload_volume(context, image_service, image_meta, volume_path,
|
def upload_volume(context, image_service, image_meta, volume_path,
|
||||||
volume_format='raw', run_as_root=True, compress=True,
|
volume_format='raw', run_as_root=True, compress=True,
|
||||||
store_id=None, base_image_ref=None):
|
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']
|
image_id = image_meta['id']
|
||||||
if image_meta.get('container_format') != 'compressed':
|
if image_meta.get('container_format') != 'compressed':
|
||||||
if (image_meta['disk_format'] == volume_format):
|
if (image_meta['disk_format'] == volume_format):
|
||||||
|
@ -33,6 +33,7 @@ from cinder import interface
|
|||||||
from cinder import utils
|
from cinder import utils
|
||||||
from cinder.volume import configuration
|
from cinder.volume import configuration
|
||||||
from cinder.volume.drivers import remotefs as remotefs_drv
|
from cinder.volume.drivers import remotefs as remotefs_drv
|
||||||
|
from cinder.volume import volume_utils
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -684,11 +685,11 @@ class VZStorageDriver(remotefs_drv.RemoteFSSnapDriver):
|
|||||||
if volume_format == DISK_FORMAT_PLOOP:
|
if volume_format == DISK_FORMAT_PLOOP:
|
||||||
with PloopDevice(self.local_path(volume),
|
with PloopDevice(self.local_path(volume),
|
||||||
execute=self._execute) as dev:
|
execute=self._execute) as dev:
|
||||||
image_utils.upload_volume(context,
|
volume_utils.upload_volume(context,
|
||||||
image_service,
|
image_service,
|
||||||
image_meta,
|
image_meta,
|
||||||
dev,
|
dev,
|
||||||
volume_format='raw')
|
volume)
|
||||||
else:
|
else:
|
||||||
super(VZStorageDriver, self)._copy_volume_to_image(context, volume,
|
super(VZStorageDriver, self)._copy_volume_to_image(context, volume,
|
||||||
image_service,
|
image_service,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user