'Create a new cache entry for an image.
This assumes that the volume described by volume_ref has already been
created and is in an available state.'

def create_cache_entry(self, context, volume_ref, image_id, image_meta):

    LOG.debug('Creating    new    image-volume    cache    entry    for    image    %(image_id)s    on    %(service)s', {'image_id': image_id, 'service': volume_ref.service_topic_queue})
    image_updated_at = image_meta['updated_at']
    if isinstance(image_updated_at, six.string_types):
        image_updated_at = timeutils.parse_strtime(image_updated_at)
    else:
        image_updated_at = image_updated_at.astimezone(timezone('UTC'))
    cache_entry = self.db.image_volume_cache_create(context, volume_ref.host, volume_ref.cluster_name, image_id, image_updated_at.replace(tzinfo=None), volume_ref.id, volume_ref.size)
    LOG.debug('New    image-volume    cache    entry    created:    %(entry)s.', {'entry': self._entry_to_str(cache_entry)})
    return cache_entry
