Add vrrp ha support
This commit is contained in:
17
config.yaml
17
config.yaml
@@ -218,3 +218,20 @@ options:
|
||||
type: boolean
|
||||
description: |
|
||||
Enable Distributed Virtual Routing (juno and above).
|
||||
enable-l3ha:
|
||||
default: False
|
||||
type: boolean
|
||||
description: |
|
||||
Enable L3 HA (juno and above).
|
||||
max-l3-agents-per-router:
|
||||
default: 2
|
||||
type: int
|
||||
description: |
|
||||
Maximum number of l3 agents to host a router. Only used when enable-l3ha
|
||||
is True
|
||||
min-l3-agents-per-router:
|
||||
default: 2
|
||||
type: int
|
||||
description: |
|
||||
Minimum number of l3 agents to host a router. Only used when enable-l3ha
|
||||
is True
|
||||
|
||||
@@ -27,18 +27,37 @@ def get_overlay_network_type():
|
||||
return overlay_net
|
||||
|
||||
|
||||
def get_l3ha():
|
||||
if config('enable-l3ha'):
|
||||
if os_release('neutron-server') < 'juno':
|
||||
log('Disabling L3 HA, enable-l3ha is not valid before Juno')
|
||||
return False
|
||||
if config('overlay-network-type') not in ['vlan', 'gre', 'vxlan']:
|
||||
log('Disabling L3 HA, enable-l3ha requires the use of the vxlan'
|
||||
'vlan or gre overlay network')
|
||||
return False
|
||||
if get_l2population():
|
||||
log('Disabling L3 HA, l2-population must be disabled with L3 HA')
|
||||
return False
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def get_dvr():
|
||||
if config('enable-dvr'):
|
||||
if os_release('neutron-server') < 'juno':
|
||||
log('Disabling DVR, enable_dvr is not valid before Juno')
|
||||
log('Disabling DVR, enable-dvr is not valid before Juno')
|
||||
return False
|
||||
if config('overlay-network-type') != 'vxlan':
|
||||
log('Disabling DVR, enable_dvr requires the use of the vxlan'
|
||||
log('Disabling DVR, enable-dvr requires the use of the vxlan'
|
||||
'overlay network')
|
||||
return False
|
||||
if not get_l2population():
|
||||
log('Disabling DVR, l2-population must be enabled to use dvr')
|
||||
return False
|
||||
if get_l3ha():
|
||||
log('Disabling DVR, enable-l3ha must be disabled with dvr')
|
||||
return False
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@@ -94,6 +113,10 @@ class NeutronCCContext(context.NeutronContext):
|
||||
def neutron_dvr(self):
|
||||
return get_dvr()
|
||||
|
||||
@property
|
||||
def neutron_l3ha(self):
|
||||
return get_l3ha()
|
||||
|
||||
# Do not need the plugin agent installed on the api server
|
||||
def _ensure_packages(self):
|
||||
pass
|
||||
@@ -117,6 +140,12 @@ class NeutronCCContext(context.NeutronContext):
|
||||
config('nsx-controllers').split()
|
||||
ctxt['l2_population'] = self.neutron_l2_population
|
||||
ctxt['enable_dvr'] = self.neutron_dvr
|
||||
ctxt['l3_ha'] = self.neutron_l3ha
|
||||
if self.neutron_l3ha:
|
||||
ctxt['max_l3_agents_per_router'] = \
|
||||
config('max-l3-agents-per-router')
|
||||
ctxt['min_l3_agents_per_router'] = \
|
||||
config('min-l3-agents-per-router')
|
||||
ctxt['overlay_network_type'] = self.neutron_overlay_network_type
|
||||
ctxt['external_network'] = config('neutron-external-network')
|
||||
ctxt['verbose'] = config('verbose')
|
||||
|
||||
@@ -47,6 +47,7 @@ from neutron_api_utils import (
|
||||
)
|
||||
from neutron_api_context import (
|
||||
get_dvr,
|
||||
get_l3ha,
|
||||
get_l2population,
|
||||
get_overlay_network_type,
|
||||
)
|
||||
@@ -280,6 +281,7 @@ def neutron_plugin_api_relation_joined(rid=None):
|
||||
'neutron-security-groups': config('neutron-security-groups'),
|
||||
'l2-population': get_l2population(),
|
||||
'enable-dvr': get_dvr(),
|
||||
'enable-l3ha': get_l3ha(),
|
||||
'overlay-network-type': get_overlay_network_type(),
|
||||
}
|
||||
relation_set(relation_id=rid, **relation_data)
|
||||
|
||||
@@ -17,6 +17,12 @@ rpc_workers = {{ workers }}
|
||||
|
||||
router_distributed = {{ enable_dvr }}
|
||||
|
||||
l3_ha = {{ l3_ha }}
|
||||
{% if l3_ha -%}
|
||||
max_l3_agents_per_router = {{ max_l3_agents_per_router }}
|
||||
min_l3_agents_per_router = {{ min_l3_agents_per_router }}
|
||||
{% endif -%}
|
||||
|
||||
{% if neutron_bind_port -%}
|
||||
bind_port = {{ neutron_bind_port }}
|
||||
{% else -%}
|
||||
|
||||
Reference in New Issue
Block a user