Cloudinit fails to find config drive data due to wrong call on stages.Init(ds_deps=[])
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
Came across this issue while manually setting up an Ubuntu 14.04 devstack image with the following setup:
dpkg-reconfigure cloud-init
[*] ConfigDrive: Reads data from Openstack Config Drive
The issue was that with every instance launch, cloud-init would fail to find the config data mounted on a drive on the instance (in particular /dev/sr0) and was not setting up mainly the ssh keys and the rest of the command customizations.
To test the issue, I ran the following command find the culprit:
root@ubuntu14:
Can not apply stage final, no datasource found! Likely bad things to come!
------
Traceback (most recent call last):
File "/usr/bin/
init.fetch()
File "/usr/lib/
return self._get_
File "/usr/lib/
pkg_list)
File "/usr/lib/
raise DataSourceNotFo
DataSourceNotF
As it stands out, in https:/
init = stages.
the stages.py:61 init however is not properly addressed in this call and thus assigns the empty list with the following line:
if ds_deps is not None:
Thus makes cloudinit ommit mounting and searching device drives for the config data.
As a fix, either files can be changed:
- main.py:346 > init = stages.
- stages.py:61 > if ds_deps is not None and len(ds_deps) > 0: (not sure if this is used init is used otherwise)
Anyways the first one fixed my problem.
Hi,
So i'm confused as to how this solved your problem. cloud/instance/ obj.pkl cache.
The working path for this code that the ConfigDrive datasource should be found during 'cloud-init init --local', and then during the 'final' stage (upstart or systemd service named 'cloud-final') the datasource should be loaded from the /var/lib/
The cloud-final stage is behaving as intended by not searching for a datasource at all.
So 2 comments:
a.) you should always have the 'None' datasource in the search list, as if no others are found, it will get users created and ssh keys generated and apply the local config.
b.) Can you reproduce this failure and post a cloud-init- output. log and cloud-init.log ?
I'd like to see them as this *should* have found the ConfigDrive datasource in the local or network stage.
Please provide that info and then set this back to 'New'.
Thanks!