# vim cinder/volume/flows/manager/create_volume.py ... def_create_from_image(self, context, volume_ref, image_location, image_id, image_meta, image_service, **kwargs): LOG.debug("Cloning %(volume_id)s from image %(image_id)s " " at location %(image_location)s.", {'volume_id': volume_ref['id'], 'image_location': image_location, 'image_id': image_id})
# Create the volume from an image. # # First see if the driver can clone the image directly. # # NOTE (singn): two params need to be returned # dict containing provider_location for cloned volume # and clone status. model_update, cloned = self.driver.clone_image(context, volume_ref, image_location, image_meta, image_service)
# Try and clone the image if we have it set as a glance location. ifnot cloned and'cinder'in CONF.allowed_direct_url_schemes: model_update, cloned = self._clone_image_volume(context, volume_ref, image_location, image_meta)
# Try and use the image cache. should_create_cache_entry = False internal_context = cinder_context.get_internal_tenant_context() ifnot internal_context: LOG.warning(_LW('Unable to get Cinder internal context, will ' 'not use image-volume cache.'))