Skip to content

RHEL Installation Automation

Problem statement:

Compatibility testing of PowerChute Network Shutdown (PCNS) and PowerChute Serial Shutdown (PCSS) with newly released operating system versions, such as Red Hat Enterprise Linux (RHEL), requires setting up fresh test environments for every release. The initial step in this process is installing the OS itself, which is currently a time-consuming, error-prone, and resource-intensive task.

Current Approach:

The installation of RHEL for compatibility testing is carried out through two primary methods depending on the test environment:
Physical Machine Installation (via USB Drive – PCSS)
The ISO image of the latest RHEL release is first downloaded.
A bootable USB drive is prepared using the ISO.
The physical machine is booted from the USB, and the RHEL installation process is performed manually.
During installation, multiple configurations must be handled, such as partitioning the disk, selecting packages, setting up users, and enabling/disabling services.
This process often requires continuous monitoring until the installation is completed.
Virtual Machine Installation (via VMware ESXi – PCNS)
The ISO image of RHEL is uploaded to the datastore of the ESXi host.
A new VM template is created with appropriate configurations (CPU, memory, storage).
The VM template is then mapped to the uploaded RHEL ISO.
The VM console is launched, and installation steps are manually executed:
Select installation language.
Configure memory partitioning.
Create and configure user accounts.
Apply necessary system settings (e.g., enable SSH, disable firewall, set network configurations).
The installation requires navigating through numerous setup screens and applying default configurations before the system is ready.

New Approach (Solution)


To eliminate the inefficiencies of the manual installation process, we have developed an automation framework using PowerShell scripts. This solution automates the complete installation workflow of RHEL from preparing the environment to configuring the system post-installation, without requiring human intervention.

Flowchart for PCSS Flowchart for PCNS
Untitled Diagram.drawio (9).png
Untitled Diagram.drawio (4).png


The solution is powered by four background PowerShell scripts, each responsible for handling a key stage of the installation:
1. Download ISO Script (Download_ISO.ps1)
Takes the official RHEL ISO download URL as input.
Uses the wget command to automatically download the ISO image onto an Ubuntu machine.
This Ubuntu machine acts as the base environment for creating a customized ISO with preconfigured installation parameters.

2. Main Orchestration Script — main.ps1
This is the central script, executed after the ISO download is complete.
Responsible for creating the custom ISO and VM template required for automated installation.
Internally, it invokes two supporting scripts on the Ubuntu machine:
Custom ISO Creation Script – takes the downloaded RHEL ISO and embeds predefined configurations (language, partitioning, user setup, system defaults like enabling SSH and disabling firewall). Produces a custom ISO that can perform unattended installation.
RHEL VM Creation Script – connects to the VMware ESXi host, creates a VM template with specified resources (CPU, RAM, storage), and maps the generated custom ISO to the VM.

3. Custom ISO Creation Script — buildISO.ps1
This script transforms the downloaded ISO into a customized, unattended-install ISO. It performs the following steps:
Mount & Extract – Mounts the downloaded ISO and extracts its contents.
Kickstart Integration – Copies a pre-defined kickstart.cfg file into the root directory of the extracted ISO image. This file contains all installation parameters (disk partitions, language, user setup, SSH enable, firewall disable, etc.).
Boot Menu Update – Modifies grub.cfg to add a new boot entry for Automated Install, which triggers the kickstart file during boot.
Rebuild Boot Image – Rebuilds the EFI boot image so the custom ISO remains bootable with the new automated option.
Custom ISO Build – Creates a new custom ISO using xorrisofs.
Upload to ESXi Datastore – Automatically uploads the newly built custom ISO to the VMware ESXi datastore for VM deployment.

4. Creation of Virtual Machine — Create-RHEL-VM.ps1
Establishes a connection to the VMware ESXi host.
Creates a new RHEL VM template with predefine d resource specifications (CPU, RAM, storage).
Maps the newly uploaded custom ISO to the VM.
Powers on the VM to initiate the automated installation.
Since the ISO already contains the kickstart file and boot menu entry, the RHEL installation proceeds fully unattended.
Within a few minutes, the installation is completed and the VM is ready for use.


Benefits of the Automated Workflow

End-to-End Automation – Every step, from ISO download to a running RHEL VM, is performed without manual intervention.
Speed & Efficiency – Reduces installation time from several hours to just a few minutes.
Consistency & Reliability – Every VM follows the same script-driven workflow, ensuring uniform environments across tests.
Error-Free Setup – Eliminates human mistakes in installation and configuration steps.
Scalability – Multiple VMs/environments can be provisioned in parallel across ESXi hosts.
Faster Testing Cycles – Compatibility testing can begin immediately, accelerating product validation timelines.
Resource Optimization – Frees engineers from repetitive setup tasks, allowing focus on higher-value work.


Steps to Automate Installation

Login to Download Machine (10.179.14.47).
Navigate to the following directory:
Open a terminal (PowerShell) in this directory.
Execute the first script to download the ISO:
3. Once the ISO download is complete, run the main orchestration script:
For PCSS
For PCNS
4. NOTE: Only for installation on physical machine (for PCSS)
Have custom iso in Download machine using the main_PCSS.ps1 script
Connect USB to Download machine
Boot using Rufus.
Disconnect USB and Connect it to required machine.
Press F12.
Select "USB--HDD" option in Boot option menu.
Wait till it gets installed!!!!!!!!!!!!!!!!!!!!


Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.