'Attempts to create a port for the instance on the given network.
:param port_client: The client to use to create the port.
:param instance: Create the port for the given instance.
:param network_id: Create the port on the given network.
:param fixed_ip: Optional fixed IP to use from the given network.
:param security_group_ids: Optional list of security group IDs to
apply to the port.
:returns: The created port.
:raises PortLimitExceeded: If neutron fails with an OverQuota error.
:raises NoMoreFixedIps: If neutron fails with
IpAddressGenerationFailure error.
:raises: PortBindingFailed: If port binding failed.'

def _create_port_minimal(self, port_client, instance, network_id, fixed_ip=None, security_group_ids=None):

    port_req_body = {'port': {'device_id': instance.uuid}}
    try:
        if fixed_ip:
            port_req_body['port']['fixed_ips'] = [{'ip_address': str(fixed_ip)}]
        port_req_body['port']['network_id'] = network_id
        port_req_body['port']['admin_state_up'] = True
        port_req_body['port']['tenant_id'] = instance.project_id
        if security_group_ids:
            port_req_body['port']['security_groups'] = security_group_ids
        port_response = port_client.create_port(port_req_body)
        port = port_response['port']
        port_id = port['id']
        try:
            _ensure_no_port_binding_failure(port)
        except exception.PortBindingFailed:
            with excutils.save_and_reraise_exception():
                port_client.delete_port(port_id)
        LOG.debug('Successfully    created    port:    %s', port_id, instance=instance)
        return port
    except neutron_client_exc.InvalidIpForNetworkClient:
        LOG.warning(_LW('Neutron    error:    %(ip)s    is    not    a    valid    IP    address    for    network    %(network_id)s.'), {'ip': fixed_ip, 'network_id': network_id}, instance=instance)
        msg = (_('Fixed    IP    %(ip)s    is    not    a    valid    ip    address    for    network    %(network_id)s.') % {'ip': fixed_ip, 'network_id': network_id})
        raise exception.InvalidInput(reason=msg)
    except neutron_client_exc.IpAddressInUseClient:
        LOG.warning(_LW('Neutron    error:    Fixed    IP    %s    is    already    in    use.'), fixed_ip, instance=instance)
        msg = (_('Fixed    IP    %s    is    already    in    use.') % fixed_ip)
        raise exception.FixedIpAlreadyInUse(message=msg)
    except neutron_client_exc.OverQuotaClient:
        LOG.warning(_LW('Neutron    error:    Port    quota    exceeded    in    tenant:    %s'), port_req_body['port']['tenant_id'], instance=instance)
        raise exception.PortLimitExceeded()
    except neutron_client_exc.IpAddressGenerationFailureClient:
        LOG.warning(_LW('Neutron    error:    No    more    fixed    IPs    in    network:    %s'), network_id, instance=instance)
        raise exception.NoMoreFixedIps(net=network_id)
    except neutron_client_exc.NeutronClientException:
        with excutils.save_and_reraise_exception():
            LOG.exception(_LE('Neutron    error    creating    port    on    network    %s'), network_id, instance=instance)
