yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #91560
[Bug 1785275] Re: cloud-init pre-networking fails if kernel cmdline defines static ip
Fix released in 20.1
** Changed in: cloud-init
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1785275
Title:
cloud-init pre-networking fails if kernel cmdline defines static ip
Status in cloud-init:
Fix Released
Bug description:
cloud-init pre-networking fails when grub is configured to use a
static IP with the 'autoconf' field set to 'none'
(https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt).
Cloud provider: vsphere
Static IP is configured here (/etc/default/grub).
---
# https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
# off or none: don't use autoconfiguration (do static IP assignment instead)
GRUB_CMDLINE_LINUX=ip=10.121.105.37::10.121.104.1:255.255.252.0::eth0:none
---
Error:
File "/usr/lib/python3/dist-packages/cloudinit/net/cmdline.py", line 58, in _klibc_to_config_entry
raise ValueError("Unexpected value for PROTO: %s" % proto)
ValueError: Unexpected value for PROTO: none
Workarounds:
Option 1. Change the grub config to use 'dhcp' even though it defines most of the fields statically
GRUB_CMDLINE_LINUX=ip=10.121.105.37::10.121.104.1:255.255.252.0::eth0:dhcp
Option 2. Patch to normalize 'none' to 'static' (I'd guess there's a more proper fix further up the call)
--- /usr/lib/python3/dist-packages/cloudinit/net/cmdline.py.orig 2018-08-03 15:44:11.204005997 +0000
+++ /usr/lib/python3/dist-packages/cloudinit/net/cmdline.py 2018-08-03 15:44:15.448006149 +0000
@@ -52,6 +52,8 @@
else:
proto = 'static'
+ if proto == 'none':
+ proto = 'static'
if proto not in ('static', 'dhcp', 'dhcp6'):
raise ValueError("Unexpected value for PROTO: %s" % proto)
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1785275/+subscriptions
References