Browse Source

Merge "[NSX-P/NSX-v3] Metadata route: make windows route optional" into stable/train

changes/97/814897/1
Zuul 7 months ago committed by Gerrit Code Review
parent
commit
fe17512092
  1. 4
      vmware_nsx/common/config.py
  2. 4
      vmware_nsx/plugins/common_v3/availability_zones.py
  3. 12
      vmware_nsx/plugins/common_v3/plugin.py
  4. 1
      vmware_nsx/plugins/nsx_p/availability_zones.py
  5. 1
      vmware_nsx/plugins/nsx_v3/availability_zones.py

4
vmware_nsx/common/config.py

@ -366,6 +366,10 @@ nsx_v3_and_p = [
default="169.254.169.254/31",
help=_("The metadata route used for native metadata proxy "
"service.")),
cfg.BoolOpt('windows_metadata_route',
default=True,
help=_("Inject a route for allowing windows guest access NSX "
"native metadata proxy service")),
cfg.StrOpt('dns_domain',
default='openstacklocal',
help=_("Domain to use for building the hostnames.")),

4
vmware_nsx/plugins/common_v3/availability_zones.py

@ -60,6 +60,10 @@ class NsxV3AvailabilityZone(common_az.ConfiguredAvailabilityZone):
native_metadata_route = az_info.get('native_metadata_route')
if native_metadata_route:
self.native_metadata_route = native_metadata_route
windows_metadata_route = az_info.get('windows_metadata_route')
# Careful - this is a boolean
if windows_metadata_route is not None:
self.windows_metadata_route = windows_metadata_route
else:
self.metadata_proxy = None
self.dhcp_profile = None

12
vmware_nsx/plugins/common_v3/plugin.py

@ -2677,11 +2677,15 @@ class NsxPluginV3Base(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
subnet):
# Always add option121.
net_az = self.get_network_az_by_net_id(context, net_id)
options = {'option121': {'static_routes': [
static_routes = []
options = {'option121': {'static_routes': static_routes}}
if net_az.windows_metadata_route:
static_routes.append(
{'network': '%s' % net_az.native_metadata_route,
'next_hop': '0.0.0.0'})
static_routes.append(
{'network': '%s' % net_az.native_metadata_route,
'next_hop': '0.0.0.0'},
{'network': '%s' % net_az.native_metadata_route,
'next_hop': ip}]}}
'next_hop': ip})
if subnet:
sr, gateway_ip = self._build_static_routes(
subnet.get('gateway_ip'), subnet.get('cidr'),

1
vmware_nsx/plugins/nsx_p/availability_zones.py

@ -40,6 +40,7 @@ class NsxPAvailabilityZone(v3_az.NsxV3AvailabilityZone):
self.metadata_proxy = cfg.CONF.nsx_p.metadata_proxy
self.dhcp_profile = cfg.CONF.nsx_p.dhcp_profile
self.native_metadata_route = cfg.CONF.nsx_p.native_metadata_route
self.windows_metadata_route = cfg.CONF.nsx_p.windows_metadata_route
self.default_overlay_tz = cfg.CONF.nsx_p.default_overlay_tz
self.default_vlan_tz = cfg.CONF.nsx_p.default_vlan_tz
self.default_tier0_router = cfg.CONF.nsx_p.default_tier0_router

1
vmware_nsx/plugins/nsx_v3/availability_zones.py

@ -50,6 +50,7 @@ class NsxV3AvailabilityZone(v3_az.NsxV3AvailabilityZone):
self.metadata_proxy = cfg.CONF.nsx_v3.metadata_proxy
self.dhcp_profile = cfg.CONF.nsx_v3.dhcp_profile
self.native_metadata_route = cfg.CONF.nsx_v3.native_metadata_route
self.windows_metadata_route = cfg.CONF.nsx_v3.windows_metadata_route
self.dns_domain = cfg.CONF.nsx_v3.dns_domain
self.nameservers = cfg.CONF.nsx_v3.nameservers
self.default_overlay_tz = cfg.CONF.nsx_v3.default_overlay_tz

Loading…
Cancel
Save