Rebuild ovs tunnel only if local agent is alive, other minor change.

This commit is contained in:
Hui Xiang 2015-01-19 18:43:09 +08:00
parent a27a240da2
commit cbd3f94247
2 changed files with 12 additions and 5 deletions

View File

@ -136,9 +136,12 @@ options:
type: boolean
default: False
description: |
If True will enable ACTIVE/PASSIVE HA mode for neutron agents using
Pacemaker and Corosync. This is intended for < Juno which natively
supports HA in Neutron itself.
If True will enable Pacemaker to monitor the neutron-ha-monitor daemon
on every neutron-gateway unit, which detects neutron agents status and
reschedule resources hosting on failed agents, detects local errors and
release resources when network is unreachable or do neccessary recover
tasks. This feature targets to < Juno which doesn't natively support HA
in Neutron itself.
ha-bindiface:
type: string
default: eth0

View File

@ -346,6 +346,10 @@ class MonitorNeutronAgentsDaemon(Daemon):
def check_ovs_tunnel(self, quantum=None):
'''
Work around for Bug #1411163
No fdb entries added when failover dhcp and l3 agent together.
'''
if not quantum:
LOG.error('Failed to get quantum client.')
return
@ -358,7 +362,7 @@ class MonitorNeutronAgentsDaemon(Daemon):
return
for agent in agents['agents']:
if self.is_same_host(agent['host']):
if self.is_same_host(agent['host']) and agent['alive']:
conf = agent['configurations']
if 'gre' in conf['tunnel_types'] and conf['l2_population'] \
and conf['devices']:
@ -373,7 +377,7 @@ class MonitorNeutronAgentsDaemon(Daemon):
break
if not look_up_gre_port:
try:
LOG.error('Found namespace, but no ovs tunnel is created,'
LOG.error('Local agent has devices, but no ovs tunnel is created,'
'restart ovs agent.')
cmd = ['sudo', 'service', 'neutron-plugin-openvswitch-agent',
'restart']