'Creates an image snapshot.'

def _create_image_snapshot(self, volume_name, share, image_id, image_name):

    snapshot_name = (img_prefix + image_id)
    LOG.info('Creating    image    snapshot    %s', snapshot_name)
    (host, path) = self._get_export_ip_path(None, share)
    volume_path = ('%s/%s' % (path, volume_name))
    @utils.synchronized(snapshot_name, external=True)
    def _do_snapshot():
        with self._get_client() as c:
            snapshot_id = c.get_snapshot(image_id)
            if (not snapshot_id):
                snapshot_id = c.create_snapshot(volume_path, image_name, image_id, snapshot_name)
            return snapshot_id
    try:
        return _do_snapshot()
    except Exception as e:
        LOG.warning('Exception    while    creating    image    %(image_id)s    snapshot.    Exception:    %(exc)s', {'image_id': image_id, 'exc': e})
