From e505183a3c7121e62ad2bc3b9fe68f597acae742 Mon Sep 17 00:00:00 2001 From: Amey Bhide Date: Wed, 19 Aug 2015 23:34:02 -0700 Subject: [PATCH] Deploy NSX Edges in HA mode Adds support for High Availability for networking services provisioned from NSX-v Neutron plugin DocImpact Partial-Bug: #1487624 Change-Id: Ie972bc79df98667156660348e8fa2b0e5cf08445 --- devstack/lib/vmware_nsx_v | 1 + vmware_nsx/etc/nsx.ini | 2 ++ vmware_nsx/neutron/plugins/vmware/common/config.py | 3 +++ .../plugins/vmware/vshield/edge_appliance_driver.py | 13 ++++++++++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/devstack/lib/vmware_nsx_v b/devstack/lib/vmware_nsx_v index 0b0074d26f..3cab01b2b9 100644 --- a/devstack/lib/vmware_nsx_v +++ b/devstack/lib/vmware_nsx_v @@ -98,6 +98,7 @@ function neutron_plugin_configure_service { _nsxv_ini_set nova_metadata_port "$NSXV_NOVA_METADATA_PORT" _nsxv_ini_set nova_metadata_ips "$NSXV_NOVA_METADATA_IPS" _nsxv_ini_set metadata_shared_secret "$NSXV_METADATA_SHARED_SECRET" + _nsxv_ini_set edge_ha "$NSXV_EDGE_HA" } function neutron_plugin_setup_interface_driver { diff --git a/vmware_nsx/etc/nsx.ini b/vmware_nsx/etc/nsx.ini index 24ce95f71d..96399a83ec 100644 --- a/vmware_nsx/etc/nsx.ini +++ b/vmware_nsx/etc/nsx.ini @@ -137,6 +137,8 @@ # port-security feature. # spoofguard_enabled = True +# (Optional) Deploys NSX Edges in HA mode +# edge_ha = True # (ListOpt) Ordered list of router_types to allocate as tenant routers. # It limits the router types that the Nsxv can support for tenants: # distributed: router is supported by distributed edge at the backend. diff --git a/vmware_nsx/neutron/plugins/vmware/common/config.py b/vmware_nsx/neutron/plugins/vmware/common/config.py index 1de0160ce0..85b5c770b6 100644 --- a/vmware_nsx/neutron/plugins/vmware/common/config.py +++ b/vmware_nsx/neutron/plugins/vmware/common/config.py @@ -302,6 +302,9 @@ nsxv_opts = [ default=True, help=_("If True, the server instance will attempt to " "initialize the metadata infrastructure")), + cfg.BoolOpt('edge_ha', + default=True, + help=_("Enable HA for NSX Edges")) ] # Register the configuration options diff --git a/vmware_nsx/neutron/plugins/vmware/vshield/edge_appliance_driver.py b/vmware_nsx/neutron/plugins/vmware/vshield/edge_appliance_driver.py index 81d7f010ea..2887c0ef3d 100644 --- a/vmware_nsx/neutron/plugins/vmware/vshield/edge_appliance_driver.py +++ b/vmware_nsx/neutron/plugins/vmware/vshield/edge_appliance_driver.py @@ -177,13 +177,21 @@ class EdgeApplianceDriver(object): return status_level def _enable_loadbalancer(self, edge): - if not edge.get('featureConfigs') or ( + if (not edge.get('featureConfigs') or not edge['featureConfigs'].get('features')): edge['featureConfigs'] = {'features': []} edge['featureConfigs']['features'].append( {'featureType': 'loadbalancer_4.0', '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): try: response = self.vcns.get_edge_status(edge_id)[1] @@ -498,6 +506,9 @@ class EdgeApplianceDriver(object): if not dist and loadbalancer_enable: self._enable_loadbalancer(edge) + if not dist and cfg.CONF.nsxv.edge_ha: + self._enable_high_availability(edge) + if async: userdata = { 'dist': dist,