Merge ~akaris/cloud-init:bug1679817-c into cloud-init:master
| Status: | Merged | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Approved by: | Scott Moser on 2017-05-23 | ||||||||||||
| Approved revision: | 48bf21bcb6046f1a2d1d029d286dcbe9eaf4f62e | ||||||||||||
| Merged at revision: | f38fa41317602908139aa96e930b634f65e39555 | ||||||||||||
| Proposed branch: | ~akaris/cloud-init:bug1679817-c | ||||||||||||
| Merge into: | cloud-init:master | ||||||||||||
| Diff against target: |
458 lines (+199/-132) 3 files modified
cloudinit/net/sysconfig.py (+174/-70) tests/unittests/test_distros/test_netconfig.py (+3/-5) tests/unittests/test_net.py (+22/-57) |
||||||||||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | 2017-05-17 | Approve on 2017-05-23 | |
| Server Team CI bot | continuous-integration | 2017-05-17 | Approve on 2017-05-17 |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2017-05-17.
Commit Message
Fix dual stack IPv4/IPv6 configuration for RHEL
Dual stack IPv4/IPv6 configuration via config drive is broken for RHEL7.
This patch fixes several scenarios for IPv4/IPv6/dual stack with multiple IP assignment
Removes unpopular IPv4 alias files and invalid IPv6 alias files
Also fixes associated unit tests
| Andreas Karis (akaris) wrote : | # |
FAILED: Continuous integration, rev:1a401c57978
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:1a401c57978
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
Hi,
I assume this will still work for Centos 6 (5?)
It looks very good, thanks for your work.
Will this work correctly for centos 5 and 6 ?
PASSED: Continuous integration, rev:48bf21bcb60
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
Assuming this works with centos 5, 6, 7, I'm happy to pull this.
| Andreas Karis (akaris) wrote : | # |
Hi,
Let me test all of this out once more and give a final ack.
- Andreas
| Andreas Karis (akaris) wrote : | # |
Test procedure for RHEL 7:
### Enable config drive IPv4/IPv6 address injection ###
On the compute nodes and controllers, configure
~~~
crudini --set /etc/nova/nova.conf DEFAULT injected_
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:
neutron subnet-create --gateway 10.0.0.1 --allocation-pool start=10.
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:
neutron subnet-create --disable-dhcp --ip-version 6 private-no-dhcp-2 2000:192:
neutron subnet-create --disable-dhcp --ip-version 6 --gateway 2000:192:168:202::1 private-no-dhcp-3 2000:192:
neutr...
| Andreas Karis (akaris) wrote : | # |
One issue that I have with this still is the dup default route generation for IPv6:
[root@rhel-
default via 192.168.200.1 dev eth2
10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.106
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
169.254.0.0/16 dev eth2 scope link metric 1004
169.254.0.0/16 dev eth3 scope link metric 1005
192.168.101.0/24 dev eth1 proto kernel scope link src 192.168.101.7
192.168.200.0/24 dev eth2 proto kernel scope link src 192.168.200.2
[root@rhel-
unreachable ::/96 dev lo metric 1024 error -113
unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -113
2000:192:
2000:192:
unreachable 2002:a00::/24 dev lo metric 1024 error -113
unreachable 2002:7f00::/24 dev lo metric 1024 error -113
unreachable 2002:a9fe::/32 dev lo metric 1024 error -113
unreachable 2002:ac10::/28 dev lo metric 1024 error -113
unreachable 2002:c0a8::/32 dev lo metric 1024 error -113
unreachable 2002:e000::/19 dev lo metric 1024 error -113
unreachable 3ffe:ffff::/32 dev lo metric 1024 error -113
fe80::/64 dev eth0 proto kernel metric 256
fe80::/64 dev eth1 proto kernel metric 256
fe80::/64 dev eth2 proto kernel metric 256
fe80::/64 dev eth3 proto kernel metric 256
default via 2000:192:168:201::1 dev eth2 metric 1
default via 2000:192:168:201::1 dev eth2 metric 1024
This could be easy to work around. However, it was never taken into account before that default routes should not be added in the route- and route6- files before, so I'm wondering if this should go into a different fix instead of overloading this one.
| Scott Moser (smoser) wrote : | # |
Akaris, I'm fine to have another subsequent fix to pick up your issue in the last comment.
I'm interested in knowing though if this works for rhel 5 and rhel 6.
I dont want to regress those platforms.
Were you able to verify that ?
Scott
| Andreas Karis (akaris) wrote : | # |
RHEL 6:
~~~
# make sure to have rhel-guest-
# make sure to have python-
# make sure to have python-
virt-customize -a rhel-guest-
for i in *el6ost*.rpm;do virt-customize -a rhel6-cloud-
virt-customize -a rhel6-cloud-
for i in cloudinit.
virt-customize -a rhel6-cloud-
glance image-create --name rhel6-cloud-init --file rhel6-cloud-
nova boot --nic net-id=$NETID1 --nic net-id=$NETID2 --nic net-id=$NETID3 --nic net-id=$NETID4 --image rhel6-cloud-init --flavor m1.small --key-name id_rsa rhel6-cloud-init
~~~
Unfortunately, for RHEL 6, this is not working.
| Andreas Karis (akaris) wrote : | # |
* not working in the sense that: cloud-init is not running for me, my test is flawed, and so far I cannot test this. I'll check with lars about how we can test this.
| Lars Kellogg-Stedman (larsks) wrote : | # |
Just chiming in to say that this seems to work great under RHEL 7 for both plain ipv4 and mixed ipv4/ipv6 environments, with config drive or without. I haven't tested under EL6.
| Scott Moser (smoser) wrote : | # |
Thanks for the input.
We can't break rhel/centos 5 and 6 though.
On May 22, 2017 5:12:13 PM EDT, Lars Kellogg-Stedman <email address hidden> wrote:
>Just chiming in to say that this seems to work great under RHEL 7 for
>both plain ipv4 and mixed ipv4/ipv6 environments, with config drive or
>without. I haven't tested under EL6.
>--
>https:/
>You are reviewing the proposed merge of ~akaris/cloud-init:bug1679817-c
>into cloud-init:master.
| Andreas Karis (akaris) wrote : | # |
Hi,
I think we can at least forget about CentOS/RHEL 5:
https:/
https:/
They went both end of production phase 3 at March 31, 2017
Remains testing for 6 to do
- Andreas
| Scott Moser (smoser) wrote : | # |
Andreas,
thanks for the RHEL 5 info, II agree.
| Lars Kellogg-Stedman (larsks) wrote : | # |
I have tested this under RHEL 6 and it seems to work just fine. It produces a more correct network configuration than does the current master, and it runs without producing any errors.
Setup for testing:
- booted with a recent rhel-guest-image
- removed cloud-init via 'yum -y remove cloud-init'
- cloned cloud-init repository from https:/
- installed via "python setup.py install --init-system sysvinit"
Testing:
- rm -rf /etc/sysconfig/
- cloud-init init --local
- cloud-init init
At this point, /etc/resolv.conf and /etc/sysconfig/
As akaris indicated, I don't think it makes sense to worry about RHEL5 given its current lifecycle stage.
PASSED: Continuous integration, rev:48bf21bcb60
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
Hi,
I'm marking this as 'merged' based on the fact that the new merge proposal *is* merged.
(https:/
Please move back to 'Needs Review' (and explain) if you think otherwise.


Fix dual stack IPv4/IPv6 configuration for RHEL
Dual stack IPv4/IPv6 configuration via config drive is broken for RHEL7.
This patch fixes several scenarios for IPv4/IPv6/dual stack with multiple IP assignment
Removes unpopular IPv4 alias files and invalid IPv6 alias files
Also fixes associated unit tests
LP: #1679817
LP: #1685534
LP: #1685532