]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
fix l3-agent restart with last runtime fip for dvr
authorlzklibj <lzklibj@cn.ibm.com>
Sat, 21 Mar 2015 16:58:15 +0000 (09:58 -0700)
committerlzklibj <lzklibj@cn.ibm.com>
Sat, 25 Apr 2015 16:23:22 +0000 (00:23 +0800)
commit51c53ea40a30e0fcfbe9e4184f63fe4c1887ed6f
treea29922c50200b570b7f2e9e7e97771bd72b31f65
parentc5188d8bf8493e4b075689f64251f85231e696a2
fix l3-agent restart with last runtime fip for dvr

In DVR enabled environment, after we associated a floating
IP to a VM, when we restart L3-agent on the same compute
node, the L3-agent will miss to create rtr_fip_subnet for
router_info. The previous floating IP can still work, but
new associated floating IPs to VMs related to the same router
on this L3-agent will fail to configure and not work. This
patch will fix this.

The method create_dvr_fip_interfaces in dvr_router.py will
invoke fip_ns.create_rtr_2_fip_link, and the later one will
create rtr_fip_subnet, consider VMs related to the same router
will share the same rtr_fip_subnet, so processing here should
run only once for those VMs, once rtr_fip_subnet is created.
Current code will check dist_fip_count then decide to invoke
fip_ns.create_rtr_2_fip_link or not.

dist_fip_count should be zero if a router related VMs never
have been associated with any floating IPs before. But if a
router has floating IPs associated to its related VMs, after
it is restared, dist_fip_count will be non-zero, and this is
the point this patch try to fix. And for case rtr_fip_subnet
has been created, both dist_fip_count and is_fisrt will be
false, and fip_ns.create_rtr_2_fip_link will be no more need
to be invoked.

Change-Id: I3786eab86755a403991728ccb72d03f159ff8b63
Closes-Bug: 1434824
neutron/agent/l3/dvr_router.py
neutron/tests/unit/agent/l3/test_agent.py