Create two resources with the same name fails

Bug #1505229 reported by Antoine Eiche
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Undecided
Unassigned
OpenContrail
Fix Committed
Undecided
Unassigned

Bug Description

Two networks with the same name in the same tenant can not be created while this is allowed by neutron. This is also true for routers and maybe for some other kinds of resources.

It fails because fq_name of these two resources are identical.

For instance, we create a first network 'net-default'
$ neutron net-create net-default
If we create a second network with the same name
$ neutron net-create net-default
the following exception is raised:
RefsExistError: ['default-domain', 'demo', 'net-default'] already exists with uuid: 9236330e-8f05-49c7-9a5b-f4343e9638af

Tags: neutronapi
Revision history for this message
Sachin Bansal (sbansal) wrote :

Which neutron plugin are you using? I just tried it on the latest build and it is working as expected:

root@b4s9:/usr/lib/python2.7/dist-packages/schema_transformer# neutron net-create n1
Created a new network:
+-------------------------+-----------------------------------------+
| Field | Value |
+-------------------------+-----------------------------------------+
| admin_state_up | True |
| contrail:fq_name | default-domain |
| | admin |
| | n1-7f17c558-84a2-4e4e-be27-ddca56775134 |
| contrail:instance_count | 0 |
| id | 7f17c558-84a2-4e4e-be27-ddca56775134 |
| name | n1 |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | 618d3788d8e34d548d5465e668b3ab18 |
+-------------------------+-----------------------------------------+
root@b4s9:/usr/lib/python2.7/dist-packages/schema_transformer# neutron net-create n1
\Created a new network:
+-------------------------+-----------------------------------------+
| Field | Value |
+-------------------------+-----------------------------------------+
| admin_state_up | True |
| contrail:fq_name | default-domain |
| | admin |
| | n1-80bac5da-a3e3-45e2-a720-e16a24764313 |
| contrail:instance_count | 0 |
| id | 80bac5da-a3e3-45e2-a720-e16a24764313 |
| name | n1 |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | 618d3788d8e34d548d5465e668b3ab18 |
+-------------------------+-----------------------------------------+

Changed in opencontrail:
status: New → Incomplete
Revision history for this message
Antoine Eiche (lewo-c) wrote : Re: [Bug 1505229] Re: Create two resources with the same name fails
Download full text (3.9 KiB)

Hello Sachin,

I'm using the commit ID 9da9fae96090a299974be5609978c5b05085d6c5 (in
repository https://github.com/juniper/contrail-neutron-plugin).

Strange that you don't reproduce this problem. Edouard Thuleau has also
reproduced it today.

Antoine.

Sachin Bansal <email address hidden> writes:

> Which neutron plugin are you using? I just tried it on the latest build
> and it is working as expected:
>
> root@b4s9:/usr/lib/python2.7/dist-packages/schema_transformer# neutron net-create n1
> Created a new network:
> +-------------------------+-----------------------------------------+
> | Field | Value |
> +-------------------------+-----------------------------------------+
> | admin_state_up | True |
> | contrail:fq_name | default-domain |
> | | admin |
> | | n1-7f17c558-84a2-4e4e-be27-dca56775134 |
> | contrail:instance_count | 0 |
> | id | 7f17c558-84a2-4e4e-be27-ddca56775134 |
> | name | n1 |
> | router:external | False |
> | shared | False |
> | status | ACTIVE |
> | subnets | |
> | tenant_id | 618d3788d8e34d548d5465e668b3ab18 |
> +-------------------------+-----------------------------------------+
> root@b4s9:/usr/lib/python2.7/dist-packages/schema_transformer# neutron net-create n1
> \Created a new network:
> +-------------------------+-----------------------------------------+
> | Field | Value |
> +-------------------------+-----------------------------------------+
> | admin_state_up | True |
> | contrail:fq_name | default-domain |
> | | admin |
> | | n1-80bac5da-a3e3-45e2-a720-e16a24764313 |
> | contrail:instance_count | 0 |
> | id | 80bac5da-a3e3-45e2-a720-e16a24764313 |
> | name | n1 |
> | router:external | False |
> | shared | False |
> | status | ACTIVE |
> | subnets | |
> | tenant_id | 618d3788d8e34d548d5465e668b3ab18 |
> +-------------------------+-----------------------------------------+
>
> ** Changed in: opencontrail
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1505229
>
> Title:
> Create two resources with the same name f...

Read more...

Revision history for this message
Antoine Eiche (lewo-c) wrote :

I'm using the plugin v3.
Edouard has tried with the plugin v2 and he was not able to reproduce it.

So, it is working for plugin v2 but not for plugin v3.

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/14386
Submitter: Antoine Eiche (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/14386
Committed: http://github.org/Juniper/contrail-neutron-plugin/commit/e40e778844d78c612e0856c32181a77a47e9413f
Submitter: Zuul
Branch: master

commit e40e778844d78c612e0856c32181a77a47e9413f
Author: Antoine Eiche <email address hidden>
Date: Tue Oct 13 16:41:31 2015 +0200

Create several resources with the same name

When a resource is created, if its name already exists, the uuid of
the resource is appended to its name and fq-name. The display-name is
used to store the name provided by the user.

Change-Id: I3c462d631b292d3f9655f8b3e34e5286592e33a4
Closes-Bug: #1505229

Hampapur Ajay (hajay)
Changed in opencontrail:
status: Incomplete → Fix Committed
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.