'Return size of an existing image for manage_existing.
:param snapshot:
snapshot ref info to be set
:param existing_ref:
existing_ref is a dictionary of the form:
{\'source-name\': <name of snapshot>}'

def manage_existing_snapshot_get_size(self, snapshot, existing_ref):

    if (not isinstance(existing_ref, dict)):
        existing_ref = {'source-name': existing_ref}
    if ('source-name' not in existing_ref):
        reason = _('Reference    must    contain    source-name    element.')
        raise exception.ManageExistingInvalidReference(existing_ref=existing_ref, reason=reason)
    volume_name = utils.convert_str(snapshot.volume_name)
    snapshot_name = utils.convert_str(existing_ref['source-name'])
    with RADOSClient(self) as client:
        try:
            rbd_snapshot = self.rbd.Image(client.ioctx, volume_name, snapshot=snapshot_name)
        except self.rbd.ImageNotFound:
            kwargs = {'existing_ref': snapshot_name, 'reason': 'Specified    snapshot    does    not    exist.'}
            raise exception.ManageExistingInvalidReference(**kwargs)
        snapshot_size = rbd_snapshot.size()
        rbd_snapshot.close()
        try:
            convert_size = int(math.ceil((float(snapshot_size) / units.Gi)))
            return convert_size
        except ValueError:
            exception_message = (_('Failed    to    manage    existing    snapshot    %(name)s,    because    reported    size    %(size)s    was    not    a    floating-point    number.') % {'name': snapshot_name, 'size': snapshot_size})
            raise exception.VolumeBackendAPIException(data=exception_message)
