[openstack-dev] [tripleo][heat] where does ip_netmask in network_config come from?

Mark Hamzy hamzy at us.ibm.com
Wed Jun 6 20:15:00 UTC 2018


When the system boots up, the IP addresses seem correct:

Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |     eno5:  | 
True |       .       |       .       |   .   | 6c:ae:8b:25:34:ed |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |     eno4:  | 
True | 9.114.118.241 | 255.255.255.0 |   .   | 6c:ae:8b:25:34:ec |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |     eno4:  | 
True |       .       |       .       |   d   | 6c:ae:8b:25:34:ec |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: | 
enp0s29u1u1u5: | True |       .       |       .       |   .   | 
6e:ae:8b:25:34:e9 |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: | 
enp0s29u1u1u5: | True |       .       |       .       |   d   | 
6e:ae:8b:25:34:e9 |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |      lo:   | 
True |   127.0.0.1   |   255.0.0.0   |   .   |         .         |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |      lo:   | 
True |       .       |       .       |   d   |         .         |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |     eno3:  | 
True | 9.114.219.197 | 255.255.255.0 |   .   | 6c:ae:8b:25:34:eb |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |     eno3:  | 
True |       .       |       .       |   d   | 6c:ae:8b:25:34:eb |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |     eno2:  | 
True |  9.114.219.44 | 255.255.255.0 |   .   | 6c:ae:8b:25:34:ea |
Jun  6 12:43:07 overcloud-controller-0 cloud-init: ci-info: |     eno2:  | 
True |       .       |       .       |   d   | 6c:ae:8b:25:34:ea |

However, I am seeing the following when run-os-net-config.sh is run.  I 
put in a (sudo ip route; sudo ip -o address; sudo ip route get to 
${METADATA_IP}) before the ping check:

default via 9.114.219.254 dev eno3 proto dhcp metric 101
9.114.219.0/24 dev br-ex proto kernel scope link src 9.114.219.193
9.114.219.0/24 dev eno2 proto kernel scope link src 9.114.219.193
9.114.219.0/24 dev eno3 proto kernel scope link src 9.114.219.197 metric 
101
169.254.95.0/24 dev enp0s29u1u1u5 proto kernel scope link src 
169.254.95.120 metric 103
169.254.169.254 via 9.114.219.30 dev eno2

1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever 
preferred_lft forever
1: lo    inet6 ::1/128 scope host \       valid_lft forever preferred_lft 
forever
2: eno2    inet 9.114.219.193/24 brd 9.114.219.255 scope global eno2\  
valid_lft forever preferred_lft forever
2: eno2    inet6 fe80::6eae:8bff:fe25:34ea/64 scope link tentative \ 
valid_lft forever preferred_lft forever
3: eno3    inet 9.114.219.197/24 brd 9.114.219.255 scope global 
noprefixroute dynamic eno3\       valid_lft 538sec preferred_lft 538sec
3: eno3    inet6 fd55:faaf:e1ab:3d9:6eae:8bff:fe25:34eb/64 scope global 
mngtmpaddr dynamic \       valid_lft 2591961sec preferred_lft 604761sec
3: eno3    inet6 fe80::6eae:8bff:fe25:34eb/64 scope link \       valid_lft 
forever preferred_lft forever
6: enp0s29u1u1u5    inet 169.254.95.120/24 brd 169.254.95.255 scope link 
noprefixroute dynamic enp0s29u1u1u5\       valid_lft 539sec preferred_lft 
539sec
6: enp0s29u1u1u5    inet6 fe80::6cae:8bff:fe25:34e9/64 scope link \ 
valid_lft forever preferred_lft forever
8: br-ex    inet 9.114.219.193/24 brd 9.114.219.255 scope global br-ex\  
valid_lft forever preferred_lft forever
8: br-ex    inet6 fe80::6eae:8bff:fe25:34ec/64 scope link \ valid_lft 
forever preferred_lft forever

9.114.219.30 dev br-ex src 9.114.219.193
    cache

Trying to ping metadata IP 9.114.219.30...FAILURE

It seems  like the data is coming from:

[root at overcloud-controller-0 ~]# cat /etc/os-net-config/config.json 
{"network_config": [{"addresses": [{"ip_netmask": "9.114.219.196/24"}], 
"dns_servers": ["8.8.8.8", "8.8.4.4"], "name": "nic1", "routes": 
[{"ip_netmask": "169.254.169.254/32", "next_hop": "9.114.219.30"}], 
"type": "interface", "use_dhcp": false}, {"addresses": [{"ip_netmask": 
"9.114.219.196/24"}], "dns_servers": ["8.8.8.8", "8.8.4.4"], "members": 
[{"name": "nic3", "primary": true, "type": "interface"}], "name": "br-ex", 
"routes": [{"default": true, "next_hop": "9.114.118.254"}], "type": 
"ovs_bridge", "use_dhcp": false}]}

Also in the log I see:

...
Jun  6 12:45:15 overcloud-controller-0 os-collect-config: [2018/06/06 
12:43:53 PM] [INFO] Active nics are ['eno2', 'eno3', 'eno4']
Jun  6 12:45:15 overcloud-controller-0 os-collect-config: [2018/06/06 
12:43:53 PM] [INFO] nic1 mapped to: eno2
Jun  6 12:45:15 overcloud-controller-0 os-collect-config: [2018/06/06 
12:43:53 PM] [INFO] nic2 mapped to: eno3
Jun  6 12:45:15 overcloud-controller-0 os-collect-config: [2018/06/06 
12:43:53 PM] [INFO] nic3 mapped to: eno4
...

templates/nic-configs/controller.yaml has the following section:
...
            $network_config:
              network_config:
              - type: interface
                name: nic1
                use_dhcp: false
                dns_servers:
                  get_param: DnsServers
                addresses:
                - ip_netmask:
                    list_join:
                    - /
                    - - get_param: ControlPlaneIp
                      - get_param: ControlPlaneSubnetCidr
                routes:
                - ip_netmask: 169.254.169.254/32
                  next_hop:
                    get_param: EC2MetadataIp
              - type: ovs_bridge
                name: bridge_name
                dns_servers:
                  get_param: DnsServers
                use_dhcp: false
                addresses:
                - ip_netmask:
                    get_param: ExternalIpSubnet
                routes:
                - default: true
                  next_hop:
                    get_param: ExternalInterfaceDefaultRoute
                members:
                - type: interface
                  name: nic3
                  primary: true
...

(undercloud) [stack at oscloud5 ~]$ grep External 
templates/environments/network-environment.yaml  
  ExternalNetCidr: 9.114.118.0/24
  ExternalNetworkVlanID: 10
  ExternalAllocationPools: [{'start': '9.114.118.240', 'end': 
'9.114.118.248'}]
  ExternalInterfaceDefaultRoute: 9.114.118.254
(undercloud) [stack at oscloud5 ~]$ grep Control 
templates/environments/network-environment.yaml  
  # Port assignments for the Controller
  OS::TripleO::Controller::Net::SoftwareConfig:
  ControlPlaneSubnetCidr: '24'
  ControlPlaneDefaultRoute: 9.114.219.254

Also is there a way to dump heat variables?

-- 
Mark

You must be the change you wish to see in the world. -- Mahatma Gandhi
Never let the future disturb you. You will meet it, if you have to, with 
the same weapons of reason which today arm you against the present. -- 
Marcus Aurelius

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20180606/556520b6/attachment.html>


More information about the OpenStack-dev mailing list