cloud-init 0.7.8 support broken on FreeBSD

Bug #1625802 reported by Bert JW Regeer
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Undecided
Unassigned

Bug Description

/usr/local/bin/cloud-init startingWARN: no logging configured! (tried 0 configs)
Setting up basic logging...
Cloud-init v. 0.7.8 running 'init-local' at Tue, 20 Sep 2016 20:04:22 +0000. Up 5.53116703033 seconds.
2016-09-20 20:04:22,602 - util.py[DEBUG]: Cloud-init v. 0.7.8 running 'init-local' at Tue, 20 Sep 2016 20:04:22 +0000. Up 5.53116703033 seconds.
2016-09-20 20:04:22,607 - util.py[DEBUG]: Writing to /var/log/cloud-init.log - ab: [420] 0 bytes
2016-09-20 20:04:22,615 - util.py[DEBUG]: Changing the ownership of /var/log/cloud-init.log to 0:0
2016-09-20 20:04:22,618 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance/boot-finished
2016-09-20 20:04:22,619 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/data/no-net
2016-09-20 20:04:22,621 - handlers.py[DEBUG]: start: init-local/check-cache: attempting to read from cache [check]
2016-09-20 20:04:22,623 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False)
2016-09-20 20:04:22,624 - stages.py[DEBUG]: no cache found
2016-09-20 20:04:22,626 - handlers.py[DEBUG]: finish: init-local/check-cache: SUCCESS: no cache found
2016-09-20 20:04:22,627 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance
2016-09-20 20:04:22,636 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.freebsd.Distro'>
2016-09-20 20:04:22,638 - __init__.py[DEBUG]: Looking for for data source in: ['ConfigDrive', 'OpenStack', 'Ec2'], via packages ['', u'cloudinit.sources'] that matches dependencies ['FILESYSTEM']
2016-09-20 20:04:22,655 - __init__.py[DEBUG]: Searching for local data source in: [u'DataSourceConfigDrive']
2016-09-20 20:04:22,657 - handlers.py[DEBUG]: start: init-local/search-ConfigDrive: searching for local data from DataSourceConfigDrive
2016-09-20 20:04:22,659 - __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.sources.DataSourceConfigDrive.DataSourceConfigDrive'>
2016-09-20 20:04:22,663 - util.py[DEBUG]: Running command ['blkid', '-odevice', '/dev/sr0'] with allowed return codes [0, 2] (shell=False, capture=True)
2016-09-20 20:04:22,676 - util.py[DEBUG]: Running command ['blkid', '-odevice', '/dev/sr1'] with allowed return codes [0, 2] (shell=False, capture=True)
2016-09-20 20:04:22,684 - util.py[DEBUG]: Running command ['blkid', '-odevice', '/dev/cd0'] with allowed return codes [0, 2] (shell=False, capture=True)
2016-09-20 20:04:22,698 - util.py[DEBUG]: Running command ['blkid', '-odevice', '/dev/cd1'] with allowed return codes [0, 2] (shell=False, capture=True)
2016-09-20 20:04:22,706 - util.py[DEBUG]: Running command ['blkid', '-tTYPE=vfat', '-odevice'] with allowed return codes [0, 2] (shell=False, capture=True)
2016-09-20 20:04:22,713 - util.py[DEBUG]: Running command ['blkid', '-tTYPE=iso9660', '-odevice'] with allowed return codes [0, 2] (shell=False, capture=True)
2016-09-20 20:04:22,719 - util.py[DEBUG]: Running command ['blkid', '-tLABEL=config-2', '-odevice'] with allowed return codes [0, 2] (shell=False, capture=True)
2016-09-20 20:04:22,730 - util.py[DEBUG]: Running command mount with allowed return codes [0] (shell=False, capture=True)
2016-09-20 20:04:22,736 - util.py[DEBUG]: Fetched {u'/dev/vtbd0p2': {'mountpoint': u'/', 'opts': u'journaled soft-updates', 'fstype': u'ufs'}} mounts from mount
2016-09-20 20:04:22,738 - util.py[DEBUG]: Running command ['mount', '-o', 'ro', '-t', 'cd9660', u'/dev/cd0', '/tmp/tmpgzEsG5'] with allowed return codes [0] (shell=False, capture=True)
2016-09-20 20:04:22,787 - openstack.py[DEBUG]: Selected version '2015-10-15' from ['2012-08-10', '2013-04-04', '2013-10-17', '2015-10-15', 'latest']
2016-09-20 20:04:22,789 - util.py[DEBUG]: Reading from /tmp/tmpgzEsG5/openstack/2015-10-15/vendor_data.json (quiet=False)
2016-09-20 20:04:22,794 - util.py[DEBUG]: Read 2 bytes from /tmp/tmpgzEsG5/openstack/2015-10-15/vendor_data.json
2016-09-20 20:04:22,796 - util.py[DEBUG]: Reading from /tmp/tmpgzEsG5/openstack/2015-10-15/user_data (quiet=False)
2016-09-20 20:04:22,798 - openstack.py[DEBUG]: Failed reading optional path /tmp/tmpgzEsG5/openstack/2015-10-15/user_data due to: [Errno 2] No such file or directory: '/tmp/tmpgzEsG5/openstack/2015-10-15/user_data'
2016-09-20 20:04:22,801 - util.py[DEBUG]: Reading from /tmp/tmpgzEsG5/openstack/2015-10-15/network_data.json (quiet=False)
2016-09-20 20:04:22,804 - util.py[DEBUG]: Read 1118 bytes from /tmp/tmpgzEsG5/openstack/2015-10-15/network_data.json
2016-09-20 20:04:22,806 - util.py[DEBUG]: Reading from /tmp/tmpgzEsG5/openstack/2015-10-15/meta_data.json (quiet=False)
2016-09-20 20:04:22,809 - util.py[DEBUG]: Read 1821 bytes from /tmp/tmpgzEsG5/openstack/2015-10-15/meta_data.json
2016-09-20 20:04:22,814 - util.py[DEBUG]: Reading from /tmp/tmpgzEsG5/ec2/latest/meta-data.json (quiet=False)
2016-09-20 20:04:22,817 - util.py[DEBUG]: Read 963 bytes from /tmp/tmpgzEsG5/ec2/latest/meta-data.json
2016-09-20 20:04:22,819 - util.py[DEBUG]: Running command ['umount', '/tmp/tmpgzEsG5'] with allowed return codes [0] (shell=False, capture=True)
2016-09-20 20:04:22,830 - util.py[DEBUG]: Recursively deleting /tmp/tmpgzEsG5
2016-09-20 20:04:22,834 - util.py[DEBUG]: Reading from /var/lib/cloud/data/instance-id (quiet=False)
2016-09-20 20:04:22,836 - handlers.py[DEBUG]: finish: init-local/search-ConfigDrive: SUCCESS: found local data from DataSourceConfigDrive
2016-09-20 20:04:22,838 - stages.py[INFO]: Loaded datasource DataSourceConfigDrive - DataSourceConfigDrive [net,ver=2][source=/dev/cd0]
2016-09-20 20:04:22,840 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg (quiet=False)
2016-09-20 20:04:22,842 - util.py[DEBUG]: Reading from /usr/local/etc/cloud/cloud.cfg (quiet=False)
2016-09-20 20:04:22,857 - util.py[DEBUG]: Read 2037 bytes from /usr/local/etc/cloud/cloud.cfg
2016-09-20 20:04:22,858 - util.py[DEBUG]: Attempting to load yaml from string of length 2037 with allowed root types (<type 'dict'>,)
2016-09-20 20:04:22,878 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance
2016-09-20 20:04:22,879 - util.py[DEBUG]: Creating symbolic link from '/var/lib/cloud/instance' => '/var/lib/cloud/instances/aba344ee-5536-4f23-a035-721f4060807b'
2016-09-20 20:04:22,884 - util.py[DEBUG]: Reading from /var/lib/cloud/instances/aba344ee-5536-4f23-a035-721f4060807b/datasource (quiet=False)
2016-09-20 20:04:22,886 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/aba344ee-5536-4f23-a035-721f4060807b/datasource - wb: [420] 74 bytes
2016-09-20 20:04:22,888 - util.py[DEBUG]: Writing to /var/lib/cloud/data/previous-datasource - wb: [420] 74 bytes
2016-09-20 20:04:22,890 - util.py[DEBUG]: Reading from /var/lib/cloud/data/instance-id (quiet=False)
2016-09-20 20:04:22,891 - stages.py[DEBUG]: previous iid found to be NO_PREVIOUS_INSTANCE_ID
2016-09-20 20:04:22,892 - util.py[DEBUG]: Writing to /var/lib/cloud/data/instance-id - wb: [420] 37 bytes
2016-09-20 20:04:22,894 - util.py[DEBUG]: Writing to /run/cloud-init/.instance-id - wb: [420] 37 bytes
2016-09-20 20:04:22,895 - util.py[DEBUG]: Writing to /var/lib/cloud/data/previous-instance-id - wb: [420] 24 bytes
2016-09-20 20:04:22,898 - util.py[DEBUG]: Writing to /var/lib/cloud/instance/obj.pkl - wb: [256] 8583 bytes
2016-09-20 20:04:22,899 - main.py[DEBUG]: [local] init will now be targeting instance id: aba344ee-5536-4f23-a035-721f4060807b. new=True
2016-09-20 20:04:22,901 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg (quiet=False)
2016-09-20 20:04:22,902 - util.py[DEBUG]: Reading from /usr/local/etc/cloud/cloud.cfg (quiet=False)
2016-09-20 20:04:22,903 - util.py[DEBUG]: Read 2037 bytes from /usr/local/etc/cloud/cloud.cfg
2016-09-20 20:04:22,904 - util.py[DEBUG]: Attempting to load yaml from string of length 2037 with allowed root types (<type 'dict'>,)
2016-09-20 20:04:22,920 - DataSourceConfigDrive.py[DEBUG]: network config provided via network_json
2016-09-20 20:04:22,923 - util.py[WARNING]: failed stage init-local
2016-09-20 20:04:22,923 - util.py[DEBUG]: failed stage init-local
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 521, in status_wrapper
    ret = functor(name, args)
  File "/usr/local/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 280, in main_init
    init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
  File "/usr/local/lib/python2.7/site-packages/cloudinit/stages.py", line 631, in apply_network_config
    netcfg, src = self._find_networking_config()
  File "/usr/local/lib/python2.7/site-packages/cloudinit/stages.py", line 628, in _find_networking_config
    return (net.generate_fallback_config(), "fallback")
  File "/usr/local/lib/python2.7/site-packages/cloudinit/net/__init__.py", line 133, in generate_fallback_config
    potential_interfaces = set(get_devicelist())
  File "/usr/local/lib/python2.7/site-packages/cloudinit/net/__init__.py", line 99, in get_devicelist
    return os.listdir(SYS_CLASS_NET)
OSError: [Errno 2] No such file or directory: '/sys/class/net/'
failed run of stage init-local
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 521, in status_wrapper
    ret = functor(name, args)
  File "/usr/local/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 280, in main_init
    init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
  File "/usr/local/lib/python2.7/site-packages/cloudinit/stages.py", line 631, in apply_network_config
    netcfg, src = self._find_networking_config()
  File "/usr/local/lib/python2.7/site-packages/cloudinit/stages.py", line 628, in _find_networking_config
    return (net.generate_fallback_config(), "fallback")
  File "/usr/local/lib/python2.7/site-packages/cloudinit/net/__init__.py", line 133, in generate_fallback_config
    potential_interfaces = set(get_devicelist())
  File "/usr/local/lib/python2.7/site-packages/cloudinit/net/__init__.py", line 99, in get_devicelist
    return os.listdir(SYS_CLASS_NET)
OSError: [Errno 2] No such file or directory: '/sys/class/net/'
------------------------------------------------------------
2016-09-20 20:04:22,955 - util.py[DEBUG]: cloud-init mode 'init' took 0.453 seconds (0.45)
2016-09-20 20:04:22,956 - handlers.py[DEBUG]: finish: init-local: SUCCESS: searching for local datasources

I've been trying to update the port of cloud-init on FreeBSD to 0.7.8 but unfortunately it doesn't look like ConfigDrive support is functional when ConfigDrive provides networking information.

Tags: freebsd
Revision history for this message
Bert JW Regeer (bregeer-ctl) wrote :
Download full text (49.4 KiB)

I have removed ConfigDrive and restarted, however even using the OpenStack provider it will fail with networking, AND then fail when setting the SSH key for the freebsd user (default user in cloud.cfg)

/usr/local/bin/cloud-init startingWARN: no logging configured! (tried 0 configs)
Setting up basic logging...
Cloud-init v. 0.7.8 running 'init' at Tue, 20 Sep 2016 20:41:00 +0000. Up 9.48849606514 seconds.
2016-09-20 20:41:00,513 - util.py[DEBUG]: Cloud-init v. 0.7.8 running 'init' at Tue, 20 Sep 2016 20:41:00 +0000. Up 9.48849606514 seconds.
2016-09-20 20:41:00,516 - util.py[DEBUG]: Writing to /var/log/cloud-init.log - ab: [420] 0 bytes
2016-09-20 20:41:00,518 - util.py[DEBUG]: Changing the ownership of /var/log/cloud-init.log to 0:0
2016-09-20 20:41:00,519 - util.py[DEBUG]: Running command ['ifconfig', '-a'] with allowed return codes [0] (shell=False, capture=True)
2016-09-20 20:41:00,527 - util.py[DEBUG]: Running command ['netstat', '-rn'] with allowed return codes [0] (shell=False, capture=True)
2016-09-20 20:41:00,547 - util.py[DEBUG]: Running command ['netstat', '-A', 'inet6', '-n'] with allowed return codes [0] (shell=False, capture=True)
ci-info: ++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++
ci-info: +---------+-------+---------------+------------+-------+-------------------+
ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
ci-info: +---------+-------+---------------+------------+-------+-------------------+
ci-info: | vtnet1: | False | . | . | . | fa:16:3e:9e:b0:af |
ci-info: | vtnet0: | True | 172.17.63.153 | 0xffffff80 | . | fa:16:3e:f3:97:a7 |
ci-info: | lo0: | True | 127.0.0.1 | 0xff000000 | . | . |
ci-info: | lo0: | True | . | . | d | . |
ci-info: +---------+-------+---------------+------------+-------+-------------------+
2016-09-20 20:41:00,558 - main.py[DEBUG]: Checking to see if files that we need already exist from a previous run that would allow us to stop early.
2016-09-20 20:41:00,559 - main.py[DEBUG]: Execution continuing, no previous run detected that would allow us to stop early.
2016-09-20 20:41:00,560 - handlers.py[DEBUG]: start: init-network/check-cache: attempting to read from cache [trust]
2016-09-20 20:41:00,561 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False)
2016-09-20 20:41:00,562 - stages.py[DEBUG]: no cache found
2016-09-20 20:41:00,563 - handlers.py[DEBUG]: finish: init-network/check-cache: SUCCESS: no cache found
2016-09-20 20:41:00,564 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance
2016-09-20 20:41:00,567 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.freebsd.Distro'>
2016-09-20 20:41:00,568 - __init__.py[DEBUG]: Looking for for data source in: ['OpenStack', 'Ec2'], via packages ['', u'cloudinit.sources'] that matches dependencies ['FILESYSTEM', 'NETWORK']
2016-09-20 20:41:00,572 - __init__.py[DEBUG]: Searching for network data source in: [u'DataSourceOpenStack', u'DataSourceEc2']
2016-09-20 20:41:00,573 - handlers.py[DEBUG]: start: init-network/search-OpenStack: searching fo...

summary: - cloud-init 0.7.8 ConfigDrive support broken on FreeBSD
+ cloud-init 0.7.8 support broken on FreeBSD
Revision history for this message
Andres Montalban (amontalban) wrote :

Hi Bert,

I just stumbled with this, I think that the net module needs to be rewritten for better compatibility.

It would be great if we can use other modules like netifaces to list interfaces, macs, ips.

That with a couple of ifconfig commands can solve the issue and do not rely on /sys that's only available in Linux.

I will try to dedicate some hours on this and see if I can get it fixed.

Thanks!

Revision history for this message
Andres Montalban (amontalban) wrote :

Hi Bert,

I have been working on this and have a prototype for the fix and would love to have feedback from other FreeBSD user.

Additionally I'm attaching a patch for cloud-init port as I see you are the maintainer so we can maybe add the needed patches to make FreeBSD work ok.

Please also apply patches in #1645947 and #1645824.

Thanks!

Revision history for this message
Andres Montalban (amontalban) wrote :

FreeBSD port patch

Revision history for this message
Hongjiang Zhang (redriver) wrote :

Hi Andres,
I also encountered the similar issue when I run cloud-init for FreeBSD on Azure. Where can I find your patches?

Revision history for this message
Hongjiang Zhang (redriver) wrote :

Hi Andres,

I have seen your port-patch. Do you mean I have to apply it to /usr/ports/net/cloud-init/Makefile?

I thought the installation of cloud-init is to "git clone https://git.launchpad.net/cloud-init", "python setup.py install", and then "python /usr/local/bin/cloud-init init" after modifying the /usr/local/etc/cloud/cloud.cfg". Is it the correct way?

do3meli (d-info-e)
tags: added: freebsd
Revision history for this message
Scott Moser (smoser) wrote :

Hi,
Is this fixed in 18.1 ?
if so, lets close this bug as fix-released.

Changed in cloud-init:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for cloud-init because there has been no activity for 60 days.]

Changed in cloud-init:
status: Incomplete → Expired
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.