sysconfig renders BOOTPROTO=dhcp even if dhcp=false in v2 network-config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Unassigned |
Bug Description
Distribution: Fedora 29
Cloud Provider: None, NoCloud
Cloud-Init Version: 18.5 (also 17.1)
Network Config V2:
version: 2
ethernets:
ens3:
match:
macaddress: 52:54:00:ab:cd:ef
dhcp4: false
dhcp6: false
addresses:
- 192.168.42.100/24
- 2001:db8::100/32
gateway4: 192.168.42.1
gateway6: 2001:db8::1
nameservers:
search: [example.com]
addresses: [192.168.42.53, 1.1.1.1]
Renders to /etc/sysconfig/
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEFROUTE=yes
DEVICE=ens3
DHCPV6C=yes
DNS1=192.168.42.53
DNS2=1.1.1.1
DOMAIN=example.com
GATEWAY=
HWADDR=
IPADDR=
IPV6ADDR=
IPV6INIT=yes
IPV6_DEFAULTGW=
NETMASK=
NM_CONTROLLED=no
ONBOOT=yes
STARTMODE=auto
TYPE=Ethernet
USERCTL=no
But 'BOOTPROTO=dhcp' should be 'BOOTPROTO=none' and 'DHCPV6C=yes' should be 'DHCPV6C=no' or missing.
Already fixed this: https:/
Related branches
- Server Team CI bot: Approve (continuous-integration)
-
Diff: 94 lines (+63/-2)2 files modifiedcloudinit/net/network_state.py (+2/-2)
tests/unittests/test_net.py (+61/-0)
Changed in cloud-init: | |
importance: | Undecided → High |
status: | New → Confirmed |
I verified the error with the supplied config in this bug.
% cat network_ configs/ fedora29- netplan- dhcp.yaml cmd/main. py devel net-convert --debug --network-data network_ configs/ fedora29- netplan- dhcp.yaml --kind yaml -O sysconfig --distro fedora -d fedora_test
network:
version: 2
ethernets:
ens3:
match:
macaddress: 52:54:00:ab:cd:ef
dhcp4: false
dhcp6: false
addresses:
- 192.168.42.100/24
- 2001:db8::100/32
gateway4: 192.168.42.1
gateway6: 2001:db8::1
nameservers:
search: [example.com]
addresses: [192.168.42.53, 1.1.1.1]
(neipa) cloud-init % PYTHONPATH=`pwd` python3 cloudinit/
After apply your suggested patch, this resolve the issue.
% diff -u fedora_ test/etc/ sysconfig/ network- scripts/ ifcfg-ens3 fedora_ test_fix/ etc/sysconfig/ network- scripts/ ifcfg-ens3 test/etc/ sysconfig/ network- scripts/ ifcfg-ens3 2019-02-28 11:42:06.313736619 -0600 test_fix/ etc/sysconfig/ network- scripts/ ifcfg-ens3 2019-02-28 11:46:42.839672661 -0600
--- fedora_
+++ fedora_
@@ -1,9 +1,8 @@
# Created by cloud-init on instance boot automatically, do not edit.
#
-BOOTPROTO=dhcp
+BOOTPROTO=none
DEFROUTE=yes
DEVICE=ens3
-DHCPV6C=yes
DNS1=192.168.42.53
DNS2=1.1.1.1
DOMAIN=example.com