Public bug reported:

I use the following cloud-init configuration works perfectly for Ubuntu
14.04, Ubuntu 16.04, Debian 8, Debian 9 and Centos 7 but not with the
new Ubuntu 18.04


--- 8< 8< 8< ---
#cloud-config

datasource:
  Ec2:
    strict_id: false

hostname: my_cloudserver_name
phone_home:
  url: http://169.254.169.254/2009-04-04/done
  post: [ instance_id ]
  tries: 10

users:
  - default

ssh_authorized_keys:
  - "ssh-rsa AAA ....=="
--- 8< 8< 8< ---

The installation process hangs here and will fail:

2018-02-01 13:37:47,126 - DataSourceEc2.py[WARNING]: Did not find a fallback 
interface on EC2.
2018-02-01 13:37:47,126 - util.py[WARNING]: failed stage init
failed run of stage init
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 650, in 
status_wrapper
    ret = functor(name, args)
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 357, in 
main_init
    init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
  File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 635, in 
apply_network_config
    netcfg, src = self._find_networking_config()
  File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 622, in 
_find_networking_config
    if self.datasource and hasattr(self.datasource, 'network_config'):
  File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceEc2.py", 
line 338, in network_config
    macs_to_nics = {net.get_interface_mac(iface): iface}
  File "/usr/lib/python3/dist-packages/cloudinit/net/__init__.py", line 506, in 
get_interface_mac
    if os.path.isdir(sys_dev_path(ifname, "bonding_slave")):
  File "/usr/lib/python3/dist-packages/cloudinit/net/__init__.py", line 38, in 
sys_dev_path
    return get_sys_class_path() + devname + "/" + path
TypeError: must be str, not NoneType
------------------------------------------------------------

after adding:

--- 8< 8< 8< ---
packages:
  - ifupdown
--- 8< 8< 8< ---

the cloud-init works as wished.

---
...
ci-info: 
+-------+---------------+---------------+-----------------+-----------+-------+
2018-02-01 14:19:41,576 - DataSourceEc2.py[WARNING]: Metadata 'network' key not 
valid: None.
2018-02-01 14:19:41,777 - cc_resizefs.py[WARNING]: Device '/dev/vda1' did not 
exist. cannot resize: dev=/dev/vda1 mnt_point=/ path=/
Generating public/private rsa key pair.
...
---

It seems there is a dependency in cloud-init to the pre-netplan
networking system in 18.04.

** Affects: cloud-init (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1747382

Title:
  cloud-init init fails on 18.04 in the networking part

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1747382/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to