cloud-init fails to find CloudSigma datasource with cloud-init 0.7.8-1-g3705bb5-0ubuntu1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
High
|
Scott Moser | ||
Xenial |
Fix Released
|
High
|
Unassigned | ||
Yakkety |
Fix Released
|
High
|
Unassigned |
Bug Description
[SRU justification]
Without this fix, images built with cloud-init 0.7.8-1-
[Impact]
Some cloud images built with this version of cloud-init may become unusable
[Fix]
Reinstate the second element of the datasources list as a tuple instead of a string.
[Test Case]
This test must be done on CloudSigma to complete correctly :
Build cloud image with only the CloudSigma datasource using cloud-init version 0.7.8-1-
Launch an instance with this image
The instance will boot but will not be accessible through ssh
With this fix,the instance will complete its boot sequence and be accessible through ssh
[Regression]
None expected, the second element was a tuple in previous versions of the CloudSigma datasource
[Description of the problem]
The issue materialized itself on cloud instances launched with such images that became unreachable through SSH with the following message:
"Connection closed by {IP} port 22"
Related branches
- Louis Bouchard (community): Approve
- cloud-init Commiters: Pending requested
-
Diff: 43 lines (+16/-1)2 files modifiedcloudinit/sources/DataSourceCloudSigma.py (+1/-1)
tests/unittests/test_datasource/test_cloudsigma.py (+15/-0)
tags: |
added: verification-done-xenial verification-needed-yakkety removed: verification-needed |
tags: |
added: verification-done-yakkety removed: verification-needed-yakkety |
tags: | removed: verification-needed |
Here is what I have found :
This seems suspect to me :
Nov 21 10:12:33 ubuntu [CLOUDINIT] __init__.py[DEBUG]: Looking for for data source in: ['CloudSigma'], via packages ['', 'cloudinit. sources' ] that matches dependencies ['FILESYSTEM']
Nov 21 10:12:33 ubuntu [CLOUDINIT] __init__.py[DEBUG]: Searching for local data source in: []
There is no local data source returned and this is what will later trigger the python backtrace.
The message "Looking for for data source in" comes from list_sources().
list_sources( cfg_list, depends, pkg_list)
cfg_list = ['CloudSigma']
depends = ['FILESYSTEM']
Down in list_source we have : import_ module( m_loc) _list")
break
for m_loc in m_locs:
mod = importer.
lister = getattr(mod, "get_datasource
matches = lister(depends)
if matches:
return src_list
lister is defined as get_datasource_ list(depends) that does list_from_ depends( depends, datasources)
return sources.
list_from_depends() does : depends( depends, ds_list): list.append( cls)
def list_from_
ret_list = []
depset = set(depends)
for (cls, deps) in ds_list:
if depset == set(deps):
ret_
return ret_list
ds_list being datasources which is : CloudSigma, (sources. DEP_FILESYSTEM) ), DEP_FILESYSTEM == 'FILESYSTEM'
datasources = [
(DataSource
]
and sources.
depset will be :
depset = {'FILESYSTEM'}
deps being sources. DEP_FILESYSTEM, so = 'FILESYSTEM'
set(deps) = {'I', 'Y', 'M', 'T', 'L', 'S', 'F', 'E'} !!!
so if depset == set(deps): is false, hence returns nothing.
Now I don't yet know what changed that makes that test fail