openstack cli - create multiple routers/networks with same name in same project

Bug #1762376 reported by Noam Manos
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Undecided
Unassigned

Bug Description

https://bugzilla.redhat.com/show_bug.cgi?id=1565059

Description of problem:

Unlike other openstack cli commands, that prevents duplicate objects creation with same name (returning "Conflict occurred attempting to store ..."), the "router create" command - does allow to create multiple routers with same name in same project.

Version-Release number of selected component:
OSP 13 - 2018-03-20.2

How reproducible:
always

Steps to Reproduce:

(overcloud) [stack@undercloud-0 ~]$
$ openstack project create test_cloud --enable

Conflict occurred attempting to store project - it is not permitted to have two projects with the same name in the same domain : test_cloud. (HTTP 409)

$ openstack user create tester --enable --password testerpass --project test_cloud

Conflict occurred attempting to store user - Duplicate entry found with name tester at domain ID default. (HTTP 409)

$ openstack router create internal_router
...
| id | a2b97aa1-50f7-4e44-abcd-41468998703b |
| name | internal_router |

$ openstack router create internal_router
...
| id | 8c2f09d3-0677-4632-9251-b498d570a96e |
| name | internal_router |

$ openstack router list
+--------------------------------------+-----------------+--------+-------+-------------+-------+----------------------------------+
| ID | Name | Status | State | Distributed | HA | Project |
+--------------------------------------+-----------------+--------+-------+-------------+-------+----------------------------------+
| 8c2f09d3-0677-4632-9251-b498d570a96e | internal_router | ACTIVE | UP | False | False | 676572adef8e41999011e22234871c31 |
| a2b97aa1-50f7-4e44-abcd-41468998703b | internal_router | ACTIVE | UP | False | False | 676572adef8e41999011e22234871c31 |
+--------------------------------------+-----------------+--------+-------+-------------+-------+----------------------------------+

Expected results:

A second attempt to run "openstack router create internal_router" should probably return:

Conflict occurred attempting to store router - Duplicate entry found with name internal_router at project ID test_cloud. (HTTP 409)

Revision history for this message
Noam Manos (n.manos) wrote :

A side note:
"openstack security group create" has the same behaviour - not preventing creation of duplicate security group names. Probably should be fixed too.

Revision history for this message
Brian Haley (brian-haley) wrote :

Neutron has always allowed routers to share the same name, UUIDs should be used when a change to a specific one is required. Same with security groups.

Changing this now would break backwards-compatibility since there are possibly current users that rely on being able to do it, so I don't believe restricting this would be a good idea.

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

You gave as example only project and name from keystone and IMO it's not very good example. AFAIK many other projects allows to create resources with same name, like nova allows to create such VMs, cinder volumes and so on.
AFAIK uuid is unique attribute for each kind of resource and it should be like that IMO.
For me it's not a bug :)

Changed in neutron:
status: New → Invalid
Revision history for this message
Noam Manos (n.manos) wrote :

What about "openstack network create" ?
Is there's any use-case of using multiple networks with same name in same project ?

$ openstack network create int_net
$ openstack network create int_net

(tester) [stack@undercloud-0 ~]$ openstack network list
+--------------------------------------+---------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+---------+--------------------------------------+
| 07eeec4f-59dc-49fe-868c-2b3724b7dfb8 | int_net | |
| 58312e8b-c0c0-41e4-92cc-e41076e08df0 | int_net | |
| 8365e76d-7c58-4110-8f39-d31a06044a6a | nova | 618555d8-ff31-4929-ad68-c5662202adae |
+--------------------------------------+---------+--------------------------------------+

$ openstack network show 58312e8b-c0c0-41e4-92cc-e41076e08df0
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
...
| project_id | 676572adef8e41999011e22234871c31 |

$ openstack network show 07eeec4f-59dc-49fe-868c-2b3724b7dfb8
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
...
| project_id | 676572adef8e41999011e22234871c31 |

Revision history for this message
Noam Manos (n.manos) wrote :

I see,
So why "it is not permitted to have two projects with the same name in the same domain",
But is permitted to have two routers with same name in same project ?

Shouldn't the behaviour be consistent all-over ?

summary: - openstack router create - multiple routers with same name in same
+ openstack cli - create multiple routers/networks with same name in same
project
Revision history for this message
Brian Haley (brian-haley) wrote :

I don't know why two projects are not allowed with the same name, but as Slawek pointed out, there are multiple other projects that allow items with the same, including neutron. It's too late to change it now as users are used to it now, and it would be a backwards-incompatible API change.

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.