Installing and configuring cloud-init on RHEL
Before you capture a virtual machine, you need to install the cloud-init package. This topic provides you details about cloud-init installation procedure for RHEL.
Install cloud-init on Red Hat® Enterprise Linux®This section details procedure for installing cloud-init on RHEL 7.x, RHEL 8.0, RHEL 8.1, RHEL 8.2, and RHEL 8.4.
- Update NetworkManager to the latest version available on the OS.
Use yum update NetworkManager to update NetworkManager.
- When updating existing RHEL on your system to a later version, refer to Installing and configuring cloud-init on RHEL to reconfigure cloud-init (for ppc64le architecture only).
- For troubleshooting steps related to MAC address conflict issues, see MAC address conflict.
- To avoid running into issues on RHEL 8.0 guest OS, review the steps in RMC inactive for RHEL 8 guest OS on NovaLink hosts.
- If some of the RHEL versions (for example, RHEL 8.1 and RHEL 8.2) become out of support, you must obtain extended support from Red Hat. Follow the requirements of extended support and apply patches or updates as recommended by Red Hat. For more information about extended support, see RHEL Extended Update Support (EUS) Overview.
- Perform the following steps to configure cloud-init-19.1 packages for RHEL 7.x, and RHEL
8.0. For instructions to configure RHEL provided cloud-init for RHEL 8.1 and later, see step 2.
Before you install cloud-init, you must install the dependencies for cloud-init from the operating system base and supplemental media, by using yum. Ensure that the dependencies are updated to the latest level.
Table 1. RHEL packages RHEL 7.x RHEL 8.0
e2fsprogs iproute libselinux-python net-tools policycoreutils-python procps python(abi) = 2.7 python-configobj python-jinja2 python-jsonpatch python-oauthlib python-PrettyTable python-requests python-six python-yaml python-jsonschema
e2fsprogs iproute net-tools procps python(abi) = 3.6 python3-configobj python3-jinja2 python3-jsonpatch python3-jsonschema python3-libselinux python3-oauthlib python3-policycoreutils python3-PrettyTable python3-requests python3-six python3-yaml
- Obtain the latest versions of cloud-init-19.1 packages for RHEL 7.x and RHEL 8.0 from respective locations. For RHEL 7, you must install additional package dependencies before installing cloud-init packages.
- Run yum install download_path/<cloud-init package> to install cloud-init. Make sure you provide complete RPM path during installation.
- To enable cloud-init on RHEL 8.1 (cloud-init-18.5-7.el8_1.4 and above), RHEL
8.2 (cloud-init-18.5-12.el8_2.6 and above) and RHEL 8.4
system, perform the following steps. Ensure the guest OS is updated to the latest version before
installing cloud-init (RHEL 8.1 or RHEL 8.2 March
2021 update or above).
- Install the RHEL provided cloud-init.
yum install cloud-init
- Add following data to
ssh_pwauthto false if you want to disable password authentication.
ssh_pwauth: true manage_resolv_conf: false datasource_list: [ ConfigDrive, NoCloud, None ] datasource: ConfigDrive: dsmode: local
resolv_confin cloud-init module section after
update_etc_hosts.Enable and start the cloud-init related services by running the following commands:
systemctl enable cloud-init-local.service systemctl enable cloud-init.service systemctl enable cloud-config.service systemctl enable cloud-final.service systemctl start cloud-init.service systemctl start cloud-init-local.service systemctl start cloud-config.service systemctl start cloud-final.serviceNote: Ensure that the
cloud.cfgfile has the
reset_rmcmodule listed. If you do not see the module listed, then make sure you update OS to the latest version of cloud-init.In case the
reset_rmcmodule is missing even after OS update, make sure you add the module in
cloud_final_modulessection of the /etc/cloud/cloud.cfg as follows:
- Create a new file
/etc/cloud/ds-identify.cfgand add following data.
- Update the NetworkManager package to the latest provided by
yum upgrade NetworkManager
- Make sure firewall is configured correctly to open up RMC port 657 for inbound and outbound traffic.
- Install the RHEL provided cloud-init.
runcmd: - rm -f /etc/machine-id - systemd-machine-id-setup