attaching extra port to server raise duplicate dns-name error

Bug #1879009 reported by hamza
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Expired
Medium
Unassigned

Bug Description

if a user have the designate extension in neutron config enabled (dns-domain : example.com) and he creates a server serv1 that server will have a dns record in designate like serv1.example.com.
if the user try openstack server add port port2 that port will get the same dns-name which will used by the first port assigned to serv1 which will cause the raise of the designate dns-name duplicate

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

Hi hamza,

I have practically no first hand experience with designate but based on what I read I always thought you can override the port's dns-name like this:

openstack port create --network my-net --dns-name a-different-name-for-port2 port2

From here: https://docs.openstack.org/neutron/ussuri/admin/config-dns-int.html

Have you tried creating and attaching a port like that? Do you still have the duplicate name this way?

tags: added: dns
Changed in neutron:
status: New → Incomplete
Revision history for this message
hamza (alqtaishat) wrote :

in the same link attached
https://docs.openstack.org/neutron/ussuri/admin/config-dns-int.html

Instead of having the Compute service create the port for the instance, the user might have created it and assigned a value to its dns_name attribute. In this case, the value assigned to the dns_name attribute must be equal to the value that Compute service will assign to the instance’s hostname, in this example my-vm. Otherwise, the instance boot will fail.

which return us to the same problem again, right?

Revision history for this message
hamza (alqtaishat) wrote :

so adding the port
openstack port create port2 --network main-private --dns-name port2

then
openstack server add port server-id port-id

will get the error
Value port2 assigned to dns_name attribute does not match instance's hostname

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

Fix proposed to branch: master
Review: https://review.opendev.org/729440

Changed in neutron:
assignee: nobody → hamza (alqtaishat)
status: Incomplete → In Progress
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/729862

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

Sorry for the slow reaction. I had to build an environment with designate and learn about it to get to the point where I can try to reproduce the bug you have.

But I still cannot reproduce it. That's probably because my environment is not fully functional. Anyway this is what I tried.

Enabled the designate devstack plugin, configured neutron to talk to designate and set neutron's dns_domain to "example.org." Basic things like neutron creating a designate recordset for a floating ip do work in this environment.

Based on the bug description I assume you're using use case "3c: The dns extension" from here:

https://docs.openstack.org/neutron/latest/admin/config-dns-int-ext-serv.html

So I ran this (in preparation to boot a vm on the port):

openstack network set private --dns-domain example.org.
openstack subnet set private-subnet --no-dns-publish-fixed-ip
openstack port create port0 --network private --dns-name vm0

But I'm getting an error like this before I could boot the first vm this way (after waiting about a minute):

ConflictException: 409: Client Error for url: http://192.168.122.165:9696/v2.0/ports, Failed to create a duplicate PortDNS: for attribute(s) ['PRIMARY'] with value(s) a5fec7b6-ac24-4f6e-988c-a54cdaf52fdf

Right now I'm stuck with this. I hope other people seeing the patch you uploaded can help you with this bug. Maybe it could help them if you added the exact commands reproducing the bug here.

Revision history for this message
Maciej Jozefczyk (maciejjozefczyk) wrote :

Hey Hamza,

as per the issue is not clear for us, could you please add this missing information:
* versions used
* used templates/devstack configuration
* steps to reproduce

For now as we're not able to reproduce, I'm moving the bug to incomplete.

Changed in neutron:
status: In Progress → Incomplete
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

IIUC the above ConflictException is what the patch is trying to fix, you either get it for the server creation or for the port creation, depending on which goes second. But both of these are non-fatal, I can create both port and server and even then successfully attach the port to the server.

I assume you meant to say "openstack subnet set private-subnet --dns-publish-fixed-ip" above, because the default for that is false and only when set to true the external DNS integration will be triggered.

But I agree that it would be good for the bug creator to confirm this and also describe the use-case, because as I mentioned in the patch, creating a different record name isn't a valid solution for me.

Revision history for this message
hamza (alqtaishat) wrote :

Basically the user will not get an Error creating the server with multiple ports or when he tries to add a port to existing server but if u list the zone recordset u will find no dns entry for the port

openstack recordset list zone-uuid

which is caused by the dns-name conflict in designate since when neutron try to add a dns entry for extra port it use the same dns-name (provided form nova which is the instance name)

so i suggested the two solutions above to allow multiple dns entries for a server with the same type A, AAAA

version
latest

steps to reproduce

in devstack enable the designate as external dns drive as shown below
https://docs.openstack.org/neutron/rocky/admin/config-dns-int-ext-serv.html

create a server and make sure when its active there is a record in designate zone for it

openstack recordset list zone-uuid

openstack create port --network uuid

openstack server add port port-uuid create-server-id

the above command will not error out and the server will still be active and the port added successfully but when u list the zone records it will not show any recordset for the new added port

openstack recordset list zone-uuid

which is not the expected behavior

Revision history for this message
Slawek Kaplonski (slaweq) wrote : auto-abandon-script

This bug has had a related patch abandoned and has been automatically un-assigned due to inactivity. Please re-assign yourself if you are continuing work or adjust the state as appropriate if it is no longer valid.

Changed in neutron:
assignee: hamza (alqtaishat) → nobody
tags: added: timeout-abandon
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Slawek Kaplonski (<email address hidden>) on branch: master
Review: https://review.opendev.org/729862
Reason: This review is > 4 weeks without comment, and failed Zuul jobs the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
hamza (alqtaishat) wrote :

i have another solution in https://review.opendev.org/#/c/729440/
which generate dns_name based on the ip

Revision history for this message
hamza (alqtaishat) wrote :

but i need someone to discuss and confirm on this

Revision history for this message
hamza (alqtaishat) wrote :

Dr. Jens Harbott lets schedule time for this and discuss it

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Rodolfo Alonso <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/729440
Reason: This patch has been abandoned due to the lack of activity. Please propose it again if needed. Thanks!

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.