Merge "Adds garp_master_repeat and garp_master_refresh to keepalived.conf"

This commit is contained in:
Jenkins 2015-07-24 17:21:21 +00:00 committed by Gerrit Code Review
commit ab9ef51ca1
3 changed files with 22 additions and 3 deletions

View File

@ -32,7 +32,8 @@ PRIMARY_VIP_RANGE_SIZE = 24
# TODO(amuller): Use L3 agent constant when new constants module is introduced. # TODO(amuller): Use L3 agent constant when new constants module is introduced.
FIP_LL_SUBNET = '169.254.30.0/23' FIP_LL_SUBNET = '169.254.30.0/23'
KEEPALIVED_SERVICE_NAME = 'keepalived' KEEPALIVED_SERVICE_NAME = 'keepalived'
GARP_MASTER_REPEAT = 5
GARP_MASTER_REFRESH = 10
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -148,7 +149,9 @@ class KeepalivedInstance(object):
def __init__(self, state, interface, vrouter_id, ha_cidrs, def __init__(self, state, interface, vrouter_id, ha_cidrs,
priority=HA_DEFAULT_PRIORITY, advert_int=None, priority=HA_DEFAULT_PRIORITY, advert_int=None,
mcast_src_ip=None, nopreempt=False): mcast_src_ip=None, nopreempt=False,
garp_master_repeat=GARP_MASTER_REPEAT,
garp_master_refresh=GARP_MASTER_REFRESH):
self.name = 'VR_%s' % vrouter_id self.name = 'VR_%s' % vrouter_id
if state not in VALID_STATES: if state not in VALID_STATES:
@ -161,6 +164,8 @@ class KeepalivedInstance(object):
self.nopreempt = nopreempt self.nopreempt = nopreempt
self.advert_int = advert_int self.advert_int = advert_int
self.mcast_src_ip = mcast_src_ip self.mcast_src_ip = mcast_src_ip
self.garp_master_repeat = garp_master_repeat
self.garp_master_refresh = garp_master_refresh
self.track_interfaces = [] self.track_interfaces = []
self.vips = [] self.vips = []
self.virtual_routes = KeepalivedInstanceRoutes() self.virtual_routes = KeepalivedInstanceRoutes()
@ -254,7 +259,9 @@ class KeepalivedInstance(object):
' state %s' % self.state, ' state %s' % self.state,
' interface %s' % self.interface, ' interface %s' % self.interface,
' virtual_router_id %s' % self.vrouter_id, ' virtual_router_id %s' % self.vrouter_id,
' priority %s' % self.priority] ' priority %s' % self.priority,
' garp_master_repeat %s' % self.garp_master_repeat,
' garp_master_refresh %s' % self.garp_master_refresh]
if self.nopreempt: if self.nopreempt:
config.append(' nopreempt') config.append(' nopreempt')

View File

@ -197,6 +197,8 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
interface %(ha_device_name)s interface %(ha_device_name)s
virtual_router_id 1 virtual_router_id 1
priority 50 priority 50
garp_master_repeat 5
garp_master_refresh 10
nopreempt nopreempt
advert_int 2 advert_int 2
track_interface { track_interface {

View File

@ -115,6 +115,8 @@ class KeepalivedConfTestCase(base.BaseTestCase,
interface eth0 interface eth0
virtual_router_id 1 virtual_router_id 1
priority 50 priority 50
garp_master_repeat 5
garp_master_refresh 10
advert_int 5 advert_int 5
authentication { authentication {
auth_type AH auth_type AH
@ -141,6 +143,8 @@ vrrp_instance VR_2 {
interface eth4 interface eth4
virtual_router_id 2 virtual_router_id 2
priority 50 priority 50
garp_master_repeat 5
garp_master_refresh 10
mcast_src_ip 224.0.0.1 mcast_src_ip 224.0.0.1
track_interface { track_interface {
eth4 eth4
@ -249,6 +253,8 @@ class KeepalivedInstanceTestCase(base.BaseTestCase,
interface eth0 interface eth0
virtual_router_id 1 virtual_router_id 1
priority 50 priority 50
garp_master_repeat 5
garp_master_refresh 10
advert_int 5 advert_int 5
authentication { authentication {
auth_type AH auth_type AH
@ -272,6 +278,8 @@ vrrp_instance VR_2 {
interface eth4 interface eth4
virtual_router_id 2 virtual_router_id 2
priority 50 priority 50
garp_master_repeat 5
garp_master_refresh 10
mcast_src_ip 224.0.0.1 mcast_src_ip 224.0.0.1
track_interface { track_interface {
eth4 eth4
@ -294,6 +302,8 @@ vrrp_instance VR_2 {
interface eth0 interface eth0
virtual_router_id 1 virtual_router_id 1
priority 50 priority 50
garp_master_repeat 5
garp_master_refresh 10
virtual_ipaddress { virtual_ipaddress {
169.254.0.1/24 dev eth0 169.254.0.1/24 dev eth0
} }