Undercloud - ironic inspector - host routes

Configure the host_routes specified for subnets
in undercloud.conf as classless static routes
in ironic inspectors dnsmasq configuration.

The advanced routing options will be pushed to
the inspection ramdisk similar to the way they
are already pushed to ironic-python-agent.

Related-Bug: #1819464
Depends-On: I2229d386bff8ae63e4efe8406770b2b378a1991f
Change-Id: I1afb720ae4ee4ce586c16a440e8edf8c2b23e155
This commit is contained in:
Harald Jensås 2019-03-13 13:44:19 +01:00
parent 5910712d6d
commit 931e88a63e
3 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,8 @@
---
features:
- |
The routes defined using ``host_routes`` option for subnet definitions in
the Undercloud configuration is now also configured in ironic inspeactors
dnsmasq on the Undercloud. The advanced routing options will be pushed to
the inspection ramdisk similar to the way they are already pushed to
IPA (ironic-python-agent).

View File

@ -166,6 +166,7 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'}],
@ -199,6 +200,7 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'}],
@ -225,6 +227,7 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.10.1',
'host_routes': [],
'ip_range': '192.168.10.100,192.168.10.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'}],
@ -253,6 +256,7 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.10.1',
'host_routes': [],
'ip_range': '192.168.10.100,192.168.10.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'}],
@ -280,6 +284,7 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'}],
@ -305,6 +310,7 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'}],
@ -331,6 +337,7 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'}],
@ -379,14 +386,17 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'},
{'gateway': '192.168.10.254',
'host_routes': [],
'ip_range': '192.168.10.100,192.168.10.189',
'netmask': '255.255.255.0',
'tag': 'subnet1'},
{'gateway': '192.168.20.254',
'host_routes': [],
'ip_range': '192.168.20.100,192.168.20.189',
'netmask': '255.255.255.0',
'tag': 'subnet2'}
@ -454,14 +464,17 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'},
{'gateway': '192.168.10.254',
'host_routes': [],
'ip_range': '192.168.10.100,192.168.10.189',
'netmask': '255.255.255.0',
'tag': 'subnet1'},
{'gateway': '192.168.20.254',
'host_routes': [],
'ip_range': '192.168.20.100,192.168.20.189',
'netmask': '255.255.255.0',
'tag': 'subnet2'}
@ -509,10 +522,12 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'},
{'gateway': '192.168.10.254',
'host_routes': [],
'ip_range': '192.168.10.200,192.168.10.254',
'netmask': '255.255.255.0',
'tag': 'subnet1'},
@ -554,10 +569,12 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'},
{'gateway': '192.168.10.222',
'host_routes': [],
'ip_range': '192.168.10.100,192.168.10.199',
'netmask': '255.255.255.0',
'tag': 'subnet1'},
@ -618,14 +635,20 @@ class TestNetworkSettings(base.TestCase):
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': '192.168.24.1',
'host_routes': [{'destination': '10.10.10.254/32',
'nexthop': '192.168.24.1'}],
'ip_range': '192.168.24.100,192.168.24.120',
'netmask': '255.255.255.0',
'tag': 'ctlplane-subnet'},
{'gateway': '192.168.10.254',
'host_routes': [{'destination': '10.10.10.254/32',
'nexthop': '192.168.10.254'}],
'ip_range': '192.168.10.100,192.168.10.189',
'netmask': '255.255.255.0',
'tag': 'subnet1'},
{'gateway': '192.168.20.254',
'host_routes': [{'destination': '10.10.10.254/32',
'nexthop': '192.168.20.254'}],
'ip_range': '192.168.20.100,192.168.20.189',
'netmask': '255.255.255.0',
'tag': 'subnet2'}

View File

@ -225,6 +225,7 @@ def _generate_inspection_subnets():
env_dict['ip_range'] = s.inspection_iprange
env_dict['netmask'] = str(netaddr.IPNetwork(s.cidr).netmask)
env_dict['gateway'] = s.gateway
env_dict['host_routes'] = s.host_routes
env_list.append(env_dict)
return env_list