Closed ubuntu-server-builder closed 1 year ago
Launchpad user Andreas Karis(akaris) wrote on 2017-04-21T21:01:07.517635+00:00
With the above modification of 'print subnets', I ran this twice:
[{u'routes': [{u'netmask': u'0.0.0.0', u'network': u'0.0.0.0', u'gateway': u'192.168.0.1'}], u'netmask': u'255.255.255.0', u'type': 'static', 'ipv4': True, 'address': u'192.168.0.11'}, {u'routes': [{u'netmask': 0, u'network': u'::', u'gateway': u'2000:192:168::1'}], u'netmask': 64, 'ipv6': True, u'type': 'static', 'address': u'2000:192:168::5'}] [root@rhel2 ~]#
Note that the netmask changed: u'ffff:ffff:ffff:ffff::', 'address': u'2000:192:168::5' vs u'netmask': 64, 'ipv6': True, u'type': 'static', 'address': u'2000:192:168::5'
Launchpad user Andreas Karis(akaris) wrote on 2017-05-18T16:20:43.151614+00:00
Here is how to trigger this bug:
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 {}
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
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
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 |
+--------------------------------------+-------------------+------------------------------------------------------------+
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
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]#
Launchpad user Scott Moser(smoser) wrote on 2017-05-26T18:35:50.217254+00:00
Heres a simple recreate using net-convert.py
$ cat simple-ipv6.yaml version: 1 config:
$ PYTHONPATH=$PWD ./tools/net-convert.py --network-data=simple-ipv6.yaml \
--kind=yaml --output-kind=eni --directory=out.d
...
Traceback (most recent call last):
File "./tools/net-convert.py", line 82, in
Launchpad user Brian Murray(brian-murray) wrote on 2017-06-13T18:05:00.212108+00:00
Hello Andreas, or anyone else affected,
Accepted cloud-init into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-153-g16a7302f-0ubuntu1~17.04.1 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.
Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!
Launchpad user Brian Murray(brian-murray) wrote on 2017-06-13T18:53:34.127541+00:00
Hello Andreas, or anyone else affected,
Accepted cloud-init into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-153-g16a7302f-0ubuntu1~16.10.1 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.
Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!
Launchpad user Brian Murray(brian-murray) wrote on 2017-06-13T19:07:06.008442+00:00
Hello Andreas, or anyone else affected,
Accepted cloud-init into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-153-g16a7302f-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.
Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!
Launchpad user Chad Smith(chad.smith) wrote on 2017-06-13T21:41:37.943824+00:00
Validated xenial yakkety and zesty
xenial START -------------- Input YAML config:
Internal State !!python/object:cloudinit.net.network_state.NetworkState _network_state: dns: nameservers: [] search: [] interfaces: eth0: address: null gateway: null inet: inet mac_address: null mode: manual mtu: null name: eth0 subnets:
Generated intefaces START ---- auto lo iface lo inet loopback
auto eth0 iface eth0 inet6 static address 2000:192:168::5 netmask 64 post-up route add -A inet6 default gw 2000:192:168::1 || true pre-down route del -A inet6 default gw 2000:192:168::1 || true Generated intefaces END ---- Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= ii cloud-init 0.7.9-153-g1 all Init scripts for cloud instances xenial DONE -------------- yakkety START -------------- Input YAML config:
Internal State !!python/object:cloudinit.net.network_state.NetworkState _network_state: dns: nameservers: [] search: [] interfaces: eth0: address: null gateway: null inet: inet mac_address: null mode: manual mtu: null name: eth0 subnets:
Generated intefaces START ---- auto lo iface lo inet loopback
auto eth0 iface eth0 inet6 static address 2000:192:168::5 netmask 64 post-up route add -A inet6 default gw 2000:192:168::1 || true pre-down route del -A inet6 default gw 2000:192:168::1 || true Generated intefaces END ---- Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= ii cloud-init 0.7.9-153-g1 all Init scripts for cloud instances yakkety DONE -------------- zesty START -------------- Input YAML config:
Internal State !!python/object:cloudinit.net.network_state.NetworkState _network_state: dns: nameservers: [] search: [] interfaces: eth0: address: null gateway: null inet: inet mac_address: null mode: manual mtu: null name: eth0 subnets:
Generated intefaces START ---- auto lo iface lo inet loopback
auto eth0 iface eth0 inet6 static address 2000:192:168::5 netmask 64 post-up route add -A inet6 default gw 2000:192:168::1 || true pre-down route del -A inet6 default gw 2000:192:168::1 || true Generated intefaces END ---- Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= ii cloud-init 0.7.9-153-g1 all Init scripts for cloud instances zesty DONE --------------
Launchpad user Launchpad Janitor(janitor) wrote on 2017-06-27T15:51:34.880334+00:00
This bug was fixed in the package cloud-init - 0.7.9-153-g16a7302f-0ubuntu1~17.04.1
cloud-init (0.7.9-153-g16a7302f-0ubuntu1~17.04.1) zesty-proposed; urgency=medium
New upstream snapshot.
-- Scott Moser smoser@ubuntu.com Fri, 26 May 2017 16:14:09 -0400
Launchpad user Steve Langasek(vorlon) wrote on 2017-06-27T15:52:13.653732+00:00
The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.
Launchpad user Launchpad Janitor(janitor) wrote on 2017-06-27T15:54:02.062609+00:00
This bug was fixed in the package cloud-init - 0.7.9-153-g16a7302f-0ubuntu1~16.10.1
cloud-init (0.7.9-153-g16a7302f-0ubuntu1~16.10.1) yakkety-proposed; urgency=medium
New upstream snapshot.
-- Scott Moser smoser@ubuntu.com Fri, 26 May 2017 16:08:21 -0400
Launchpad user Launchpad Janitor(janitor) wrote on 2017-06-27T15:54:45.867129+00:00
This bug was fixed in the package cloud-init - 0.7.9-153-g16a7302f-0ubuntu1~16.04.1
cloud-init (0.7.9-153-g16a7302f-0ubuntu1~16.04.1) xenial-proposed; urgency=medium
New upstream snapshot.
-- Scott Moser smoser@ubuntu.com Fri, 26 May 2017 15:58:48 -0400
Launchpad user Scott Moser(smoser) wrote on 2017-09-23T02:31:12.584401+00:00
This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New
Thank you.
This bug was originally filed in Launchpad as LP: #1684349
Launchpad details
Launchpad user Andreas Karis(akaris) wrote on 2017-04-20T04:23:31.742980+00:00
=== Begin SRU Template === [Impact] On Openstack instances, when rendering sysconfig output, cloud-init would stacktrace due to a TypeError. This affects runtime only when rendering sysconfig networking, which is what is used on CentOS and RedHat systems.
[Test Case] The basic idea below is: a.) launch an instance with proposed version of cloud-init. b.) inside instance, get cloud-init's network rendering tool from trunk c.) run the rendering tool against a config that failed before. d.) check rendered netplan config to verify it has the correct format. The failed output would have 'addresses' with a format like: 172.19.1.34/255.255.255.0 The expected output would be 'cidr' format: 172.19.1.34/24
launch an instance.
$ release=xenial $ ref=$release-proposed $ lxc-proposed-snapshot --proposed --publish $release $ref $ lxc launch $ref $name $ lxc exec $name
get render tool
% wget https://git.launchpad.net/~cloud-init-dev/cloud-init/plain/tools/net-convert.py -O net-convert.py
write the network_data.json
% cat > simple-ipv6.yaml <<EOF version: 1 config: - type: physical name: eth0 subnets: - type: static address: "2000:192:168::5" netmask: 64 routes: - netmask: 0 gateway: "2000:192:168::1" network: "::" EOF
run the converter
% ./net-convert.py --network-data=simple-ipv6.yaml \ --kind=yaml --output-kind=eni --directory=out.d
check the output
% cat out.d/etc/network/interfaces auto lo iface lo inet loopback
auto eth0 iface eth0 inet6 static address 2000:192:168::5 netmask 64 post-up route add -A inet6 default gw 2000:192:168::1 || true pre-down route del -A inet6 default gw 2000:192:168::1 || true
show the cloud-init versions
% dpkg-query --show cloud-init ...
[Regression Potential] The fix here was just to make a common networking method accept a string input as intended rather than only an integer.
The common code changes could shake out other failures in the networking path.
[Other Info] Upstream commit at https://git.launchpad.net/cloud-init/commit/?id=16a7302f6a
lxc-proposed-snapshot is https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/tree/bin/lxc-proposed-snapshot It publishes an image to lxd with proposed enabled and cloud-init upgraded. === End SRU Template ===
mask2cidr error with integer value - argument of type 'int' is not iterable
is not type safe. It tries to take into account that this can be a prefix (so it does not contain ':' not '.' and then return mask. The problem is that if mask is an integer, then this returns:
Made a modification to the code to troubleshoot this:
This error can be hit on RHEL when running the following 2x (don't know why 2x):
rm -Rf /var/lib/cloud/data/* ; cloud-init --force init
On the second run, this will be returned:
not the
u'netmask': 64
integerThis can be fixed by changing the code to: