'binding:host_id' is set None when port update without portbinding changes

Bug #1245310 reported by Hyunsun Moon
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Hyunsun Moon

Bug Description

When I try to update port for additional fixed IP or any other attributes other than portbinding, _process_portbindings_create_and_update is set 'None' in port update messages sent to the agents in spite of it has host_id.
It may not be a problem if the agents do not use portbinding information but if the agent uses 'binding:host_id' information for port update it will cause a problem, which is in my case.

When look at the codes, Neutron server sets 'binding:host_id' to 'None' as long as 'binding:host_id' is not in the requested update items. It should query DB to set correct port binding instead of 'None' in that case.

Tags: db
description: updated
Changed in neutron:
assignee: nobody → Hyunsun Moon (hyunsun-moon)
status: New → In Progress
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

I could not reproduce this issue with port update.
Can you specify the list of commands I need to run to reproduce?

What plugin do you use?

Changed in neutron:
status: In Progress → Incomplete
tags: added: db
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Hyunsun Moon (hyunsun-moon) wrote :

It is linuxbrige plugin.
I tested with the following command.

# neutron port-update XXXXX --fixed_ips type=dict list=true ip_address=10.0.0.3,ip_address=10.0.0.4

I'm using cutomized code for dhcp-agent, which checks binding host ID when port update event occurs.
It's originally from "https://review.openstack.org/#/c/24771/"

---------------------------------------------------------------------------------------
    def port_update_end(self, context, payload):
        """Handle the port.update.end notification event."""
        port = DictModel(payload['port'])
        network = self.cache.get_network_by_id(port.network_id)
        if network:
            device_owner = port.device_owner
            if (self.conf.enable_multi_host and device_owner
                and device_owner.startswith('compute:') and
                self.host != getattr(port, 'binding:host_id', None)): <<<< HERE
                self._unlocked_port_delete_end(context,
                                               {'port_id': port.id})
                return
            self.cache.put_port(port)
            self.call_driver('reload_allocations', network)
---------------------------------------------------------------------------------------

Port update message from the server includes "None" for 'binding:host_id' as I added debug there, and that makes the above logic fails(it only perform action if the binding:host_id is the same with the hostname of itself).
It of course no issue with the original Neutron because it doesn't use 'binding:host_id' in the agents but could be a potential issue later.

Changed in neutron:
status: Incomplete → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/62829
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9b083d7636508cbc5addfe3457c1aac706f0e267
Submitter: Jenkins
Branch: master

commit 9b083d7636508cbc5addfe3457c1aac706f0e267
Author: hyunsun <email address hidden>
Date: Wed Dec 18 18:03:34 2013 +0900

    Fix binding:host_id is set to None when port update

    when updating a port 'binding:host_id' is reset if not specified among
    the parameter to be updated. As a result, a None value for
    'binding:host_id' is sent from the notifier which might potentially
    cause consumers to not work properly.

    Closes-Bug: #1245310
    Change-Id: Icfb5179940cca9f8a705eb36bdbfcbc8a421a272

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
milestone: none → icehouse-3
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-3 → 2014.1
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.