Port dns_name is updated when dns-integration extension is disabled

Bug #1574694 reported by Elena Ezhova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Miguel Lavalle

Bug Description

When a port is attached to and instance its dns_name is updated even if dns-integration extension is not enabled:

$:~/devstack$ neutron port-create private
Created a new port:
+-----------------------+---------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+---------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | |
| binding:profile | {} |
| binding:vif_details | {} |
| binding:vif_type | unbound |
| binding:vnic_type | normal |
| created_at | 2016-04-25T14:42:57 |
| description | |
| device_id | |
| device_owner | |
| dns_name | |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "32ba7468-e4c2-4feb-9e0f-de983f7ced52", "ip_address": "10.0.0.5"} |
| id | 3a7facc6-cda5-46d8-bc67-c880406e338e |
| mac_address | fa:16:3e:6a:25:37 |
| name | |
| network_id | adc6b713-a44d-43c9-9366-4564c32ff41a |
| port_security_enabled | True |
| security_groups | a61295bf-6751-42ed-ab70-73c0b42a09c9 |
| status | DOWN |
| tenant_id | 801a523213aa4168adba27231095c535 |
| updated_at | 2016-04-25T14:42:57 |
+-----------------------+---------------------------------------------------------------------------------+
$:~/devstack$ nova interface-attach --port-id 3a7facc6-cda5-46d8-bc67-c880406e338e test
$:~/devstack$ neutron port-show 3a7facc6-cda5-46d8-bc67-c880406e338e
+-----------------------+---------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+---------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | eezhova-devstack-2 |
| binding:profile | {} |
| binding:vif_details | {"port_filter": true, "ovs_hybrid_plug": true} |
| binding:vif_type | ovs |
| binding:vnic_type | normal |
| created_at | 2016-04-25T14:42:57 |
| description | |
| device_id | a251a60a-e98d-4f46-8288-d45c986874a1 |
| device_owner | compute:None |
| dns_name | test |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "32ba7468-e4c2-4feb-9e0f-de983f7ced52", "ip_address": "10.0.0.5"} |
| id | 3a7facc6-cda5-46d8-bc67-c880406e338e |
| mac_address | fa:16:3e:6a:25:37 |
| name | |
| network_id | adc6b713-a44d-43c9-9366-4564c32ff41a |
| port_security_enabled | True |
| security_groups | a61295bf-6751-42ed-ab70-73c0b42a09c9 |
| status | ACTIVE |
| tenant_id | 801a523213aa4168adba27231095c535 |
| updated_at | 2016-04-25T14:43:45 |
+-----------------------+---------------------------------------------------------------------------------+

Expected result: dns_name=''
Actual result: dns_name='test'

Meanwhile this is not the case when a port is created on instance boot.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Silly question, but can you show ext-list? In DevStack-based installs DNS extension (except the DNS ML2's extension driver) is loaded up automatically. Besides, without DNS extension enabled I'd expect dns_name not to show up entirely.

Changed in neutron:
status: New → Incomplete
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

That's the output of my neutron ext-list:

http://paste.openstack.org/show/495338/

I have BGP enabled too, but that's irrelevant to this discussion.

Revision history for this message
Elena Ezhova (eezhova) wrote :

I also have dns-integration in the list of extensions, but it is not added to the list extension_drivers in ml2_conf.ini. This way in update_port [1] dns-integration is not included into self.supported_extension_aliases and in my understanding dns_name shouldn't get updated in this case just like it's not added to port_data on create_port.

[1] https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L1288-L1293
[2] https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L1226-L1229

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This logic should we overhauled, mlavalle should be able to direct you on the plan forward. My take is that you'd really the ML2 DNS extension driver for this to work properly.

tags: added: dns
Changed in neutron:
status: Incomplete → New
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Let's get Miguel to chime in.

Elena Ezhova (eezhova)
Changed in neutron:
assignee: nobody → Elena Ezhova (eezhova)
Changed in neutron:
status: New → In Progress
Revision history for this message
Elena Ezhova (eezhova) wrote :
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/311640

Changed in neutron:
assignee: Elena Ezhova (eezhova) → Miguel Lavalle (minsel)
Revision history for this message
Miguel Lavalle (minsel) wrote :

The root cause of this problem is that the l3_router_plugin is incorrectly loading the DNS integration extension. This extension should only be configured by the operator / deployer by adding 'dns' to the 'extension_driver' list in ml2_conf.ini. I have created the following patchset to address this bug: https://review.openstack.org/#/c/311640/.

With this fix, the problem described by Elena above is solved. Please see: http://paste.openstack.org/show/495828/. As can be seen, if the DNS extension is not configured, ports shouldn't have a 'dns_name' attribute. Therefore, it cannot be updated. This is the correct behavior.

From the Nova point of view, since the DNS integration extension was being loaded incorrectly by the l3_router_plugin, it showed up in the list of Neutron extensions. Therefore, during an interface attach operation, Nova attempted to update the port's 'dns_name' attribute. With the fix proposed in https://review.openstack.org/#/c/311640/, the DNS integration extension doesn't show up in the list of Neutron extensions (unless it was correctly configured by the operator) and therefore, Nova doesn't attempt to update ports 'dns_name' attributes.

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

I should also point out that one of my team members is in the process of moving the DNS related code in db_base_plugin_V2.py to the ML2 extension driver, per previous conversation with armax

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

Change abandoned by Elena Ezhova (<email address hidden>) on branch: master
Review: https://review.openstack.org/309996
Reason: Abandoned in favor of https://review.openstack.org/#/c/311640/

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

Reviewed: https://review.openstack.org/311640
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=56962922cc439409bcecd808a1e9bbec2c3756f7
Submitter: Jenkins
Branch: master

commit 56962922cc439409bcecd808a1e9bbec2c3756f7
Author: Miguel Lavalle <email address hidden>
Date: Sun May 1 23:51:23 2016 +0000

    Don't load DNS integration in l3_router_plugin

    In this patchset we stop the l3_router_plugin from loading the DNS integration
    extension. The DNS integration extension should only be configured by the
    operator by adding 'dns' to the 'extension_driver' list in ml2_conf.ini

    Change-Id: I1321d9821973fe918005a8c2f3dd751af9affe38
    Closes-Bug: #1574694

Changed in neutron:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 9.0.0.0b1

This issue was fixed in the openstack/neutron 9.0.0.0b1 development milestone.

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

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/349214

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/mitaka)

Reviewed: https://review.openstack.org/349214
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e0f46f19f79169eaa63b33745233a4706b870b66
Submitter: Jenkins
Branch: stable/mitaka

commit e0f46f19f79169eaa63b33745233a4706b870b66
Author: Miguel Lavalle <email address hidden>
Date: Sun May 1 23:51:23 2016 +0000

    Don't load DNS integration in l3_router_plugin

    In this patchset we stop the l3_router_plugin from loading the DNS integration
    extension. The DNS integration extension should only be configured by the
    operator by adding 'dns' to the 'extension_driver' list in ml2_conf.ini

    Change-Id: I1321d9821973fe918005a8c2f3dd751af9affe38
    Closes-Bug: #1574694
    (cherry picked from commit 56962922cc439409bcecd808a1e9bbec2c3756f7)

tags: added: in-stable-mitaka
tags: removed: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 8.3.0

This issue was fixed in the openstack/neutron 8.3.0 release.

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.