how cloud-init interacts with different operating systems and their respective network management tools.
When working with cloud-init, it’s crucial to understand how it interacts with different operating systems and their respective network management tools. This understanding ensures that your network configurations are applied correctly, especially when using orchestration tools like VMware Aria Automation.
In this post, I will describe the differences in how cloud-init interacts with network management tools in Ubuntu and Red Hat Enterprise Linux (RHEL) when configuring cloud VMs to obtain static IP addresses from a VMware Aria Automation static pool.
When the goal is to set a static IP address on a cloud VM, cloud-init must defer the network configuration to the external source. Follow these steps to achieve this on both Ubuntu and Red Hat Enterprise Linux.
Ubuntu with Netplan
In Ubuntu, particularly with versions that use Netplan for network configuration, you can disable cloud-init’s network management by creating a specific configuration file.
Steps to Disable Cloud-Init Networking on Ubuntu:
- Create Configuration File: Create a file named
/etc/cloud/cloud.cfg.d/99-custom-networking.cfg
. - Add Disable Network Configuration: Add the following content to the file:
network:{config:disabled}
This file informs cloud-init not to perform any network configuration, allowing Netplan to handle it according to the configuration specified in /etc/netplan/
.
Red Hat with NetworkManager
In Red Hat-based distributions, which typically use NetworkManager, the same approach with a custom file might not work as expected. Instead, you need to include the network: config: disabled
directive directly within the cloudConfig
section of your YAML configuration in vRealize Automation.
Steps to Disable Cloud-Init Networking on Red Hat:
- Include Configuration in YAML: Add the
network: config: disabled
directive directly within thecloudConfig
section of your vRealize Automation YAML configuration:
This method ensures that cloud-init recognizes the instruction to disable network management during the VM provisioning process.
Summary of Actions
For Ubuntu (with Netplan):
- Create the file
/etc/cloud/cloud.cfg.d/99-custom-networking.cfg
. - Add the following content to the file
:
network: {config:disabled}
For Red Hat (with NetworkManager):
- Include the network configuration disablement directly in the YAML configuration used by vRealize Automation:
cloudConfig: |
#cloud-config
network:
config: disabled
Explanation
- Ubuntu (Netplan):
- Using
/etc/cloud/cloud.cfg.d/99-custom-networking.cfg
is a common method to disable cloud-init networking in systems using Netplan. This file is read by cloud-init during the initialization process, and thenetwork: {config:disabled}
directive tells cloud-init to skip network configuration.
- Using
- Red Hat (NetworkManager):
- Including
network: config: disabled
in the YAML configuration ensures that cloud-init on Red Hat systems recognizes this setting during the VM provisioning process. This approach is necessary because NetworkManager configurations and the cloud-init behavior can differ from those on Ubuntu.
- Including
By understanding and applying these differences, you can ensure consistent and expected network configurations across different operating systems managed by cloud-init and vRealize Automation.
I want to thank you for your assistance and this post. It’s been great.
How can I find out more about it?
I was recommended this website by my cousin. I’m not sure
whether this post is written by him as no one else know such detailed about my difficulty.
You are amazing! Thanks!
Greetings from Los angeles! I’m bored to tears
at work so I decided to browse your blog on my iphone
during lunch break. I enjoy the knowledge
you present here and can’t wait to take a look when I get home.
I’m shocked at how fast your blog loaded on my cell phone ..
I’m not even using WIFI, just 3G .. Anyways, good blog!
It’s difficult to find educated people about this topic, however, you seem
like you know what you’re talking about! Thanks
Hello are using WordPress for your site platform? I’m new to the blog world but I’m trying to get started and create my own. Do you
require any html coding knowledge to make your own blog?
Any help would be really appreciated!