Merge "NSX|V3: ensure that metadata works with windows instances"
This commit is contained in:
commit
5d71e0423c
@ -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…
Reference in New Issue
Block a user