def get_vn_id(kwargs=None, call=None):
    '''
    Returns a virtual network's ID from the given virtual network's name.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt-cloud -f get_vn_id opennebula name=my-vn-name
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The get_vn_id function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    name = kwargs.get('name', None)
    if name is None:
        raise SaltCloudSystemExit(
            'The get_vn_id function requires a name.'
        )

    try:
        ret = list_vns()[name]['id']
    except KeyError:
        raise SaltCloudSystemExit(
            'The VN \'{0}\' could not be found.'.format(name)
        )

    return ret
Returns a virtual network's ID from the given virtual network's name.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt-cloud -f get_vn_id opennebula name=my-vn-name