cloud-init pre-networking fails if kernel cmdline defines static ip

Bug #1785275 reported by Tracy Meyers on 2018-08-03
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

cloud-init pre-networking fails when grub is configured to use a static IP with the 'autoconf' field set to 'none' (

Cloud provider: vsphere

Static IP is configured here (/etc/default/grub).
# off or none: don't use autoconfiguration (do static IP assignment instead)

  File "/usr/lib/python3/dist-packages/cloudinit/net/", line 58, in _klibc_to_config_entry
    raise ValueError("Unexpected value for PROTO: %s" % proto)
ValueError: Unexpected value for PROTO: none

Option 1. Change the grub config to use 'dhcp' even though it defines most of the fields statically

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/ 2018-08-03 15:44:11.204005997 +0000
+++ /usr/lib/python3/dist-packages/cloudinit/net/ 2018-08-03 15:44:15.448006149 +0000
@@ -52,6 +52,8 @@
             proto = 'static'

+ if proto == 'none':
+ proto = 'static'
     if proto not in ('static', 'dhcp', 'dhcp6'):
         raise ValueError("Unexpected value for PROTO: %s" % proto)

Tracy Meyers (tracy-meyers) wrote :
Scott Moser (smoser) wrote :

You mention 'grub', is this at all specific to grub? or is this just kernel command line specific.

Tracy Meyers (tracy-meyers) wrote :

Kernel command line specific as documented here I just configure this via grub.

Scott Moser (smoser) on 2018-08-03
summary: - cloud-init pre-networking fails if grub defines static ip
+ cloud-init pre-networking fails if kernel cmdline defines static ip
Kevin (kevindtimm) wrote :

Attached is a patch for this modification

Scott Moser (smoser) wrote :

To contribute to cloud-init, please follow the HACKING.rst doc. You can view it online at

Please let me know ifyou have any questions.

With respect to comments on the patch, we'd want to have a unit test that pushes the code through this path. If you have questions or need help, please feel free to ask.

Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers