Merge "Deploy NSX Edges in HA mode"

This commit is contained in:
Jenkins 2015-08-27 01:28:08 +00:00 committed by Gerrit Code Review
commit 92cce208fa
4 changed files with 18 additions and 1 deletions

View File

@ -98,6 +98,7 @@ function neutron_plugin_configure_service {
_nsxv_ini_set nova_metadata_port "$NSXV_NOVA_METADATA_PORT" _nsxv_ini_set nova_metadata_port "$NSXV_NOVA_METADATA_PORT"
_nsxv_ini_set nova_metadata_ips "$NSXV_NOVA_METADATA_IPS" _nsxv_ini_set nova_metadata_ips "$NSXV_NOVA_METADATA_IPS"
_nsxv_ini_set metadata_shared_secret "$NSXV_METADATA_SHARED_SECRET" _nsxv_ini_set metadata_shared_secret "$NSXV_METADATA_SHARED_SECRET"
_nsxv_ini_set edge_ha "$NSXV_EDGE_HA"
} }
function neutron_plugin_setup_interface_driver { function neutron_plugin_setup_interface_driver {

View File

@ -137,6 +137,8 @@
# port-security feature. # port-security feature.
# spoofguard_enabled = True # spoofguard_enabled = True
# (Optional) Deploys NSX Edges in HA mode
# edge_ha = True
# (ListOpt) Ordered list of router_types to allocate as tenant routers. # (ListOpt) Ordered list of router_types to allocate as tenant routers.
# It limits the router types that the Nsxv can support for tenants: # It limits the router types that the Nsxv can support for tenants:
# distributed: router is supported by distributed edge at the backend. # distributed: router is supported by distributed edge at the backend.

View File

@ -302,6 +302,9 @@ nsxv_opts = [
default=True, default=True,
help=_("If True, the server instance will attempt to " help=_("If True, the server instance will attempt to "
"initialize the metadata infrastructure")), "initialize the metadata infrastructure")),
cfg.BoolOpt('edge_ha',
default=True,
help=_("Enable HA for NSX Edges"))
] ]
# Register the configuration options # Register the configuration options

View File

@ -177,13 +177,21 @@ class EdgeApplianceDriver(object):
return status_level return status_level
def _enable_loadbalancer(self, edge): def _enable_loadbalancer(self, edge):
if not edge.get('featureConfigs') or ( if (not edge.get('featureConfigs') or
not edge['featureConfigs'].get('features')): not edge['featureConfigs'].get('features')):
edge['featureConfigs'] = {'features': []} edge['featureConfigs'] = {'features': []}
edge['featureConfigs']['features'].append( edge['featureConfigs']['features'].append(
{'featureType': 'loadbalancer_4.0', {'featureType': 'loadbalancer_4.0',
'enabled': True}) 'enabled': True})
def _enable_high_availability(self, edge):
if (not edge.get('featureConfigs') or
not edge['featureConfigs'].get('features')):
edge['featureConfigs'] = {'features': []}
edge['featureConfigs']['features'].append(
{'featureType': 'highavailability_4.0',
'enabled': True})
def get_edge_status(self, edge_id): def get_edge_status(self, edge_id):
try: try:
response = self.vcns.get_edge_status(edge_id)[1] response = self.vcns.get_edge_status(edge_id)[1]
@ -498,6 +506,9 @@ class EdgeApplianceDriver(object):
if not dist and loadbalancer_enable: if not dist and loadbalancer_enable:
self._enable_loadbalancer(edge) self._enable_loadbalancer(edge)
if not dist and cfg.CONF.nsxv.edge_ha:
self._enable_high_availability(edge)
if async: if async:
userdata = { userdata = {
'dist': dist, 'dist': dist,