Age | Commit message (Collapse) | Author |
|
3 things here:
a.) do not raise exception, only warn when trying to apply a network
config for a distro that does not have an implementation.
This is important since debian/ubuntu is the only one *with* an
implementation at the moment
b.) apply network config in 'cloud-init --local' even if there is
no datasource found.
c.) do not write 70-persistent-net.rules
the code was writing both 70-persistent-net.rules and
/etc/systemd/network/50-cloud-init-*.link files
that would just be confusing.
|
|
Instead of sleep and check loop, use 'udevadm settle' to wait.
since we run from a udev event, this is sufficient.
udev settle will exit when either of
a.) the file exists
b.) the udev event queue has all been processed.
c.) timeout is reached.
Since cloud-init-wait is being run as a udev event, 'b' cannot
be satisfied until it finishes. Thus, this essentially becomes a
inotify based wait for the file /run/cloud-init/network-config-ready
and no loops are needed.
|
|
since we run from a udev event, this is sufficient.
udev settle will exit when either of
a.) the file exists
b.) the udev event queue has all been processed.
Since cloud-init-wait is being run as a udev event, 'b' cannot
be satisfied until it finishes. Thus, this essentially becomes a
inotify based wait for the file /run/cloud-init/network-config-ready
and no loops are needed.
|
|
this allows 'cloud-init --local' to fully run before networking comes up.
By doing so, we can now cleanly apply networking to the new system.
This adds support for reading ConfigDrive network configuration
and also from NoCloud. The support is only present for ubuntu/debian
at the current time. Other distros will follow.
Also ability to specify network configuration on kernel command line
via either ip= or network-config=<base64>.
|
|
|
|
a.) do not write systemd link files if we do not have a mac address.
the check is updated to check for value rather than just presense
(ie, 'mac_address': None)
b.) DataSourceNoCloudNet: search in the nocloud seed dir
this is important because NoCloud if dsmode is Net will look only
would pass by, expecting NoCloudNet to pick it up
but NoCloudNet would not look in /var/lib/cloud/seed/nocloud
and thus skip it.
c.) support the disabling of network configuration
via /var/lib/cloud/data/upgraded-network
This is what the package upgrader is writing.
|
|
|
|
This adds support for suppling network configuration on the
kernel command line in 2 ways:
a.) kernel command line includes 'network-config=<base64>'
value of that parameter is base64 encoded json (or yaml)
it is taken as network config yaml.
In order to save space on kernel command line, it can be
base64 encoded gzipped json also.
b.) ip= paired with files authored by klibc's ipconfig tool
When network devices are brought up in the initramfs, klibc's
ipconfig tool writes files are named /run/net-<DEVNAME>.conf.
The best documentation available on that tool is
/usr/share/doc/libklibc/README.ipconfig.gz.
Also changes util.get_cmdline() to return the command line of
pid 1 if it is in a container. That is to make it consistent with
The systemd generator, and allow passing a command line to lxd,
as lxd does not mask /proc/cmdline.
|
|
|
|
This follows behavior of systemd/cloud-init-generator.
This way you can feed a command line into lxc container.
|
|
OpenStack clouds may provide network_data.json information via the
MetadataService in ConfigDrive.
Teach ConfigDrive to read, store and convert the data into network_config
yaml format. Making this available allows cloud-init to read network
config from OpenStack and use the distro.apply_network_config() method to
render the network_config from OpenStack into a distro network
configuration file.
|
|
net: add render_route comment to document why we added || true to route
statements
DataSourceConfigDrive: Only convert network_json to network_config when
caller reads network_config attr. Cache the conversion.
|
|
|
|
Changing this interface to allow for easy change later.
The thing that this will enable is:
a.) maas datasource to look at the system config and see if it
is configured with the same consumer_key
b.) datasource config could allow setting a variable that it
would look at.
|
|
|
|
add tests to show this functional.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Introduced a new path in configdrive, openstack/2015-10-15/, needed
to add bogus data in that path as well to ensure config reader didn't
find good data when testing for exception thrown.
|
|
|
|
|
|
Wesley's loader returned network state, so that got me updating
it, and i implemented as such. Then realized that actually
ipconfig (klibc) has no support for ipv6. So even though
i painfully generalized that, its pointless. next commit will
drop it.
|
|
|
|
|
|
This fixes a bug where modules mode was not passing a 'existing'
flag to fetch. fetch had existing default to 'check'.
The DataSourceNoCloud when fed with data from a disk will return
False to check() as it is not a guarantee'd hit.
That caused fetch to go looking for a new datasource.
That would have actually worked, but modules and single create
the Init with deps=[]. So it went looking for Datasources
that matched those deps, and only found DataSourceNone.
I'm going to keep having modules and single specify deps=[]
as that will prevent them from going to look for a DS and
further making things worse.
|
|
|
|
|
|
|
|
Tested now with the generated fallback config in an lxc container.
Had to change to return a config rather than a network state.
Also this makes nocloud look in nocloud-net's seed dir.
This way it will read the seed and clame the datasource but
not do anything other than apply networking and the init_modules early.
It is a change in behavior of the time that boothooks woudl run to do
this. May need to change that back.
|
|
|
|
there is no data source that has a populated network_config()
so at this point this doesn't do anything.
|
|
|
|
|
|
on interfaces with characters between their numbers
|
|
I plan to re-use these methods later. They stand alone even if they
dont end up getting used, though.
|
|
'version' keys
|
|
- Removed systemd .link file generation, as it is not needed right now
- Changed return of generate_fallback_config to be just ns dict
- In distros.debian don't attempt to write .link file
|
|
|
|
configuration to be run if there is no network configuration provided by the
datasource.
NOTE: the code added here will not behave correctly if a net datasource has
network configuration. this code is temporary and should be reverted once
support for network configuration for net datasources after retrieving
config is in place.
based on: http://paste.ubuntu.com/15443576/
With this in place cloud-init properly chooses a fallback interface, configures
it and brings it online
|
|
not to attempt renaming the network interface to the default interface. Default
interface is controleld by net.DEFAULT_PRIMARY_INTERFACE and is currently set
to eth0 for legacy reasons. By default cloud-init will not attempt to rename
the device as this does not work in some situtations depending on the backing
driver of the device.
|
|
|
|
|
|
try/except blocks because there are sometimes read errors on the files and this
should not cause a stacktrace
|
|
|
|
|
|
|