Age | Commit message (Collapse) | Author |
|
previously, cloud-init would exit failure if no data sources were
found. In the case of cloud-init-local, that was often the case.
In the case of cloud-init (net) it is a bit more likely that the user
would consider it failure if nothing was found. Potentially this could
even be user-configurable.
|
|
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
|
|
From: Juerg Haefliger <juerg.haefliger@hp.com>
This pulls in the named patch for LP: #914739 with a few other changes.
|
|
From: Juerg Haefliger <juerg.haefliger@hp.com>
|
|
From: Juerg Haefliger <juerg.haefliger@hp.com>
|
|
single line)
From: Juerg Haefliger <juerg.haefliger@hp.com>
|
|
From: Juerg Haefliger <juerg.haefliger@hp.com>
|
|
the cloud-init programs are never intended to run interactively.
Some programs were being run via subprocess, and would notice that their
input was attached to a terminal (/dev/console). As a result, they
they would try to prompt the user for input (apt-add-repository)
This change simply re-opens standard input as /dev/null so any
subprocesses will not end up blocking on input.
|
|
When 'cloud-init start' (network) runs, it will print information
about the systems network info to the console. This will help in debugging
instances.
LP: #828186
|
|
consume_userdata should really run always, rather than once per instance.
The documentation says that boothooks were on their own for per-instance
but since this routine was only being called once, they would only get
called once.
This modifies the behavior to be:
user_script: per_always
cloud_config : per_always
upstart_job : per_instance
cloud_boothook: per_always
In order to not break part handlers that are existing, and expect to only be
called once per instance, this adds a 'handler_version' item in a handler
that can indicate the version (currently 1 or 2). If it is 2, then the
hander will be passed the frequency (per-instance or per-always) that this
is being run. That way the handler can differenciate between them.
This also makes 'bootcmd' run every boot. That should be changable in
cloud-config though, so users who dont like the behavior can modify it.
LP: #819507
|
|
Previously, when cloud-config was ready, cloud-init would emit an
upstart event with:
initctl emit cloud-config
Now, that command is configurable via the 'cc_ready_cmd' value in
cloud.cfg or user data. The default behavior is not changed.
LP: #785551
|
|
|
|
LP: #714807
|
|
This option allows user to specify manual cleaning of the
/var/lib/cloud/instance/ link, for a data source that might not be present on
every boot.
|
|
|
|
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.
|
|
Everywhere that there occurred:
except Exception, e:
changed to
except Exception as e:
|
|
|
|
|
|
|
|
add 'hostname' cloud-config option for setting hostname
make rsyslog and resizefs run at cloud-init time
|
|
This change just uses a different facility for coming up with the path.
But, by design I'm chosing to put 'previous-hostname' in
/var/lib/cloud/data/
rather than in
/var/lib/cloud/instance/data/
The idea is that if the user:
- started an instance
- modified /etc/hostname
- bundled instance (or create-image from it)
- started new instance
They would expect their modified /etc/hostname to persist. As such, the
previous-hostname file should be cross-instance data.
Bugs in this area include LP: #596993 and LP: #514492
|
|
|
|
|
|
LP: #704509
|
|
Now, instead of setting a default value in cloud-init based only on the
DataSource, this supports using 'locale' in the cloud-config.
|
|
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.
|
|
On EBS instances, a shutdown and later start would end up with a
different IP address.
In the case where the user has not modified /etc/hostname from its
original value (seeded by metadata's 'local-hostname'), then cloud-init
will again set the hostname and update /etc/hostname.
In the case where the user *has* modified /etc/hostname, it will remain
user managed.
Additionally, if /etc/cloud/cloud.cfg contains 'preserve_hostname' value
set to a True value, then /etc/hostname will not ever be touched.
LP: #596993
|
|
|
|
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
|
|
|
|
Also
- adds some debugging information when its waiting
- add 'uptime' printout on initial cloud-init invocation
|
|
The cache file location is not instance specific. As such, if it is
not cleaned from the image, a re-bundle would get the old data. To avoid
that, clear the cache in cloud-init.
|
|
|
|
LP: #514492
|
|
|
|
|