NSX|V3: ensure that metadata works with windows instances
The 121 support required that we add a route for the metadata to be via the interface. There are some operting systems that do not support this. This needs to be '0.0.0.0'. we pass both options and the OS will decide which one to use. Change-Id: Id5d43c7b5eb7c7b7a12c47dc31f7f52af804494c
This commit is contained in:
parent
52e4481227
commit
520758a1c2
@ -2153,6 +2153,8 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
||||
# Always add option121.
|
||||
net_az = self.get_network_az_by_net_id(context, net_id)
|
||||
options = {'option121': {'static_routes': [
|
||||
{'network': '%s' % net_az.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' % net_az.native_metadata_route,
|
||||
'next_hop': ip}]}}
|
||||
if subnet:
|
||||
|
@ -402,6 +402,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
ip = port['port']['fixed_ips'][0]['ip_address']
|
||||
hostname = 'host-%s' % ip.replace('.', '-')
|
||||
options = {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': ip},
|
||||
@ -441,6 +444,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
ip = port['port']['fixed_ips'][0]['ip_address']
|
||||
hostname = 'host-%s' % ip.replace('.', '-')
|
||||
options = {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': ip},
|
||||
@ -478,6 +484,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
ip = port['port']['fixed_ips'][0]['ip_address']
|
||||
hostname = 'host-%s' % ip.replace('.', '-')
|
||||
options = {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': ip},
|
||||
@ -610,6 +619,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
assert_data = {'host_name': 'host-%s' % new_ip.replace('.', '-'),
|
||||
'ip_address': new_ip,
|
||||
'options': {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': new_ip},
|
||||
@ -629,6 +641,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
update_data = {'port': {'mac_address': new_mac}}
|
||||
assert_data = {'mac_address': new_mac,
|
||||
'options': {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': mock.ANY},
|
||||
@ -654,6 +669,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
'mac_address': new_mac,
|
||||
'ip_address': new_ip,
|
||||
'options': {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': new_ip},
|
||||
@ -682,6 +700,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
assert_data = {'mac_address': mac_address,
|
||||
'ip_address': ip_addr,
|
||||
'options': {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': ip_addr},
|
||||
@ -711,6 +732,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
assert_data = {'mac_address': mac_address,
|
||||
'ip_address': ip_addr,
|
||||
'options': {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': ip_addr},
|
||||
@ -743,6 +767,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
assert_data = {'mac_address': mac_address,
|
||||
'ip_address': ip_addr,
|
||||
'options': {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
cfg.CONF.nsx_v3.native_metadata_route,
|
||||
'next_hop': ip_addr},
|
||||
@ -851,6 +878,9 @@ class NsxNativeDhcpTestCase(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
ip = port['port']['fixed_ips'][0]['ip_address']
|
||||
hostname = 'host-%s' % ip.replace('.', '-')
|
||||
options = {'option121': {'static_routes': [
|
||||
{'network': '%s' %
|
||||
self.az_metadata_route,
|
||||
'next_hop': '0.0.0.0'},
|
||||
{'network': '%s' %
|
||||
self.az_metadata_route,
|
||||
'next_hop': ip},
|
||||
|
Loading…
x
Reference in New Issue
Block a user