summaryrefslogtreecommitdiff
path: root/cloudinit
AgeCommit message (Collapse)Author
2016-04-04DataSource: set ds_cfg to be a dictionaryScott Moser
if the Datasource does not have an entry in config, then set it to be a empty dictionary rather than None. Also remove places that did this elsewhere.
2016-04-04merge with trunkScott Moser
2016-03-29Misc fixes for VMware Support.Scott Moser
- Modified the code to look for customization specification file in /var/run/vmware-imc/ directory instead of /tmp - Fixed the 'seed file' issue. There was a regression in DataSourceOVF.py file. Fixed it.
2016-03-29 Added a comment about /var/run/vmware-imc directory.Sankar Tanguturi
2016-03-29apply_network_config improvementsScott Moser
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.
2016-03-24pyflakesScott Moser
2016-03-24some final changesScott Moser
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.
2016-03-24pep8 fixes from last comment mergeScott Moser
2016-03-24support reading network config from kernel command lineScott Moser
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.
2016-03-24add comments and improve error messagesScott Moser
2016-03-24make get_cmdline read /proc/1/cmdline if inside a containerScott Moser
This follows behavior of systemd/cloud-init-generator. This way you can feed a command line into lxc container.
2016-03-24ConfigDrive: convert OpenStack network_data.json to network_config.yamlScott Moser
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.
2016-03-24fix review commentsRyan Harper
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.
2016-03-24remove debug codeScott Moser
2016-03-24provide datasource.check_instance_id with access to system configScott Moser
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.
2016-03-24improve commentScott Moser
2016-03-24add suport for base64 encoded gzipped text on command lineScott Moser
add tests to show this functional.
2016-03-23network_data: add link type 'phys', no need to reload json dataRyan Harper
2016-03-23support [untested] network-config=<base64> on kernel command lineScott Moser
2016-03-23fix tox issuesScott Moser
2016-03-23fix openstack versions s/KILO/LIBERY drop networkdata read helperRyan Harper
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-23configdata: parse and convert openstack network_data json to network_configRyan Harper
2016-03-23merge from trunk.net1Scott Moser
2016-03-22better log message about applying networking.Scott Moser
2016-03-22 Fixed few other misc issues.Sankar Tanguturi
Enabled NICS even in failure case. Used util.del_dir() instead of shutil.rmtree.
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-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