3.2. Deploying a RHEL instance by using a custom base image
To manually configure a virtual machine (VM) on cloud platforms, create a base (starter) image, modify configuration settings, and add the packages to the VM. This VM is customizable, flexible, and lightweight. After uploading the image, you can change settings for these specific applications.
Prerequisites
- You have access to the command line interface (CLI) or the web console for creating and configuring VM. If you do not have access to the CLI or the web console, you can use the Red Hat Cloud Access portal to create and configure VM.
- Secure Shell (SSH) - Enable SSH to give remote access to your VM.
- Dynamic Host Configuration Protocol (DHCP) - Configure the primary virtual adapter to use DHCP.
- You have enabled virtualization on the host machine.
- For web console, ensure the following options:
- You have not checked the Immediately Start VM option.
- You have already changed the Memory size to your preferred settings.
- You have changed the Model option under Virtual Network Interface Settings to virtio and vCPUs to the capacity settings for the VM.
Procedure
Configure the Red Hat Enterprise Linux (RHEL) VM. See the Additional resources section for details:
- To install from CLI, ensure that you set the default memory, network interfaces, and CPUs according to your requirement for the VM.
- You can also install RHEL from the web console.
When the installation starts:
-
Create a
rootpassword. - Create an administrative user account.
-
Create a
-
After the installation completes, reboot the VM and log in to the
rootaccount. -
After logging in as
root, you can configure the image. Register the VM and enable the RHEL repository:
# subscription-manager registerFor AMD64 or Intel 64 (x86_64) VMs, install the
nvme,xen-netfront, andxen-blkfrontdrivers:# dracut -f --add-drivers "nvme xen-netfront xen-blkfront"For ARM 64 (aarch64) VMs, install the
nvmedriver:# dracut -f --add-drivers "nvme"Including these drivers prevents a
dracuttime-out.Alternatively, you can add the drivers to
/etc/dracut.conf.d/and then enterdracut -fto overwrite the existinginitramfsfile.Install the
cloud-initpackage:# dnf install cloud-initEnable and start the
cloud-initservice:# systemctl enable --now cloud-init.service- Reboot the VM to apply the changes.
Verification
Verify that the VM is running:
# systemctl status cloud-init