NSX|V: add in exclusive DHCP support

Via the configuration variable exclusive_dhcp_edge enable a tenant
to create a exclusive DHCP edge. This can be global or via AZ.

DocImpact

Change-Id: Ia5220302114d73fa89b3f3ea86141cb3208fe885
This commit is contained in:
Gary Kotton 2017-03-12 01:20:14 -08:00 committed by garyk
parent e016bb7558
commit c33810b865
4 changed files with 22 additions and 2 deletions

View File

@ -0,0 +1,8 @@
---
prelude: >
Add support for exclusive DHCP edges.
features:
- |
The NSX-v will now enable a tenant to deploy a exclusive DHCP edge. This
is either via the global configuration variable ``exclusive_dhcp_edge`` or
per AZ. By default this is disabled.

View File

@ -663,6 +663,9 @@ nsxv_opts = [
"connectivity between hosts on same network via " "connectivity between hosts on same network via "
"their floating ips. If True, floating ip will " "their floating ips. If True, floating ip will "
"be associated with all router interfaces.")), "be associated with all router interfaces.")),
cfg.BoolOpt('exclusive_dhcp_edge',
default=False,
help=_("(Optional) Have exclusive DHCP edge per network.")),
] ]
# define the configuration of each availability zone. # define the configuration of each availability zone.
@ -718,6 +721,9 @@ nsxv_az_opts = [
cfg.StrOpt('dvs_id', cfg.StrOpt('dvs_id',
help=_('(Optional) DVS MoRef ID for DVS connected to ' help=_('(Optional) DVS MoRef ID for DVS connected to '
'Management / Edge cluster')), 'Management / Edge cluster')),
cfg.BoolOpt('exclusive_dhcp_edge',
default=False,
help=_("(Optional) Have exclusive DHCP edge per network.")),
] ]
# Register the configuration options # Register the configuration options

View File

@ -65,6 +65,7 @@ class NsxVAvailabilityZone(common_az.ConfiguredAvailabilityZone):
self.vdn_scope_id = cfg.CONF.nsxv.vdn_scope_id self.vdn_scope_id = cfg.CONF.nsxv.vdn_scope_id
self.dvs_id = cfg.CONF.nsxv.dvs_id self.dvs_id = cfg.CONF.nsxv.dvs_id
self.edge_host_groups = cfg.CONF.nsxv.edge_host_groups self.edge_host_groups = cfg.CONF.nsxv.edge_host_groups
self.exclusive_dhcp_edge = cfg.CONF.nsxv.exclusive_dhcp_edge
# No support for metadata per az # No support for metadata per az
self.az_metadata_support = False self.az_metadata_support = False
@ -121,6 +122,8 @@ class NsxVAvailabilityZone(common_az.ConfiguredAvailabilityZone):
if not self.edge_host_groups: if not self.edge_host_groups:
self.edge_host_groups = cfg.CONF.nsxv.edge_host_groups self.edge_host_groups = cfg.CONF.nsxv.edge_host_groups
self.exclusive_dhcp_edge = az_info.get('exclusive_dhcp_edge', False)
# Support for metadata per az only if configured, and different # Support for metadata per az only if configured, and different
# from the global one # from the global one
self.mgt_net_proxy_ips = az_info.get('mgt_net_proxy_ips') self.mgt_net_proxy_ips = az_info.get('mgt_net_proxy_ips')
@ -178,6 +181,7 @@ class NsxVAvailabilityZone(common_az.ConfiguredAvailabilityZone):
self.vdn_scope_id = cfg.CONF.nsxv.vdn_scope_id self.vdn_scope_id = cfg.CONF.nsxv.vdn_scope_id
self.dvs_id = cfg.CONF.nsxv.dvs_id self.dvs_id = cfg.CONF.nsxv.dvs_id
self.edge_host_groups = cfg.CONF.nsxv.edge_host_groups self.edge_host_groups = cfg.CONF.nsxv.edge_host_groups
self.exclusive_dhcp_edge = cfg.CONF.nsxv.exclusive_dhcp_edge
def supports_metadata(self): def supports_metadata(self):
# Return True if this az has it's own metadata configuration # Return True if this az has it's own metadata configuration

View File

@ -1123,8 +1123,10 @@ class EdgeManager(object):
free_number = ((vcns_const.MAX_VNIC_NUM - 1) * free_number = ((vcns_const.MAX_VNIC_NUM - 1) *
vcns_const.MAX_TUNNEL_NUM - vcns_const.MAX_TUNNEL_NUM -
len(edge_vnic_bindings)) len(edge_vnic_bindings))
# metadata internal network will use one vnic # metadata internal network will use one vnic or
if free_number <= (vcns_const.MAX_TUNNEL_NUM - 1): # exclusive_dhcp_edge is set for the AZ
if (free_number <= (vcns_const.MAX_TUNNEL_NUM - 1) or
availability_zone.exclusive_dhcp_edge):
conflict_edge_ids.append(dhcp_edge_id) conflict_edge_ids.append(dhcp_edge_id)
for net_id in conflicting_nets: for net_id in conflicting_nets: