Comment 12 for bug 1268955

Revision history for this message
Andrew Kinney (andykinney) wrote : Re: OVS agent updates the wrong port when using Xen + Neutron with HVM

Workaround (not a real fix!):
On the node with the OVS agent controlling network in dom0 in /usr/share/pyshared/neutron/agent/linux/ovs_lib.py

add to the top near the other import statements:
import time

Change this:
    def get_vif_port_by_id(self, port_id):
         args = ['--', '--columns=external_ids,name,ofport',
                'find', 'Interface',
                'external_ids:iface-id="%s"' % port_id]
        result = self.run_vsctl(args)

to this:
    def get_vif_port_by_id(self, port_id):
        time.sleep(8)
        args = ['--', '--columns=external_ids,name,ofport',
                'find', 'Interface',
                'external_ids:iface-id="%s"' % port_id]
        result = self.run_vsctl(args)

On my system, the tap interface has a life of 5 to 6 seconds at current load levels (mostly idle). If the sleep is 10 seconds, it interferes with the DHCP request emitted from within the VM, so I split the difference and set it to 8 seconds. Obviously, this will vary by machine and load levels, so it is by no means adequate as a real fix. It just increases the success rate of getting the tag on the proper port in dom0 before DHCP sends its first request from within the VM. A side effect is that it takes that number of seconds longer before networking is functional again when restarting the OVS agent that controls dom0.