Here is how to trigger this bug: ### Enable config drive IPv4/IPv6 address injection ### On the compute nodes and controllers, configure ~~~ crudini --set /etc/nova/nova.conf DEFAULT injected_network_template /usr/lib/python2.7/site-packages/nova/virt/interfaces.template crudini --set /etc/nova/nova.conf DEFAULT flat_injected true crudini --set /etc/nova/nova.conf DEFAULT force_config_drive true crudini --set /etc/nova/nova.conf DEFAULT config_drive_cdrom True crudini --set /etc/nova/nova.conf DEFAULT debug true crudini --set /etc/nova/nova.conf DEFAULT use_ipv6 true crudini --set /etc/nova/nova.conf os_vif_linux_bridge use_ipv6 true crudini --set /etc/nova/nova.conf libvirt inject_partition -1 ~~~ Restart all OpenStack services on computes and controllers: ~~~ systemctl list-units | grep nova | awk '{print $1}' | xargs -I {} systemctl restart {} ~~~ ### Use a recent version of cloud-init within the instances ### ~~~ sudo yumdownloader cloud-init pyserial python-jinja2 python-babel python-markupsafe pytz for i in *.rpm;do virt-customize -a rhel.qcow2 --upload $i:/root/$i ; done virt-customize -a rhel.qcow2 -v --run-command 'yum -y localinstall /root/*.rpm' source overcloudrc ~~~ Set password for console login ~~~ virt-customize -a rhel.qcow2 --root-password password:Redhat01 ~~~ Create glance image ~~~ glance image-create --name rhel-cloud-init --file rhel.qcow2 --container-format bare --disk-format qcow2 --progress ~~~ ### Open all security groups and add keypair ### ~~~ nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0 nova secgroup-add-rule default udp 1 65535 0.0.0.0/0 nova secgroup-add-rule default icmp -1 -1 ::/0 nova secgroup-add-rule default tcp 1 65535 ::/0 nova secgroup-add-rule default udp 1 65535 ::/0 ~~~ ~~~ nova keypair-add --pub-key ~/.ssh/id_rsa.pub id_rsa ~~~ ### Configure networks without DHCP ### Make sure that none of the subnets has DHCP enabled! ~~~ # access network neutron net-create provider1 --provider:network_type vlan --provider:physical_network $PROVIDER_PHYSICAL_NETWORK --provider:segmentation_id $PROVIDER_SEGMENTATION_ID --shared --router:external neutron subnet-create --gateway 10.0.0.1 --allocation-pool start=10.0.0.100,end=10.0.0.150 --dns-nameserver 8.8.8.8 --name provider1-subnet provider1 10.0.0.0/24 neutron subnet-update provider1-subnet --disable-dhcp # test networks neutron net-create private-no-dhcp-1 neutron net-delete private-no-dhcp-1 neutron net-create private-no-dhcp-1 neutron net-create private-no-dhcp-2 neutron net-create private-no-dhcp-3 neutron subnet-create --disable-dhcp private-no-dhcp-1 192.168.100.0/24 neutron subnet-create --disable-dhcp private-no-dhcp-1 192.168.101.0/24 neutron subnet-create --disable-dhcp private-no-dhcp-1 192.168.102.0/24 neutron subnet-create --disable-dhcp private-no-dhcp-2 192.168.200.0/24 neutron subnet-create --disable-dhcp --ip-version 6 private-no-dhcp-2 2000:192:168:200::/64 neutron subnet-create --disable-dhcp --ip-version 6 private-no-dhcp-2 2000:192:168:201::/64 neutron subnet-create --disable-dhcp --ip-version 6 --gateway 2000:192:168:202::1 private-no-dhcp-3 2000:192:168:202::/64 neutron subnet-create --disable-dhcp --ip-version 6 --gateway 2000:192:168:203::1 private-no-dhcp-3 2000:192:168:203::/64 neutron subnet-create --disable-dhcp --ip-version 6 --gateway 2000:192:168:204::1 private-no-dhcp-3 2000:192:168:204::/64 ~~~ ~~~ [stack@undercloud-1 ~]$ neutron net-list +--------------------------------------+-------------------+------------------------------------------------------------+ | id | name | subnets | +--------------------------------------+-------------------+------------------------------------------------------------+ | 05e253ca-1878-43a3-854e-287ccc160d4f | private-no-dhcp-2 | c06c0013-3eb8-42cf-a3ab-535bda78c084 2000:192:168:201::/64 | | | | 75c0768c-7359-4abd-96cc-e3ef8003b08f 192.168.200.0/24 | | | | bd1d4188-22fb-495b-943c-866baccf20d0 2000:192:168:200::/64 | | 622f4b76-1891-46b8-a08a-639076377d7e | private-no-dhcp-3 | f815a0b9-6618-41fe-895d-a8de32b237cd 2000:192:168:204::/64 | | | | f1738838-bb98-41f1-8142-fa3f020adc29 2000:192:168:202::/64 | | | | c49858db-91fb-4b34-b086-846d2a6df5d5 2000:192:168:203::/64 | | 6dd84bd5-4da0-4a55-ad66-9b101b82e44d | provider1 | fce9d8c6-ef86-40df-85c8-8a0075eb613d 10.0.0.0/24 | | 9945b557-e7e9-4bdd-a310-e133e95b0c1c | private-no-dhcp-1 | 3713f49a-d866-4bfd-9050-c423dd575215 192.168.100.0/24 | | | | ad4897e0-adb2-40f3-aac3-556862672672 192.168.102.0/24 | | | | 1f32c95f-8d59-47d9-8672-4362e1b57c20 192.168.101.0/24 | | deeef632-a41d-4341-a4f1-5a18511cce97 | private | 61110018-b0c6-4a9e-9511-86175f55dcce 192.168.0.0/24 | | | | b8ff9d8a-6fad-4379-83d4-9a7fb9b0c1d9 2000:192:168:1::/64 | +--------------------------------------+-------------------+------------------------------------------------------------+ ~~~ ### Boot test instance ### ~~~ nova boot --nic net-id=$NETID --nic net-id=$NETID2 --image rhel-cloud-init --flavor m1.small --key-name id_rsa rhel-cloud-init-test ~~~ ### Apply master or branch of cloud-init ### #### RHEL 7 #### Go to root directory of cloud-init clone and create an archive, then copy the archive to undercloud ~~~ tar -czf cloudinit.0.7.9.patch.tar.gz cloudinit/ scp cloudinit.0.7.9.patch.tar.gz root@10.12.208.113:/home/stack/. ~~~ On undercloud, run: ~~~ sudo chown stack. cloudinit.0.7.9.patch.tar.gz sudo yumdownloader python-oauthlib sudo yumdownloader python-crypto cp rhel.qcow2 rhel.patch.qcow2 for i in python-oauthlib* python-crypto*; do virt-customize -a rhel.patch.qcow2 --upload $i:/root/$i; done virt-customize -a rhel.patch.qcow2 -v --run-command 'yum localinstall -y /root/*.rpm' for i in cloudinit.0.7.9.patch.tar.gz ; do virt-customize -a rhel.patch.qcow2 --upload $i:/root/$i; done virt-customize -a rhel.patch.qcow2 -v --run-command 'rm -Rf /usr/lib/python2.7/site-packages/cloudinit ; tar -xzf /root/cloudinit.0.7.9.patch.tar.gz -C /usr/lib/python2.7/site-packages/' glance image-create --name rhel-cloud-init-patch --file rhel.patch.qcow2 --container-format bare --disk-format qcow2 --progress ~~~ Boot an instance ~~~ NETID1=6dd84bd5-4da0-4a55-ad66-9b101b82e44d NETID2=9945b557-e7e9-4bdd-a310-e133e95b0c1c NETID3=05e253ca-1878-43a3-854e-287ccc160d4f NETID4=622f4b76-1891-46b8-a08a-639076377d7e nova boot --nic net-id=$NETID1 --nic net-id=$NETID2 --nic net-id=$NETID3 --nic net-id=$NETID4 --image rhel-cloud-init-patch --flavor m1.small --key-name id_rsa rhel-cloud-init-patch-test ~~~ Note how neutron does not translate this correctly: ~~~ [stack@undercloud-1 ~]$ nova show rhel-cloud-init-patch-test (...) | private-no-dhcp-1 network | 192.168.101.7 | | private-no-dhcp-2 network | 192.168.200.2, 2000:192:168:201::7 | | private-no-dhcp-3 network | 2000:192:168:204::7 | ~~~ Verification on the instance: ~~~ mount /dev/sr0 /mnt cat /mnt/openstack/latest/network_data.json | python -m json.tool (...) "networks": [ { "id": "network0", "ip_address": "10.0.0.106", "link": "tapf7ec043c-b1", "netmask": "255.255.255.0", "network_id": "6dd84bd5-4da0-4a55-ad66-9b101b82e44d", "routes": [ { "gateway": "10.0.0.1", "netmask": "0.0.0.0", "network": "0.0.0.0" } ], "type": "ipv4" }, { "id": "network1", "ip_address": "192.168.101.7", "link": "tap71bedd6b-2e", "netmask": "255.255.255.0", "network_id": "9945b557-e7e9-4bdd-a310-e133e95b0c1c", "routes": [ { "gateway": "192.168.101.1", "netmask": "0.0.0.0", "network": "0.0.0.0" } ], "type": "ipv4" }, { "id": "network2", "ip_address": "192.168.200.2", "link": "tap08ce6a9a-1f", "netmask": "255.255.255.0", "network_id": "05e253ca-1878-43a3-854e-287ccc160d4f", "routes": [ { "gateway": "192.168.200.1", "netmask": "0.0.0.0", "network": "0.0.0.0" } ], "type": "ipv4" }, { "id": "network3", "ip_address": "2000:192:168:201::7", "link": "tap08ce6a9a-1f", "netmask": "ffff:ffff:ffff:ffff::", "network_id": "05e253ca-1878-43a3-854e-287ccc160d4f", "routes": [ { "gateway": "2000:192:168:201::1", "netmask": "::", "network": "::" } ], "type": "ipv6" }, { "id": "network4", "ip_address": "2000:192:168:204::7", "link": "tapf2d2a0e3-73", "netmask": "ffff:ffff:ffff:ffff::", "network_id": "622f4b76-1891-46b8-a08a-639076377d7e", "routes": [ { "gateway": "2000:192:168:204::1", "netmask": "::", "network": "::" } ], "type": "ipv6" } (...) ~~~ Force rerun of cloud-init: [root@rhel-cloud-init-patch-test network-scripts]# rm -Rf /var/lib/cloud/data/* ; cloud-init --force init Cloud-init v. 0.7.9 running 'init' at Thu, 18 May 2017 16:19:44 +0000. Up 839.21 seconds. ci-info: +++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++ ci-info: +--------+------+---------------+---------------+-------+-------------------+ ci-info: | Device | Up | Address | Mask | Scope | Hw-Address | ci-info: +--------+------+---------------+---------------+-------+-------------------+ ci-info: | lo: | True | 127.0.0.1 | 255.0.0.0 | . | . | ci-info: | lo: | True | . | . | d | . | ci-info: | eth1: | True | 192.168.101.7 | 255.255.255.0 | . | fa:16:3e:1e:97:ad | ci-info: | eth1: | True | . | . | d | fa:16:3e:1e:97:ad | ci-info: | eth2: | True | 192.168.200.2 | 255.255.255.0 | . | fa:16:3e:a3:bc:ef | ci-info: | eth2: | True | . | . | d | fa:16:3e:a3:bc:ef | ci-info: | eth0: | True | 10.0.0.106 | 255.255.255.0 | . | fa:16:3e:46:24:4f | ci-info: | eth0: | True | . | . | d | fa:16:3e:46:24:4f | ci-info: | eth3: | True | . | . | . | fa:16:3e:70:41:a3 | ci-info: | eth3: | True | . | . | d | fa:16:3e:70:41:a3 | ci-info: +--------+------+---------------+---------------+-------+-------------------+ ci-info: +++++++++++++++++++++++++++++++Route IPv4 info+++++++++++++++++++++++++++++++ ci-info: +-------+---------------+---------------+---------------+-----------+-------+ ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags | ci-info: +-------+---------------+---------------+---------------+-----------+-------+ ci-info: | 0 | 0.0.0.0 | 192.168.200.1 | 0.0.0.0 | eth2 | UG | ci-info: | 1 | 10.0.0.0 | 0.0.0.0 | 255.255.255.0 | eth0 | U | ci-info: | 2 | 169.254.0.0 | 0.0.0.0 | 255.255.0.0 | eth0 | U | ci-info: | 3 | 169.254.0.0 | 0.0.0.0 | 255.255.0.0 | eth1 | U | ci-info: | 4 | 169.254.0.0 | 0.0.0.0 | 255.255.0.0 | eth2 | U | ci-info: | 5 | 169.254.0.0 | 0.0.0.0 | 255.255.0.0 | eth3 | U | ci-info: | 6 | 192.168.101.0 | 0.0.0.0 | 255.255.255.0 | eth1 | U | ci-info: | 7 | 192.168.200.0 | 0.0.0.0 | 255.255.255.0 | eth2 | U | ci-info: +-------+---------------+---------------+---------------+-----------+-------+ 2017-05-18 12:19:44,917 - util.py[WARNING]: failed stage init failed run of stage init ------------------------------------------------------------ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 648, in status_wrapper ret = functor(name, args) File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 365, in main_init init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL)) File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 649, in apply_network_config return self.distro.apply_network_config(netcfg, bring_up=bring_up) File "/usr/lib/python2.7/site-packages/cloudinit/distros/__init__.py", line 166, in apply_network_config dev_names = self._write_network_config(netconfig) File "/usr/lib/python2.7/site-packages/cloudinit/distros/rhel.py", line 56, in _write_network_config return self._supported_write_network_config(netconfig) File "/usr/lib/python2.7/site-packages/cloudinit/distros/__init__.py", line 82, in _supported_write_network_config renderer.render_network_config(network_config=network_config) File "/usr/lib/python2.7/site-packages/cloudinit/net/renderer.py", line 47, in render_network_config network_state=parse_net_config_data(network_config), target=target) File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", line 42, in parse_net_config_data nsi.parse_config(skip_broken=skip_broken) File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", line 225, in parse_config self.parse_config_v1(skip_broken=skip_broken) File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", line 240, in parse_config_v1 handler(self, command) File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", line 89, in decorator return func(self, command, *args, **kwargs) File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", line 299, in handle_physical subnet['netmask'] = mask2cidr(subnet['netmask']) File "/usr/lib/python2.7/site-packages/cloudinit/net/network_state.py", line 737, in mask2cidr if ':' in mask: TypeError: argument of type 'int' is not iterable ------------------------------------------------------------ [root@rhel-cloud-init-patch-test network-scripts]#