← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1618094] [NEW] Cloudinit fails to find config drive data due to wrong call on stages.Init(ds_deps=[])

 

Public bug reported:

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:/home/test# cloud-init modules --mode=final
	Can not apply stage final, no datasource found! Likely bad things to come!
	------------------------------------------------------------
	Traceback (most recent call last):
	  File "/usr/bin/cloud-init", line 318, in main_modules
		init.fetch()
	  File "/usr/lib/python2.7/dist-packages/cloudinit/stages.py", line 308, in fetch
		return self._get_data_source()
	  File "/usr/lib/python2.7/dist-packages/cloudinit/stages.py", line 236, in _get_data_source
		pkg_list)
	  File "/usr/lib/python2.7/dist-packages/cloudinit/sources/__init__.py", line 263, in find_source
		raise DataSourceNotFoundException(msg)
	DataSourceNotFoundException: Did not find any data source, searched classes: ()

As it stands out, in https://git.launchpad.net/cloud-
init/tree/cloudinit/cmd/main.py:346 the stage Init is not properly done:

    init = stages.Init(ds_deps=[], reporter=args.reporter)

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: 
        self.ds_deps = ds_deps # which is an empty list in this case

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.Init(ds_deps=None, reporter=args.reporter)
    - 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.

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1618094

Title:
  Cloudinit fails to find config drive data due to wrong call on
  stages.Init(ds_deps=[])

Status in cloud-init:
  New

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:/home/test# cloud-init modules --mode=final
  	Can not apply stage final, no datasource found! Likely bad things to come!
  	------------------------------------------------------------
  	Traceback (most recent call last):
  	  File "/usr/bin/cloud-init", line 318, in main_modules
  		init.fetch()
  	  File "/usr/lib/python2.7/dist-packages/cloudinit/stages.py", line 308, in fetch
  		return self._get_data_source()
  	  File "/usr/lib/python2.7/dist-packages/cloudinit/stages.py", line 236, in _get_data_source
  		pkg_list)
  	  File "/usr/lib/python2.7/dist-packages/cloudinit/sources/__init__.py", line 263, in find_source
  		raise DataSourceNotFoundException(msg)
  	DataSourceNotFoundException: Did not find any data source, searched classes: ()

  As it stands out, in https://git.launchpad.net/cloud-
  init/tree/cloudinit/cmd/main.py:346 the stage Init is not properly
  done:

      init = stages.Init(ds_deps=[], reporter=args.reporter)

  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: 
          self.ds_deps = ds_deps # which is an empty list in this case

  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.Init(ds_deps=None, reporter=args.reporter)
      - 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.

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


Follow ups