keepcalculator

06 Numbers and Powers

Cloud-init 26.2: Networking, Security, Cloud Support

Card No. 06·71594 · Updated · Standard formula, shown below

Cloud-init 26.2 is a maintenance release that improves networking robustness, hardens security defaults, and expands support for newer cloud platforms and operating systems. This article explains what changed, why it matters, and how to decide whether upgrading is right for your environment.

What Is Cloud-init?

Cloud-init is the standard tool for initializing cloud instances. When you launch a virtual machine from a cloud image, cloud-init runs early in the boot process to:

  • Set the hostname and configure SSH keys.
  • Apply user data (like cloud-config scripts).
  • Configure network interfaces (static IPs, VLANs, bonding).
  • Grow the root filesystem to fill the disk.
  • Run package updates or custom provisioning scripts.

It is used by major providers including AWS, Azure, GCP, OpenStack, and many private clouds. Version 26.2 is the second stable release of the 26.x series, following 26.1.

Networking Improvements in 26.2

The headline networking change is better handling of network configuration v2 (Netplan’s YAML format) across distributions. Specifically:

  • Improved IPv6 support: static IPv6 addresses and routes are now applied more reliably, especially when combined with IPv4 on the same interface.
  • Better bonding and VLAN handling: cloud-init now correctly orders the creation of VLAN sub-interfaces and bond members, preventing race conditions that caused interfaces to come up without their IP addresses.
  • Fallback to DHCP on failure: if a static configuration fails (e.g., due to a typo), cloud-init can fall back to DHCP, avoiding a completely unreachable instance.
  • Network activation on all distros: the network stage now works consistently on systemd-based systems, including those using NetworkManager instead of systemd-networkd.

These changes reduce the “instance boots but has no network” problem that plagued earlier versions, especially on custom images.

Security Hardening in 26.2

Security in cloud-init is about protecting the metadata service and the data it handles. 26.2 includes:

  • Disable EC2 instance connect by default: the ec2-hib module (which allows temporary SSH keys via AWS Instance Connect) is now disabled unless explicitly enabled. This reduces the attack surface if you don’t use that feature.
  • Stricter file permissions: user-data and vendor-data files are now written with 0600 permissions by default, preventing other users on the instance from reading them.
  • Better handling of sensitive data in logs: cloud-init no longer logs the full contents of user-data by default. It logs a redacted version, showing only the first few characters of each line.
  • Support for HTTPS metadata endpoints: when the platform provides an HTTPS metadata service (like Azure’s IMDS), cloud-init will use it if configured, preventing man-in-the-middle attacks on the wire.

These are not revolutionary changes, but they close common gaps that security audits often flag.

Broader Cloud and OS Support

Version 26.2 adds official support for:

  • AlmaLinux 9 and Rocky Linux 9: these RHEL-compatible distros now work out of the box with the same features as CentOS Stream 9.
  • OpenSUSE Leap 15.5 and Tumbleweed: improved handling of SUSE’s ifcfg network format.
  • FreeBSD 14: cloud-init now runs on FreeBSD 14 with better integration with its rc system.
  • New cloud platforms: added datasource support for Oracle Cloud Infrastructure (OCI) and Alibaba Cloud, alongside existing AWS, Azure, GCP, and OpenStack.

It also fixes several bugs that affected Ubuntu 24.04 and Debian 12, such as incorrect handling of the network-config file when using Netplan.

What’s New in the 26.x Series Overall

If you’re coming from version 23.x or earlier, 26.2 includes all the features from 26.1 and 26.0, such as:

  • New cloud-init schema command: validate your user-data and network-config files before deploying, catching syntax errors early.
  • Improved cloud-init status: shows more detail about which modules ran and whether they succeeded.
  • Support for #cloud-config merging: you can now merge multiple config files with a merge_type directive, allowing more complex setups.
  • Better error messages: when a datasource is not found, cloud-init now lists the datasources it tried and why each failed.

Should You Upgrade to 26.2?

Upgrading is generally safe, but consider your environment:

  • If you use static networking on Ubuntu or Debian: the networking fixes are important, so upgrade.
  • If you run security-sensitive workloads: the permission and logging changes are beneficial, but test that your provisioning scripts still work with redacted logs.
  • If you rely on EC2 Instance Connect: you’ll need to explicitly enable it in your user-data after upgrading.
  • If you use an older distro: check that your OS version is still supported. Cloud-init 26.2 supports Ubuntu 20.04+, Debian 11+, RHEL 8+, and similar.

On most systems, you can upgrade with your package manager (e.g., apt upgrade cloud-init). After upgrading, reboot the instance to ensure the new version takes effect.

Common Pitfalls and Misconceptions

“Cloud-init only works on first boot.” That’s true for the default config, but you can run cloud-init clean and reboot to re-run everything. This is useful for creating golden images.

“Upgrading cloud-init breaks my existing instances.” Upgrading the package does not re-run cloud-init on already-provisioned instances. It only affects new instances launched after the upgrade.

“Network config is always applied.” If your image uses Netplan, cloud-init writes the config but Netplan applies it. If Netplan is not installed, cloud-init falls back to ifupdown on Debian/Ubuntu, which may behave differently.

“I can skip the reboot after upgrading.” While cloud-init itself doesn’t run at boot if already initialized, some changes (like the network config writer) are only used on next boot. To be safe, reboot.

Frequently Asked Questions

Does cloud-init 26.2 work with Ubuntu 22.04?

Yes, cloud-init 26.2 is available in Ubuntu 22.04’s updates repository. It works with the default Netplan networking.

How do I check my current cloud-init version?

Run cloud-init --version in the terminal. It will output something like /usr/bin/cloud-init 26.2-0ubuntu1~22.04.1.

Will upgrading cloud-init affect my running instances?

No. Cloud-init only runs during the first boot (or after cloud-init clean). Upgrading the package does not trigger a re-run, so your running instances are unaffected.

Can I use cloud-init 26.2 on CentOS 7?

No. Cloud-init 26.2 requires Python 3.6 or later, and CentOS 7 ships Python 3.6 but the official builds for 26.2 target CentOS 8 and later. You can compile it from source, but it’s not recommended.

What is the difference between cloud-init and cloudbase-init?

Cloud-init is the standard for Linux; cloudbase-init is its Windows counterpart. They serve the same purpose but are separate projects.

How do I enable EC2 Instance Connect in 26.2?

Add ec2-hib: true to your user-data cloud-config, or pass --enable-ec2-hib when running cloud-init manually.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →