NSX|V: add ability for admin to configure default nameservers

Enable an admin to configure a list of default nameservers that will
be used for the DHCP bindings if there is or are no nameservers
defined on the subnet.

A new configuration variable is added. This is 'nameservers'.
By default this is a empty list.

DocImpact

Change-Id: I97690935478364678a5981171f789a6b3ffa9640
This commit is contained in:
Gary Kotton 2016-02-07 05:24:38 -08:00
parent bd0870702b
commit b579c05546
2 changed files with 8 additions and 0 deletions

View File

@ -377,6 +377,11 @@ nsxv_opts = [
"router. This edge_appliance_size will be picked up if "
"--router-size parameter is not specified while doing "
"neutron router-create")),
cfg.ListOpt('nameservers',
default=[],
help=_('List of nameservers to configure for the DHCP binding '
'entries. These will be used if there are no '
'nameservers defined on the subnet.')),
]
# Register the configuration options

View File

@ -707,6 +707,9 @@ class EdgeManager(object):
# set primary and secondary dns
name_servers = [dns['address']
for dns in subnet['dns_nameservers']]
# if no nameservers have been configured then use the ones
# defined in the configuration
name_servers = name_servers or cfg.CONF.nsxv.nameservers
if len(name_servers) == 1:
static_config['primaryNameServer'] = name_servers[0]
elif len(name_servers) >= 2: