[RFE] create port by providing parameters subnet_id only

Bug #1797140 reported by LIU Yulong
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Won't Fix
Wishlist
LIU Yulong

Bug Description

It's really simple for neutron server to query the network id when user only supply the subnet_id during the port creation.
But now when you create the port, you need to input the network id everytime.

Changed in neutron:
importance: Undecided → Wishlist
tags: added: rfe
LIU Yulong (dragon889)
Changed in neutron:
assignee: nobody → LIU Yulong (dragon889)
Revision history for this message
Miguel Lavalle (minsel) wrote :

What do you mean? The user creates a port like:

neutron port-create --fixed-ip subnet_id=<subnet-uuid> <net-uuid>

And you propose:

neutron port-create --fixed-ip subnet_id=<subnet-uuid>?

Revision history for this message
Slawek Kaplonski (slaweq) wrote :

I don't think that this is good idea from "ideology" point of view. Port is something what connects device to a network (not to subnet) and IMO this should stay like that.

If You want to make some optimization for Your client lib, You can implement it on client's side as well to make subnet_id enough to create port.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lib (master)

Fix proposed to branch: master
Review: https://review.openstack.org/610335

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/610336

Revision history for this message
Miguel Lavalle (minsel) wrote :

Looking at the patches proposed for this (https://review.openstack.org/#/c/610336 and https://review.openstack.org/#/c/610335/), it seems to me that this an API change, that I don't want to take lightly. In principle, I agree with Slawek: this can be implemented in a client without touching the API

Changed in neutron:
status: In Progress → New
Revision history for this message
LIU Yulong (dragon889) wrote :

Or, we can propose this without API change, since we have that fixed IP input. We can get network id there.

Revision history for this message
Slawek Kaplonski (slaweq) wrote :

LIU: It still would be the API change as now network_id is mandatory during port creation.
Please also note that network_id is required by policy also in: https://github.com/openstack/neutron-lib/blob/master/neutron_lib/api/definitions/port.py#L44
and user can allow create ports for "network_owner" in policy.json file IIRC.
I'm not sure if there is something like "subnet_owner" there.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron-lib (master)

Change abandoned by LIU Yulong (<email address hidden>) on branch: master
Review: https://review.openstack.org/610335
Reason: Add something to the client or sdk may be the proper way for now.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by LIU Yulong (<email address hidden>) on branch: master
Review: https://review.openstack.org/610336
Reason: Add something to the client or sdk may be the proper way for now.

Revision history for this message
LIU Yulong (dragon889) wrote :

Thanks guys, I'll start a client or sdk change later.

Miguel Lavalle (minsel)
Changed in neutron:
status: New → Won't Fix
tags: removed: rfe
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.