summaryrefslogtreecommitdiff
path: root/cloudinit/DataSourceEc2.py
AgeCommit message (Collapse)Author
2012-06-071. Adding some new helper files that split off file inclusion, templating, ↵Joshua Harlow
importing, constant usage. 1. Move all datasources to a new sources directory 1. Rename some files to be more consistent with python file/module naming.
2012-03-07fix pylint and pep8 warningsScott Moser
2012-03-06move wait_for_metadata_service for util, rename to wait_for_urlScott Moser
Also, add in the headers_cb which will be required for oauth.
2012-01-18Add HP to Copyright, and Juerg Haefliger Authors.Scott Moser
This copyright change reflects previous changes that Juerg made for pylint and pep8 cleanups. From: Juerg Haefliger <juerg.haefliger@hp.com> Date: Mon, 16 Jan 2012 10:45:12 +0100
2012-01-17[PATCH] PEP8 coding style fixes.Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com> This pulls in the named patch for LP: #914739 with a few other changes.
2012-01-17[PATCH 4/4] Fix pylint conventions C0301 (line too long)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 3/4] Fix pylint conventions C0324 (comma not followed by a space)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 2/4] Fix pylint conventions C0322 (operator not preceded by a space)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 1/4] Fix pylint conventions C0321 (more than one statement on a ↵Scott Moser
single line) From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-12[PATCH 06/13] Fix pylint warnings W0612 (unused variable)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-12[PATCH 04/13] Fix pylint warnings W0611 (unused import)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2011-12-19make DataSourceEc2 more resilliant to slow metadata service (LP: #894279)Scott Moser
This increases the timeout for a metadata request to something that should be easily satisfiable (50 seconds). But hopefully does so while still keeping the case of no-metadata service in mind. Previously, there was a small timeout and many retries (30) would be done. Now, - larger timeout (50 seconds) by default - retry until a given "max_wait" is reached (120 seconds default) The end result is that if we're hitting the timeout, there will only end up being a couple attempts made. But if the requests are coming back quickly then we'll still make several attempts. There is one EC2DataSource config change, now 'retries' is not used, but rather 'max_wait' to indicate generally how long it should try to find a metadata service.
2011-12-18cloudinit/DataSourceEc2: use util.is_resolvable_urlScott Moser
2011-12-16initial mirror configuration/discoveryScott Moser
2011-10-06DataSourceEc2: catch a socket timeout in wait-for-md-service codeScott Moser
In addition to catching a url timeout, we also need to catch and retry on a socket timeout. Apparently urllib2 doesn't catch this and brand it as a urlerror. LP: #869492
2011-09-22remove local copy of boto.utilsScott Moser
LP: #855965
2011-07-19special case handling of mapping for ephemeral0Scott Moser
t1.micro do not have a ephemeral0 disk, but the metadata service will have an entry there. i386 t1.micro: 'block-device-mapping': {'ami': '/dev/sda1', 'ephemeral0': '/dev/sda2', 'root': '/dev/sda1'}, amd64 t1.micro: 'block-device-mapping': {'ami': '/dev/sda1', 'ephemeral0': '/dev/sdb', 'root': '/dev/sda1'}, LP: #744019
2011-06-17fix broken ec2 metadata service (incorrect variable name)Scott Moser
2011-06-01support configurable urls for metadata serviceScott Moser
Now, if a Eucalyptus install is in STATIC or SYSTEM mode, the metadata service can still be used. In order to do that, the user must configure their DNS so that 'instance-data' will resolve to the cloud controller. Thanks to Kieran Evans. LP: #761847
2011-06-01revert some white space changes versus trunkScott Moser
just to avoid unnecessary changes (and confusion in 'annotate')
2011-05-28changed config key namekeyz182
2011-05-28log.warn to log.warningkeyz182
removed extra args from string format
2011-05-28Removed unnecessary newlinekeyz182
2011-05-28Added support for loading metadata urls from config files.keyz182
2011-05-26Another silly typo.keyz182
2011-05-26Remove any unresolveable addresses before attempting to access metadata.keyz182
2011-05-25Fixed silly mistake self.metadata_address instead of metadata_address. D'oh.keyz182
2011-05-25Fix for default metadata_address valuekeyz182
2011-05-25Modified to reflect changes suggested by Scott Moserkeyz182
2011-05-24Modified cloudinit/DataSourceEc2.py and cloudinit/boto_utils.py to check ↵keyz182
both http://169.254.169.254 and http://instance-data:8773 for meta data service. LP: #761847
2011-05-24Modified cloudinit/DataSourceEc2.py and cloudinit/boto_utils.py to check ↵keyz182
both http://169.254.169.254 and http://instance-data:8773 for meta data service. LP: #761847
2011-02-07make DataSourceEc2 configurable (timeout, retries), lower default retriesScott Moser
This lowers the default retries from 100 to 30 (1050 seconds to 105 seconds)
2011-02-04fix logging in DataSource modulesScott Moser
Previous logging was getting 'None' set in the DataSource collections. Thus, 'log.debug' would throw error. I think it is proper to pull in the base cloudinit's log.
2011-01-31replace DataSource's self.logScott Moser
After adding the 'log' element to the DataSource class, pickling would fail with TypeError: can't pickle file objects Instead of having the object with a log reference, use one from 'DataSource.log' and have that set by cloudinit
2011-01-26rework of DataSource loading.Scott Moser
The DataSources that are loaded are now controlled entirely via configuration file of 'datasource_list', like: datasource_list: [ "NoCloud", "OVF", "Ec2" ] Each item in that list is a "DataSourceCollection". for each item in the list, cloudinit will attempt to load: cloudinit.DataSource<item> and, failing that, DataSource<item> The module is required to have a method named 'get_datasource_list' in it that takes a single list of "dependencies" and returns a list of python classes inside the collection that can run needing only those dependencies. The dependencies are defines in DataSource.py. Currently: DEP_FILESYSTEM = "FILESYSTEM" DEP_NETWORK = "NETWORK" When 'get_datasource_list' is called for the DataSourceOVF module with [DEP_FILESYSTEM], then DataSourceOVF returns a single item list with a reference to the 'DataSourceOVF' class. When 'get_datasource_list' is called for the DataSourceOVF module with [DEP_FILESYSTEM, DEP_NETWORK], it will return a single item list with a reference to 'DataSourceOVFNet'. cloudinit will then instanciate the class and call its 'get_data' method. if the get_data method returns 'True', then it selects this class as the selected Datasource.
2011-01-26change 'except' syntax to python 3 style.Scott Moser
Everywhere that there occurred: except Exception, e: changed to except Exception as e:
2011-01-25use timestamp.gmtime() for timestamps rather than time() or datetimeScott Moser
2011-01-19convert 'cachedir' to 'seeddir', move cloud_config, scripts to instanceScott Moser
- cloud_config and scripts now live in instance directory - cachedir is now more correctly named 'seeddir'
2011-01-18remove 'get_locale' from DataSourceEc2.Scott Moser
Previously the 'get_locale()' method of DataSourceEc2 would select a default locale based on the availability zone that the instance was running on. I generally don't like that as a.) there are loads of other locales than en_US and en_GB (that were being used) b.) either one is almost certainly not really the users preferred locale. Just because I launch an instance in eu-west-1 doesn't mean I perfer en_GB.
2010-09-16If instance is in EC2 VPC, then do not use ec2 ubuntu archive (LP: #615545)Scott Moser
VPC instances cannot reach other hosts in EC2 (such as the archives). In this case, use the default mirror instead. LP: #615545
2010-09-10improve warning message in DataSourceEc2Scott Moser
2010-09-09device_name_to_device: return the md's device string even if no deviceScott Moser
The logic behind returning a device even if it is not present is that it *could* be present later, or after a stop and restart. Additionally this gives the caller more information to differenciate itself between "device did not exist" and "device was not present in metadata service".
2010-08-12use read_optional_seed, change 'parse_cmdline_data' to return booleanScott Moser
using read_optional_seed in DataSourceEc2 and DataSourceNoCloud. change parse_cmdline_data to fill a dictionary that is supplied by caller. It then returns strictly true or false based on whether or not it was specified in cmdline
2010-08-12initial dump of "sans-cloud" code (DataSourceNoCloud)Scott Moser
The new classes 'DataSourceNoCloud' and 'DataSourceNoCloudNet' implement a way to get data from the filesystem, or (very minimal) data from the kernel command line. This allows the user to seed data to these sources. There are now 2 "cloud-init" jobs, cloud-init-local that runs on mounted MOUNTPOINT=/ and 'cloud-init' that runs on start on (mounted MOUNTPOINT=/ and net-device-up IFACE=eth0 and stopped cloud-init-local ) The idea is that cloud-init-local can actually function without network. The last thing in this commit is "uncloud-init". This tool can be invoked as 'init=/usr/lib/cloud-init/uncloud-init' It will "uncloudify" things in the image, generally making it easier to use for a simpler environment, and then it will exec /sbin/init.
2010-08-09DataSourceEc2.py: remap dev names when metadata service disagress with kernelScott Moser
device names presented in the metadata service may not be what the kernel has named them. This can be for more than 1 reason. But some examples: - device is virtio, metadata named 'sd' - device is xvdX, metadata named sd Those are the two situations that are covered here. More complex, but not covered are possibly: - metadata service named device 'sda1', but it should actually be 'vdb1' LP: #611137
2010-07-01fix invalid log string when reading from preseeded ec2 cacheScott Moser
2010-06-18change debug messages in DataSourceEc2Scott Moser
2010-06-18add 'cloud-boothook' typeScott Moser
if user data is of type text/cloud-boothook, or begins with #cloud-boothook, then assume it to be code to be executed. Boothooks are a very simple format. Basically, its a one line header ('#cloud-config\n') and then executable payload. The executable payload is written to a file, then that file is executed at the time it is read. The file is left in /var/lib/cloud/data/boothooks There is no "first-time-only" protection. If running only once is desired, the boothook must handle that itself.
2010-06-17add initial logging supportScott Moser
This logging infrastructure in cloudinit: - uses python logging - allows user supplied config of logging.config.fileConfig format to be supplied in /etc/cloud/cloud.cfg or in cloud_config by user data. - by default, tries to use syslog, if that is not available, writes directly to /var/log/cloud-init.log (syslog will not be available yet when cloud-init runs) - when using syslog, the doc/21-cloudinit.conf file provides a rsyslogd file to be placed in /etc/rsyslog.d/ that will file [CLOUDINIT] messages to /var/log/cloud-init.log
2010-06-15add vi modelines to python filesScott Moser