Age | Commit message (Collapse) | Author |
|
This just looks in one other maas related path for a config file.
The file '91_kernel_cmdline_url' is written by cloud-init when it
gets a cloud-config-url parameter.
Also now we read the config even if a url is specified to potentially
fill in credentials.
|
|
On DigitalOcean, Network information is provided via Meta-data.
It changes the datasource to be a local datasource, meaning it
will run before fallback networking is configured.
The advantage of that is that before networking is configured it
can bring up a network device with ipv4 link-local and hit the
metadata service that lives at 169.254.169.254 to find its networking
configuration. It then takes down the link local address and lets
cloud-init configure networking.
The configuring of a network device to go looking for a metadata
service is gated by a check of data in the smbios. This guarantees
that the code will not run on another system.
|
|
The end result of all of these changes is to get mounts managed by
cloud-init to occur only after cloud-init.service is done. We need to do
that so that filesystems that are set up by cloud-init (in disk_setup)
do not get mounted by stale entries in /etc/fstab before
the setup occurs.
This can occur in 2 ways:
a.) new instance with old /etc/fstab
b.) same instance where disk needs adjusting (Azure resize will re-format
the ephemeral disk).
The list of changes here is:
- move mounts and disk_setup module to cloud-init.service rather
than config. cloud-init.service runs earlier in boot so it
can get those mount points done earlier.
- on systemd add 'x-systemd.requires=cloud-init.service' to fstab options
- cloud-init-local.service: add Before=basic.target
- cloud-init.service:
- extend After, Before, and Wants to multiple lines rather than one
long line.
- sort consistently with cloud-init-local.service
- add DefaultDependencies=no
- add Before=default.target
- add Conflicts=shutdown.target
LP: #1611074
|
|
Treat null type as yet another physical type, seen in real-world
openstack cloud.
Also, support the case where network_data.json provides mac addresses
in upper case. Rackspace public cloud currently does that.
LP: #1621968
|
|
When user-data was provided in the ovf environment python3 would call
base64.decodestring() with a string rather than bytes and an exception
would occur.
This fixes the broken path and adds unit test. Also changes to
return None rather than empty string when there is no user-data and
when there is user-data return that as bytes instead of string.
LP: #1619394
|
|
Adds an install option for for OpenRC init scripts.
I've also restricted installing tests more correctly.
Also, don't hardcode the path to ip (/bin/ip on gentoo).
|
|
The OpenStack network_data.json does not provide a name for bond links.
This change makes it so a dummy one is generated and used instead
to satisfy cloud-init which does require one.
In order to write the correct link (underlying 'link' names)
for the bonds, we maintain a list of info by ids so we can easily
get the right device name.
Also:
* add a vlan test case that similarly references an id rather than name.
* make bond interfaces auto
LP: #1605749
|
|
This adds some function to the generator to maintain the presense of a
flag file '/run/cloud-init/enabled' indicating that cloud-init is enabled.
Then, only run the dhclient hooks if on Azure and cloud-init is enabled.
The test for is_azure currently only checks to see that the board vendor
is Microsoft, not actually that we are on azure. Running should not be
harmful anywhere, other than slowing down dhclient.
The value of this additional code is that then dhclient having run
does not task the system with the load of cloud-init.
Additionally, some changes to config are done here.
* rename 'dhclient_leases' to 'dhclient_lease_file'
* move that to the datasource config (datasource/Azure/dhclient_lease_file)
Also, it removes the config in config/cloud.cfg that set agent_command
to __builtin__. This means that by default cloud-init still needs
the agent installed. The suggested follow-on improvement is to
use __builtin__ if there is no walinux-agent installed.
|
|
It is more efficient and cross-distribution safe to use the hooks function
from dhclient to obtain the Azure endpoint server (DHCP option 245).
This is done by providing shell scritps that are called by the hooks
infrastructure of both dhclient and NetworkManager. The hooks then
invoke 'cloud-init dhclient-hook' that maintains json data
with the dhclient options in
/run/cloud-init/dhclient.hooks/<interface>.json .
The azure helper then pulls the value from
/run/cloud-init/dhclient.hooks/<interface>.json file(s). If that file does
not exist or the value is not present, it will then fall back to the
original method of scraping the dhcp client lease file.
|
|
Per [1], DigitalOcean provides the metadata in multiple formats. The JSON
document is the preferred endpoint.
Changes:
- Switch to the v1.json meta-data endpoint
- Identify droplet identity from SMBIOS
- Only poll for metadata when the instance is confirmed to be a droplet
- Removal of hard-coded mirrors
Additionally, centralize the gates on running 'dmidecode' on arm arches,
and update tests to address.
[1] https://developers.digitalocean.com/documentation/metadata/
|
|
Add vendor-data support to maas which will behave like the openstack
vendor-data does. Data returned from maas must be yaml loadable.
Also update the main in DataSourceMAAS to "just work" on a maas
deployed system.
LP: #1612313
|
|
This just adds 'tap' to the list of types that are understood to
be physical or virtual network devices. Openstack basically exposes
the type of the host device through.
LP: #1610784
|
|
This fixes an issue with the NoCloud datasource where it would not
recognize the 'network-interfaces' key provided in meta-data.
LP: 1577982
|
|
This improves smart os network configuration
- fix the SocketClient which was previously completely broken.
- adds support for configuring dns servers and dns search (based off the
sdc:dns_domain).
- support 'sdc:gateways' information from the datasource for configuring
default routes.
- add converted network information to output when module is run as a main
This does not support 'sdc:routes' as described at
http://eng.joyent.com/mdata/datadict.html
|
|
Only use strings in headers, as newer requests
actually do stricter validation of this, so ensure
that we comply by only having string objects in
header dicts.
|
|
|
|
Previous commit disabled the consumption of 'injected' files in
configdrive (openstack server boot --file=/target/file=local-file)
unless the datasource was in 'pass' mode. The default mode is 'net'
so that would never happen.
Also here are:
a.) a fix for 'links_path_prefix' string from debian, to finally
disable the rendering of systemd.link files (LP: #1594546)
b.) some comments to apply_network_config
c.) implement a backwards compatibility for for distros that do
not yet implement apply_network_config by converting the network
config into ENI format and calling apply_network.
This is required because prior to the previous commit, those distros
would have had 'apply_network' called with the openstack provided
ENI file. But after this change they will have apply_network_config
called by cloudinit's main.
d.) a network_state_to_eni helper for converting net config to eni
it supports the not-actually-correct 'hwaddress' field in ENI.
LP: #1602373
|
|
|
|
|
|
|
|
On upgrade and reboot, if datasource restored from obj.pkl did not have
a dsmode attribute, then 'init --local' would fail due to stack trace.
LP: #1596690
|
|
On reboot (loading module from obj.pkl) we would hit a AttributeError
when trying to access cmdline_id.
Addtionally, dsmode was inadvertantly defaulting to local for
DataSourceNoCloud.
LP: #1592505
|
|
this would cause the datasource to operate in local mode by default.
|
|
python3's OSError does not have a .message attribute.
|
|
|
|
pylint --errors-only found several errors. Some of the changes
here represent real errors, others just code that pylint did
not like.
|
|
|
|
|
|
LP: #1592505
|
|
This commit includes the content of that commit, plus a fix for the tests
(provided by Phil).
|
|
This change broke tox tests.
|
|
A bug was reported (lp:1581200) where if there is no DNS server configured
or it is not running then the metadata lookup on GCE will fail as it contains a
trailing dot 'metadata.google.internal.'. As there is no DNS configured or
running it will use the /etc/hosts file but the hosts file does not contain
an entry with the trailing dot.
One solution is to add an entry to the /etc/hosts file with the trailing dot
but according to the manpage, /etc/hosts entries must end with an alphanumeric
character and cannot end with a dot.
The trailing dot was added to avoid MIM by dns search but we should probably
assume the instance being started has no DNS and as such when querying
metadata should use a URL that will resolve using /etc/hosts.
LP: #1581200
|
|
|
|
|
|
the network json in openstack provides a type of 'bridge' when
the underlying (host) type is a bridge. Silly, but we need to
consider that a physical device as it will be for us.
also, the 'mtu' will appear on the link, not on the route
|
|
'id' on a link in the openstack spec should be "Generic, generated ID".
current implementation was to use the host's name for the host
side nic. Which provided names like 'tap-adfasdffd'.
We do not want to name devices like that as its quite unexpected
and non user friendly. So here we use the system name for any
nic that is present, but then require that the nics found also
be present at the time of rendering.
The end result is that if the system boots with net.ifnames=0
then it will get 'eth0' like names. and if it boots without net.ifnames
then it will get enp0s1 like names.
|
|
When the .pkl file is loaded, the module that it is loaded
from must have the same symbol. Ie, if booted once and got
DataSourceConfigDriveNet
then upgraded and rebooted, then next boot would show
Can't get attribute 'DataSourceConfigDriveNet'
|
|
|
|
if get_smartos_environ() returned a None, then
the datasoure would raise a ValueError when get_data was called.
Fix that.
|
|
The network config file is /etc/network/interfaces formated.
We will decode that here so that the user can expect that it is
a string. The issue was that it was bytes but convert_eni_data
was expecting a string.
|
|
This adds support for reading networking information from the
SmartOS metadata service and applying.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|