summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* DataSourceAzure: write marker file after report ready in preprovisioning (#590)Johnson Shi2020-10-163-22/+90
| | | | | | | | | | | | | | | | | | DataSourceAzure previously writes the preprovisioning reported ready marker file before it goes through the report ready workflow. On certain VM instances, the marker file is successfully written but then reporting ready fails. Upon rare VM reboots by the platform, cloud-init sees that the report ready marker file already exists. The existence of this marker file tells cloud-init not to report ready again (because it mistakenly assumes that it already reported ready in preprovisioning). In this scenario, cloud-init instead erroneously takes the reprovisioning workflow instead of reporting ready again.
* integration_tests: emit settings to log during setup (#601)Daniel Watkins2020-10-162-0/+12
|
* integration_tests: implement citest tests run in Travis (#605)Daniel Watkins2020-10-164-0/+335
| | | | | | | | | | Specifically: * `apt_configure_sources_list` * `ntp_servers` * `set_password_list` * `users_groups` Although not currently run in Travis, `set_password_list_string` was ported over alongside `set_password_list` (as `test_set_password`).
* Add Azure support to integration test framework (#604)James Falcon2020-10-152-1/+2
|
* openstack: consider product_name as valid chassis tag (#580)Adrian Vladu2020-10-153-1/+33
| | | | | | | | | | | | Consider valid product names as valid chassis asset tags when detecting OpenStack platform before crawling for OpenStack metadata. As `ds-identify` tool uses product name as valid chassis asset tags, let's replicate the behaviour in the OpenStack platform detection too. This change should be backwards compatible and a temporary fix for the current limitations on the OpenStack platform detection. LP: #1895976
* azure: clean up and refactor report_diagnostic_event (#563)Johnson Shi2020-10-153-99/+142
| | | This moves logging into `report_diagnostic_event`, to clean up its callsites.
* net: add the ability to blacklist network interfaces based on driver during ↵Anh Vo2020-10-134-40/+86
| | | | enumeration of physical network devices (#591)
* integration_tests: don't error on cloud-init failure (#596)Daniel Watkins2020-10-061-3/+3
| | | | | | pycloudlib's default behaviour is to raise an exception if cloud-init fails to run in an instance being launched. For cloud-init testing, we want our test assertions to flag up failures, so we disable this behaviour for instances we launch.
* integration_tests: improve cloud-init.log assertions (#593)Daniel Watkins2020-10-061-0/+26
|
* conftest.py: remove top-level import of httpretty (#599)Daniel Watkins2020-10-062-3/+11
| | | | This means that the integration tests do not need to install test-requirements.txt in order to successfully import `conftest.py`.
* tox.ini: add integration-tests testenv definition (#595)Daniel Watkins2020-10-051-0/+9
|
* PULL_REQUEST_TEMPLATE.md: empty checkboxes need a space (#597)Daniel Watkins2020-10-051-3/+3
|
* add integration test for LP: #1886531 (#592)Daniel Watkins2020-10-021-0/+27
|
* Initial implementation of integration testing infrastructure (#581)James Falcon2020-10-0110-5/+547
|
* Fix name of ntp and chrony service on CentOS and RHEL. (#589)Scott Moser2020-10-011-0/+8
| | | | | | | | | | | | The service installed by the CentOS and RHEL 'ntp' package is ntpd.service not ntp.service Fix that for those two distros. Also fix chrony service from 'chrony' to 'chronyd'. LP: #1897915
* Adding a PR template (#587)James Falcon2020-09-291-0/+18
|
* Azure parse_network_config uses fallback cfg when generate IMDS network cfg ↵Johnson Shi2020-09-242-120/+164
| | | | | | | | | fails (#549) Azure datasource's `parse_network_config` throws a fatal uncaught exception when an exception is raised during generation of network config from IMDS metadata. This happens when IMDS metadata is invalid/corrupted (such as when it is missing network or interface metadata). This causes the rest of provisioning to fail. This changes `parse_network_config` to be a non-fatal implementation. Additionally, when generating network config from IMDS metadata fails, fall back on generating fallback network config (`_generate_network_config_from_fallback_config`). This also changes fallback network config generation (`_generate_network_config_from_fallback_config`) to blacklist an additional driver: `mlx5_core`.
* features: refresh docs for easier out-of-context reading (#582)Daniel Watkins2020-09-231-9/+21
|
* Fix typo in resolv_conf module's description (#578)Wacław Schiller2020-09-221-1/+1
|
* cc_users_groups: minor doc formatting fix (#577)Daniel Watkins2020-09-221-4/+3
| | | Co-authored-by: Rick Harding <rharding@mitechie.com>
* Fix typo in disk_setup module's description (#579)Wacław Schiller2020-09-211-1/+1
|
* Add vendor-data support to seedfrom parameter for NoCloud and OVF (#570)Johann Queuniet2020-09-184-5/+45
|
* boot.rst: add First Boot Determination section (#568)Daniel Watkins2020-09-161-0/+86
| | | LP: #1888858
* opennebula.rst: minor readability improvements (#573)Mina Galić2020-09-161-3/+3
| | | | - use `sh` as highlight language of the code block - change order so that the confusing indentation is less confusing
* cloudinit: remove unused LOG variables (#574)Daniel Watkins2020-09-1613-41/+0
| | | Co-authored-by: Rick Harding <rharding@mitechie.com>
* create a shutdown_command method in distro classes (#567)Emmanuel Thomé2020-09-156-62/+102
| | | | | | | | | | | | Under FreeBSD, we want to use "shutdown -p" for poweroff. Alpine Linux also has some specificities. We choose to define a method that returns the shutdown command line to use, rather than a method that actually does the shutdown. This makes it easier to have the tests in test_handler_power_state do their verifications. Two tests are added for the special behaviours that are known so far.
* user_data: remove unused constant (#566)Daniel Watkins2020-09-151-1/+0
| | | | | This was added in d00126c167fc06d913d99cfc184bf3402cb8cf53, but not removed in ef041fd822a2cf3a4022525e942ce988b1f95180 which removed the one usage of it from the original commit.
* network: Fix type and respect name when rendering vlan in sysconfig. (#541)Eduardo Otubo2020-09-153-5/+112
| | | | | | | | | | | | | | | Prior to this change, vlans were rendered in sysconfig with 'TYPE=Ethernet', and incorrectly rendered the PHYSDEV based on the name of the vlan device rather than the 'link' provided in the network config. The change here fixes: * rendering of TYPE=Ethernet for a vlan * adds a warning if the configured device name is not supported per the RHEL 7 docs "11.5. Naming Scheme for VLAN Interfaces" LP: #1788915 LP: #1826608 RHBZ: #1861871
* Retrieve SSH keys from IMDS first with OVF as a fallback (#509)Thomas Stringer2020-09-105-30/+156
| | | | | | | | | | | | | | | | | * pull ssh keys from imds first and fall back to ovf if unavailable * refactor log and diagnostic messages * refactor the OpenSSLManager instantiation and certificate usage * fix unit test where exception was being silenced for generate cert * fix tests now that certificate is not always generated * add documentation for ssh key retrieval * add ability to check if http client has security enabled * refactor certificate logic to GoalState
* Add jqueuniet as contributor (#569)Johann Queuniet2020-09-081-0/+1
|
* distros: minor typo fix (#562)Daniel Watkins2020-09-081-2/+3
| | | Co-authored-by: Rick Harding <rharding@mitechie.com>
* Bump the integration-requirements versioned dependencies (#565)Paride Legovini2020-09-031-6/+4
| | | | | | | | During the ec2 integration test runs we occasionally see failures in deleting test instances. Hopefully a newer boto3 will be more robust. Also bump: paramiko, cryptography, pylxd (now pulling it from pypi). Tested with a full Xenial EC2 cloud_tests run.
* network-config-format-v1: fix typo in nameserver example (#564)Stanislas2020-09-011-1/+1
|
* Run cloud-init-local.service after the hv_kvp_daemon (#505)Robert Schweikert2020-08-311-0/+1
| | | This ensures that KVP data can be correctly reported to Azure.
* Add method type hints for Azure helper (#540)Johnson Shi2020-08-281-12/+18
| | | This reverts commit 8d25d5e6fac39ab3319ec5d37d23196429fb0c95.
* systemd: add Before=shutdown.target when Conflicts=shutdown.target is used ↵Paride Legovini2020-08-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | (#546) Lintian spotted the following issue: The specified systemd .service file contains both DefaultDependencies=no and Conflicts=shutdown.target directives without Before=shutdown.target. This can lead to problems during shutdown because the service may linger until the very end of shutdown sequence as nothing requests to stop it before (due to DefaultDependencies=no). There is race condition between stopping units and systemd getting a request to exit the main loop, so it may proceed with shutdown before all pending stop jobs have been processed. Please add Before=shutdown.target. [1] https://lintian.debian.org/tags/systemd-service-file-shutdown-problems.html Co-authored-by: Rick Harding <rharding@mitechie.com>
* LXD: detach network from profile before deleting it (#542)Paride Legovini2020-08-272-5/+9
| | | | | | | | | | | | | | | | | * LXD: detach network from profile before deleting it When cleaning up the bridge network created by default by LXD as part of the `lxd init` process detach the network its profile before deleting it. LXD will otherwise refuse to delete it with error: Error: The network is currently in use. Discussion with LXD upstream: https://github.com/lxc/lxd/issues/7804. LP: #1776958 * LXD bridge deletion: fail if bridge exists but can't be deleted * LXD bridge deletion: remove useless failure logging
* redhat spec: add missing BuildRequires (#552)Paride Legovini2020-08-271-5/+4
| | | | | | | | | | | | | | | | | 456fb55744a1acc6bd2f464b7656a9c33d0b7ac5 made tools/read-dependencies and package/brpm distinguish between build dependencies and runtime dependencies, however packages/redhat/cloud-init.spec.in expects all the dependencies to be in the 'requires' list, thus missing some build dependencies. This change makes cloud-init.spec use 'buildrequires' too. The build happens to succeed without python3-devel on the epel-8 copr chroot as it pulls in the epel-rpm-macros package, which in turn depends on python3-devel. In other words the dependency is satisfied by chance. Packages building for Python 3 need to explicitly specify BuildRequires: python3-devel, see: [1]. [1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/
* util: remove debug statement (#556)Joshua Powers2020-08-261-1/+0
|
* Fix cloud config on chef example (#551)lucasmoura2020-08-261-1/+2
|
* Release 20.3 (#547)20.3James Falcon2020-08-252-1/+178
| | | | | | Bump the version in cloudinit/version.py to 20.3 and update ChangeLog. LP: #1892878
* tox: bump the pylint version to 2.6.0 in the default run (#544)Paride Legovini2020-08-2540-136/+205
| | | | | | Changes: tox: bump the pylint version to 2.6.0 in the default run Fix pylint 2.6.0 W0707 warnings (raise-missing-from)
* Azure: Add netplan driver filter when using hv_netvsc driver (#539)James Falcon2020-08-242-3/+28
| | | | | This fixes a long delay during boot of some instances. For Azure instance types using SR-IOV via the Hyper-V netvsc network driver, two network interfaces are created that share the same MAC, but only the virtual device should be configured and used. Updating the netplan configuration to filter on the hv_netvsc driver prevents netplan from trying to figure both devices. LP: #1830740
* query: do not handle non-decodable non-gzipped content (#543)Chad Smith2020-08-242-11/+3
|
* DHCP sandboxing failing on noexec mounted /var/tmp (#521)Eduardo Otubo2020-08-242-0/+52
| | | | | | | | | | | | | | | | | * DHCP sandboxing failing on noexec mounted /var/tmp If /var/tmp is mounted with noexec option the DHCP sandboxing will fail with Permission Denied. This patch simply avoids this error by checking the exec permission updating the dhcp path in negative case. rhbz: https://bugzilla.redhat.com/show_bug.cgi?id=1857309 Signed-off-by: Eduardo Otubo <otubo@redhat.com> * Replacing with os.* calls * Adding test and removing isfile() useless call. Co-authored-by: Rick Harding <rharding@mitechie.com>
* Update the list of valid ssh keys. (#487)Ole-Martin Bratteng2020-08-215-35/+299
| | | | | | | | | | | | | Update ssh_util.py with latest list of keys (from openssh-8.3p1/sshkey.c), Added keys: sk-ecdsa-sha2-nistp256-cert-v01@openssh.com sk-ecdsa-sha2-nistp256@openssh.com sk-ssh-ed25519-cert-v01@openssh.com sk-ssh-ed25519@openssh.com ssh-xmss-cert-v01@openssh.com ssh-xmss@openssh.com LP: #1877869
* cmd: cloud-init query to handle compressed userdata (#516)Chad Smith2020-08-202-168/+272
| | | | | | | | | | | | cloud-init query tries to directly load and decode raw user-data from /var/lib/cloud/instance/user-data.txt. This results in UnicodeDecodeErrors on some platforms which provide compressed content. Avoid UnicodeDecoderErrors when parsing compressed user-data at /var/lib/cloud/instance/user-data.txt. LP: #1889938
* Pushing cloud-init log to the KVP (#529)Moustafa Moustafa2020-08-205-17/+162
| | | | | | | | | | | | | | | | | | | | | Push the cloud-init.log file (Up to 500KB at once) to the KVP before reporting ready to the Azure platform. Based on the analysis done on a large sample of cloud-init.log files, Here's the statistics collected on the log file size: P50 P90 P95 P99 P99.9 P99.99 137K 423K 537K 3.5MB 6MB 16MB This change limits the size of cloud-init.log file data that gets dumped to KVP to 500KB. So for ~95% of the cases, the whole log file will be dumped and for the remaining ~5%, we will get the last 500KB of the cloud-init.log file. To asses the performance of the 500KB limit, 250 VM were deployed with a 500KB cloud-init.log file and the time taken to compress, encode and dump the entries to KVP was measured. Here's the time in milliseconds percentiles: P50 P99 P999 75.705 232.701 1169.636 Another 250 VMs were deployed with this logic dumping their normal cloud-init.log file to KVP, the same timing was measured as above. Here's the time in milliseconds percentiles: P50 P99 P999 1.88 5.277 6.992 Added excluded_handlers to the report_event function to be able to opt-out from reporting the events of the compressed cloud-init.log file to the cloud-init.log file. The KVP break_down logic had a bug, where it will reuse the same key for all the split chunks of KVP which results in overwriting the split KVPs by the last one when consumed by Hyper-V. I added the split chunk index as a differentiator to the KVP key. The Hyper-V consumes the KVPs from the KVP file as chunks whose key is 512KB and value is 2048KB but the Azure platform expects the value to be 1024KB, thus I introduced the Azure value limit.
* Add Alpine Linux support. (#535)dermotbradley2020-08-1924-106/+1068
| | | | | | | | Add new module cc_apk_configure for creating Alpine /etc/apk/repositories file. Modify cc_ca_certs, cc_ntp, cc_power_state_change, and cc_resolv_conf for Alpine. Add Alpine template files for Chrony and Busybox NTP support. Add Alpine template file for /etc/hosts.
* Detect kernel version before swap file creation (#428)Eduardo Otubo2020-08-184-3/+132
| | | | | | | | | | According to man page `man 8 swapon', "Preallocated swap files are supported on XFS since Linux 4.18". This patch checks for kernel version before attepting to create swapfile, using dd for XFS only on kernel versions <= 4.18 or btrfs. Add new func util.kernel_version which returns a tuple of ints (major, minor) Signed-off-by: Eduardo Otubo otubo@redhat.com