'Create a new image-volume and cache entry for it.
This assumes that the image has already been downloaded and stored
in the volume described by the volume_ref.'

def _create_image_cache_volume_entry(self, ctx, volume_ref, image_id, image_meta):

    image_volume = None
    try:
        if (not self.image_volume_cache.ensure_space(ctx, volume_ref)):
            LOG.warning('Unable    to    ensure    space    for    image-volume    in    cache.    Will    skip    creating    entry    for    image    %(image)s    on    %(service)s.', {'image': image_id, 'service': volume_ref.service_topic_queue})
            return
        image_volume = self._clone_image_volume(ctx, volume_ref, image_meta)
        if (not image_volume):
            LOG.warning('Unable    to    clone    image_volume    for    image    %(image_id)s    will    not    create    cache    entry.', {'image_id': image_id})
            return
        self.image_volume_cache.create_cache_entry(ctx, image_volume, image_id, image_meta)
    except exception.CinderException as e:
        LOG.warning('Failed    to    create    new    image-volume    cache    entry.    Error:    %(exception)s', {'exception': e})
        if image_volume:
            self.delete_volume(ctx, image_volume)
