def get_vlan_spec(session, vlan_id):
    """Gets portgroup vlan spec.

    :param session: vCenter soap session
    :param vlan_id: the vlan_id for the port
    :returns: The configuration when a single vlan_id is used for a port
    """
    # Create the spec for the vlan tag
    client_factory = session.vim.client.factory
    spec_ns = 'ns0:VmwareDistributedVirtualSwitchVlanIdSpec'
    vl_spec = client_factory.create(spec_ns)
    vl_spec.vlanId = vlan_id
    vl_spec.inherited = '0'
    return vl_spec