Prerequisite
Root account privileges are required to install cloud-init.
Procedure
The following operations demonstrate how to install cloud-init on CentOS Linux 7.5:
Connect to the virtual machine as the root user via SSH.
ssh root@<VM's IP address>
Alternatively, you can connect the virtual machine as an ordinary user via SSH and use sudo to execute subsequent installation commands.
Mount the ISO image within the guest operating system.
mkdir /mnt/<dir_to_mount_iso>
mount /dev/<cloudinit_iso_cdrom> /mnt/<dir_to_mount_iso>
<dir_to_mount_iso>
: The directory used to mount the ISO image.
<cloudinit_iso_cdrom>
: The device name of the CD-ROM where the ISO image is mounted when mounting the Arcfra VM Initialization Tool ISO image.
You can use either of the following commands to check the device name:
mkdir /mnt/cdrom
mount -o loop /dev/sr0 /mnt/cdrom
Execute the installation script.
bash /mnt/<dir_to_mount_iso>/cloud-init/tools/install_cloud_init.sh
If cloud-init is already installed in the current guest operating system, please follow the on-screen prompts to uninstall the existing cloud-init, then continue with the installation.
If cloud-init is not installed in the current guest operating system, please follow the on-screen prompts to complete the installation.
If the installation is successful, you will see the prompt Installation successful
.
You can also directly enter the following command to uninstall the existing cloud-init by default and complete the installation of the new cloud-init.
bash /mnt/<dir_to_mount_iso>/cloud-init/tools/install_cloud_init.sh --auto-yes