prometheanfire / gentoo-cloud-prep

Preparation for gentoo instances on an OpenStack cloud, including stage4 prep
13 stars 6 forks source link

failure to run dmidecode that isn't installed #6

Closed prometheanfire closed 9 years ago

prometheanfire commented 9 years ago

just add the package to the list

rafaelmartins commented 9 years ago
Jul  2 18:06:38 localhost __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.sources.DataSourceAltCloud.DataSourceAltCloud'>
Jul  2 18:06:38 localhost DataSourceAltCloud.py[DEBUG]: Invoked get_data()
Jul  2 18:06:38 localhost util.py[DEBUG]: Running command ['/usr/sbin/dmidecode', '--string', 'system-product-name'] with allowed return codes [0] (shell=False, capture=True)
Jul  2 18:06:38 localhost DataSourceAltCloud.py[DEBUG]: Failed command: /usr/sbin/dmidecode --string system-product-name
Unexpected error while running command.
Command: ['/usr/sbin/dmidecode', '--string', 'system-product-name']
Exit code: -
Reason: [Errno 2] No such file or directory
Stdout: ''
Stderr: ''
Jul  2 18:06:38 localhost DataSourceAltCloud.py[DEBUG]: cloud_type: UNKNOWN
Jul  2 18:06:38 localhost __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.sources.DataSourceOVF.DataSourceOVFNet'>

The error seems to be cloud-init failing to recognize that it is running in openstack. if I understood correctly, these data sources are last resources

rafaelmartins commented 9 years ago

err... no. it recognizes openstack a few lines below in the log

Jul  2 18:06:39 localhost __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.sources.DataSourceOpenStack.DataSourceOpenStack'>
Jul  2 18:06:39 localhost url_helper.py[DEBUG]: [0/1] open 'http://169.254.169.254/openstack' with {'url': 'http://169.254.169.254/openstack', 'headers': {'User-Agent': 'Cloud-Init/0.7.6'}, 'allow_redirects': True, 'method': 'GET', 'timeout': 10.0} configuration
Jul  2 18:06:41 localhost url_helper.py[DEBUG]: Read from http://169.254.169.254/openstack (200, 39b) after 1 attempts

seems to be a cloud-init bug in the ordering of data sources. don't know if it is worth installing dmidecode just to get rid of that error.

hartwork commented 9 years ago

The Debian OpenStack images put a custom data source list in. It's easy to do.

travisghansen commented 9 years ago

@rafaelmartins if you are running in openstack then yes it appears something is messed up with the openstack metadata service and likely not the image/cloud-init themselves.

As @hartwork mentioned you can create a custom list (example here: https://wiki.archlinux.org/index.php/Cloud-init#Configuring_data_sources)

For testing my images (https://github.com/travisghansen/gentoo-cloud-image-builder) I build/use a cloud config drive and simply run the image locally via kvm with the drive attached as a cdrom. It makes for a nice clean environment to test without trying to upload to glance, launch a new instance, etc, etc which can be time consuming. I also make sure to use the -snapshot feature of qemu to prevent tampering with the newly made image.