[Open Discussion] neutron can create port from network which has no subnet

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

Bug Description

# openstack network create test-network
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2023-04-13T07:31:16Z |
| description | |
| dns_domain | None |
| id | d595860d-e576-4899-882a-8428cfe601f2 |
| ipv4_address_scope | None |
| ipv6_address_scope | None |
| is_default | False |
| is_vlan_transparent | None |
| mtu | 1450 |
| name | test-network |
| port_security_enabled | True |
| project_id | c675870e8b8e48e7a339907b5bcf7c8c |
| provider:network_type | vxlan |
| provider:physical_network | None |
| provider:segmentation_id | 99941 |
| qos_policy_id | None |
| revision_number | 1 |
| router:external | Internal |
| segments | None |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| updated_at | 2023-04-13T07:31:16Z |
+---------------------------+--------------------------------------+

# openstack port create --network d595860d-e576-4899-882a-8428cfe601f2 test-create-port-net-has-no-subnet
+-----------------------+--------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------+
| admin_state_up | UP |
| allowed_address_pairs | |
| binding_host_id | |
| binding_profile | |
| binding_vif_details | |
| binding_vif_type | unbound |
| binding_vnic_type | normal |
| created_at | 2023-04-13T07:35:46Z |
| data_plane_status | None |
| description | |
| device_id | |
| device_owner | |
| dns_assignment | None |
| dns_domain | None |
| dns_name | None |
| extra_dhcp_opts | |
| fixed_ips | |
| id | 1f2e55bc-9e8f-45ca-b16d-d8e32c1c4bb5 |
| mac_address | fa:16:3e:04:18:10 |
| name | test-create-port-net-has-no-subnet |
| network_id | d595860d-e576-4899-882a-8428cfe601f2 |
| port_security_enabled | True |
| project_id | c675870e8b8e48e7a339907b5bcf7c8c |
| qos_policy_id | None |
| revision_number | 2 |
| security_group_ids | a3d879a7-2e72-4b68-960e-cfa20569c2b0 |
| status | DOWN |
| tags | |
| trunk_details | None |
| updated_at | 2023-04-13T07:35:46Z |
+-----------------------+--------------------------------------+

Port has no fixed ips.

Is such behavior is useful? or neutron should disable such creation?

Changed in neutron:
importance: Undecided → Wishlist
Revision history for this message
Lajos Katona (lajos-katona) wrote :

Shall we bring this to drivers meeting?

Revision history for this message
Bence Romsics (bence-romsics) wrote (last edit ):

IIRC creating a port on a network without a subnet was considered a feature at some point in the past. Which was admittedly rarely used, so at some point it got broken. But I believe there was a bug report to restore the ability to do this. I will try to find it.

Most use cases I can imagine are telco-related (I don't know if anybody uses neutron like this today):

* using something other than IP
* using IP, but with so many IP addresses behind one port, that it's a pain to manage it with allowed address pairs.

Maybe Sean was involved with this earlier and may remember more.

update: I found a spec even: https://specs.openstack.org/openstack/neutron-specs/specs/newton/unaddressed-port.html
update2: example for the non-IP use case: I have a vague memory from many years before that somebody wanted to put a telco app on neutron that used TIPC directly over ethernet (https://docs.kernel.org/networking/tipc.html)

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

This topic will be discussed next Friday April 21st during the Neutron drivers meeting [1].

[1]https://wiki.openstack.org/wiki/Meetings/NeutronDrivers#Agenda

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

This proposal has been declined in the Neutron drivers meeting (see meeting logs). The change of the current behaviour of the API is not needed to fix LP#2016198 and could be in use now.

The proposal to fix LP#2016198 is to limit the creation of the "L3HARouterNetwork" DB resource [1][2]. The HA network is created per project. Only one network should be created at once. If we limit in the DB engine the number of "L3HARouterNetwork" per project, by making the "project_id" unique, we'll prevent the race condition.

[1]https://github.com/openstack/neutron/blob/47d070c71e795e41e698cdb278d99dcfb3448bde/neutron/objects/l3_hamode.py#L58
[2]https://github.com/openstack/neutron/blob/master/neutron/db/models/l3ha.py#L62

Changed in neutron:
status: New → Won't Fix
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.