summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-03-23one more toxScott Moser
2016-03-23fix tox issuesScott Moser
2016-03-23add unit testScott Moser
2016-03-23add the implementation for read_kernel_cmdline_configScott Moser
2016-03-23add sys_netdev_info helper, support reading macs in.Scott Moser
2016-03-23add config_from_klibc_net_cfg and helper functionsScott Moser
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.
2016-03-23merge from trunk.net1Scott Moser
2016-03-23trust existing datasource in modules or singleScott Moser
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.
2016-03-22better log message about applying networking.Scott Moser
2016-03-22write to 50-cloud-init.cfg and write systemd.link rules.Scott Moser
2016-03-22fix quick_read_instance_id in nocloud for seed_dirs changeScott Moser
2016-03-22make NoCloud work for seeding network.Scott Moser
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.
2016-03-22add implementation of generate_fallback_config from wesley.Scott Moser
2016-03-22add code to invoke networking configScott Moser
there is no data source that has a populated network_config() so at this point this doesn't do anything.
2016-03-22drop changes other than generate_fallback_configScott Moser
2016-03-22merge from trunk.net1Scott Moser
2016-03-22In generate_fallback_config() fix function to sort potential interfaces to workWesley Wiedenmeier
on interfaces with characters between their numbers
2016-03-22move some of the pickle loading out of Init, into private methodsScott Moser
I plan to re-use these methods later. They stand alone even if they dont end up getting used, though.
2016-03-22In generate_fallback_config return full netconfig dict with 'config' andWesley Wiedenmeier
'version' keys
2016-03-22 - Rename find_fallback_network_device to generate_fallback_configWesley Wiedenmeier
- 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
2016-03-22Got rid of blank lines in net.find_fallback_network_deviceWesley Wiedenmeier
2016-03-22Basic code added to kick off network configuration and cause fallback networkWesley Wiedenmeier
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
2016-03-22For find_fallback_network_device, kwarg rename_to_default specifies whether orWesley Wiedenmeier
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.
2016-03-22Typo fixWesley Wiedenmeier
2016-03-22Fix typoWesley Wiedenmeier
2016-03-22Wrap read calls to /sys/class/net/DEV/{carrier, dormant, operstate} inWesley Wiedenmeier
try/except blocks because there are sometimes read errors on the files and this should not cause a stacktrace
2016-03-21Merge from trunkWesley Wiedenmeier
2016-03-21Fix typo in disable_conf_file and mistake in callWesley Wiedenmeier
2016-03-21merge from trunkScott Moser
2016-03-21quickly check to see if the previous instance id is still validScott Moser
This adds a check in cloud-init to see if the existing (cached) datasource is still valid. It relies on support from the Datasource to implement 'check_instance_id'. That method should quickly determine (if possible) if the instance id found in the datasource is still valid. This means that we can still notice new instance ids without depending on a network datasource on every boot. I've also implemented check_instance_id for the superclass and for sources: DataSourceAzure (check dmi data) DataSourceConfigDrive (check dmi data) DataSourceNocloud (check the seeded data or kernel command line) DataSourceOpenstack (check dmi data) LP: #1553815
2016-03-21add check_instance_id to ConfigDriveScott Moser
2016-03-21Added _write_network_fallback function to distros.debian and abstract toWesley Wiedenmeier
distros base, and apply_fallback_network to distros to call _write_network_fallback. Note that since _write_network_fallback is only implemented for debian and ubuntu a check is needed to ensure that it does not break behaviour for other distros. Added function to disable .cfg files to util, since it may be useful elsewhere
2016-03-21quickly check to see if the previous instance id is still validScott Moser
This adds a check in cloud-init to see if the existing (cached) datasource is still valid. It relies on support from the Datasource to implement 'check_instance_id'. That method should quickly determine (if possible) if the instance id found in the datasource is still valid. This means that we can still notice new instance ids without depending on a network datasource on every boot. I've also implemented check_instance_id for the superclass and for 3 classes: DataSourceAzure (check dmi data) DataSourceOpenstack (check dmi data) DataSourceNocloud (check the seeded data or kernel command line) LP: #1553815
2016-03-21Added net.find_fallback_network_device() to find an appropriate device to dhcpWesley Wiedenmeier
on in the event that no network configuration was provided to cloud-init - Devices in /sys/class/net aside from loopback devices are scanned - Each device is tested to determine if it has a carrier using /sys/class/net/DEV/carrier, devices which do are preferred as they are most likely connected to the outside world - Devices which do not have a carrier but which might still be connected due to being in a dormant or down state are used as fallbacks in case no devices are found which have a carrier - A network state dictionary is generated to be passed to render_network_state to write ENI - A systemd link file is generated that will rename the chosen device to eth0
2016-03-21cloud-init-local needs to want network-pre or it isnt guaranteed to startScott Moser
2016-03-20fix creation of network-config-ready and dont bother waiting on loScott Moser
2016-03-20fix syntaxScott Moser
2016-03-18cloud-init-local.service: touch file that cloud-init-wait will wait forScott Moser
this might work. And if it does means we could generally test this as the file that the cloud-init-wait will wait for will actually get created.
2016-03-18remove the 'find_name' function that was here.Scott Moser
I had left this in to commit it, it was my first pass at cloud-init doing the naming itself. That design was then replaced with the idea for cloud-init to instead write systemd.rules files.
2016-03-18commit the systemd waiting mechanismScott Moser
Note, still broken as cloud-init local is not going to ever touch the CI_NET_READY file (/run/cloud-init/network-config-ready). So as this is , it will actually just block for 60 seconds and go on.
2016-03-18add this, its getting moved, but i wanted some of the content storedScott Moser
2016-03-18add atomic_write_file and use it from atomic_write_jsonScott Moser
atomic_write_file just does less and easily utilized for the same purpose that atomic_write_json served.
2016-03-18Added commentsWesley Wiedenmeier
2016-03-18Handle static ip= entries by appending a static subnet to the deviceWesley Wiedenmeier
2016-03-18debian packaging: adjust build-depends for xenialScott Moser
python3 support was moved out of pyflakes into python3-pyflakes. Adjust the package to build on trusty where python3-pyflakes was not present and also on xenial where it is. Note, this does mean that sbuild now requires '--resolve-alternatives'. That is how it is used on launchpad but is not the default in sbuild.
2016-03-18If proto not specified, determine it using logic from:Wesley Wiedenmeier
lp:cloud-initramfs-tools/dyn-netconf/scripts/init-bottom/cloud-initramfs-dyn-netconf
2016-03-18Fully parse files at /run/net-dev.conf, loading parameters for address,Wesley Wiedenmeier
broadcast, netmask, gateway and hostname if present
2016-03-18Merge from trunkWesley Wiedenmeier
2016-03-17Check for and merge in configuration caused by the 'ip' parameter on theWesley Wiedenmeier
kernel's cmdline during network configuration parsing. - Search for .conf files in /run with names starting with 'net', as these are created during early boot if the ip parameter is present - If any are present and valid they are merged with network configuration from the current data source - If the devices affected by the 'ip' parameter are already present in network configuration, then a subnet entry will be added to the device's configuration unless an identical entry is already present - If any of the devices affected are not present then a mostly blank configuration will be generated for the device and the appropriate subnet specified
2016-03-17Send proper SUCCESS / FAILED events to the underlying VMware hypervisor.Scott Moser
Added code to customize timezone. Added few utility functions to send events to the VMware hypervisor. Re-factored the code little bit. Added code to send SUCCESS event when customization succeeds. Added code to send FAILED event if any error occurs during customization.