You can deploy the Red Hat Enterprise Linux operating system on a server using a server YAML file or a hardware profile.
The following sample YAML files shows the attributes and values for Red Hat Enterprise Linux deployment on Dell PowerEdge 15th generation servers.
- These files are only for reference. You must use the sample files provided with Bare Metal Orchestrator deployment.
- The comments in the YAML file start with a hash character (#) and are followed by a text or the name of the attribute. You can remove # to un-comment and edit the attribute value.
- Replace what appears between italicized, bold chevrons (
< >
) with user-supplied content. For example:password: <REPLACE_THIS>
Sample server YAML file for Red Hat Enterprise Linux deployment
apiVersion: mw.dell.com/v4
kind: Server
metadata:
name: rhel-os
labels:
site: gc
spec:
bmcEndPoint: "https://<BMC-IP>"
userName: root
password: <REPLACE_THIS>
powerstate: "On"
bios:
attributes:
bootMode: Uefi
serialPortAddress: Com2
bmc:
- attributes:
rfsIgnoreCertWarning: "Yes"
serialRedirectEnable: Enabled
operatingsystemname: "rhel-media"
operatingsystemconfig:
autoConfigureBoss: false
networkingDetails:
hostName: <REPLACE_THIS>
# installVolumeID: "Disk.Virtual.0:RAID.Integrated.1-1"
installVolumeTypeOrder:
- type: BOSS
- type: SDCARD
- type: NVME
- type: RAID
name: "TestRaid0Vol0"
- type: HBA
configtype: "kickstart"
configdata: |
# set language
lang en_US
# set keyboard layout
keyboard us
# set timezone
timezone America/New_York --isUtc
# set root password, if --iscrypted is not used then clear text can be used
rootpw <REPLACE_WITH_ENCRYPTED_PASSWORD> --iscrypted
# performs a reboot after installation
reboot
# runs text based installation instead of gui based text
# installation from type cdrom, harddrive, nfs, liveimg, url
cdrom
# Initializes any invalid partition tables that are found on disks and destroys all of the contents of disks with invalid partition tables.
# This command is required when performing an installation on an IBM Z system with unformatted Direct Access Storage Device (DASD) disks,
# otherwise the unformatted disks are not formatted and used during the installation.
zerombr
# Removes partitions from the system, prior to creation of new partitions. By default, no partitions are removed.
clearpart --all --initlabel
# Automatically creates partitions: a root (/) partition (1 GB or larger), a swap partition,
# and an appropriate /boot partition for the architecture. On large enough drives (50 GB and larger), this also creates a /home partition.
autopart
# Configures network information for the target system and activates network devices in the installation environment.
# The device specified in the first network command is activated automatically.
network --device=<REPLACE_THIS_WITH_MAC_ADDR> --hostname={{.OSNetworkingDetails.HostName}} --bootproto=static --ip=<REPLACE_THIS_WITH_IP> --netmask=<REPLACE_THIS_WITH_IP> --gateway=<REPLACE_THIS_WITH_IP>
# System authorization information
auth --passalgo=sha512 --useshadow
# Sets the state of SELinux on the installed system. The default SELinux policy is enforcing.
selinux --disable
# Specify the firewall configuration for the installed system.
firewall --enabled
# If skipx is present, X-Server is not configured on the installed system.
skipx
# Determine whether the Initial Setup application starts the first time the system is booted.
# If enabled, the initial-setup package must be installed.
firstboot --enable
###################################################################################################
# Section below this should not be edited for a successful RHEL installation
###################################################################################################
%pre
#!/bin/sh
touch /tmp/rhel-install
SASADDRESS={{.SASAddress}}
TARGET={{.Target}}
SERIALNUMBER={{.SerialNumber}}
DEVICETYPE={{.DeviceType}}
DEVICENAME=""
OSHOSTNAME={{.OSNetworkingDetails.HostName}}
GROUP="$(vgs --noheadings | awk '{print $1}')"
# removing volume group if one exists
if ! [ -z "$GROUP" ]; then
vgremove -f -y $GROUP
fi
# wipe drives section
# clearpart cannot clear existing bios raid configurations.
# adding wipefs -a will remove that configuration
DISKS="$(lsblk | grep disk | awk '{print $1}')"
for DISK in $DISK; do
echo "wiping signature from disk: $DISK"
wipefs -a /dev/$DISK
done
case $DEVICETYPE in
"nvme") DEVICENAME="$(ls -al /dev/disk/by-id/ | grep $SERIALNUMBER | awk '{print $11}' | cut -c 7- | head -n 1)"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
"raid") DEVICENAME="$(smartctl --scan | awk '{print $1}' | head -n 1)"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
"usb") DEVICENAME="$(ls -al /dev/disk/by-id | grep usb | awk '{print $11}' | cut -c 7- | head -n 1)"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
"hba") PCI="$(lspci | grep -i sas | awk '{print $1}')"
DEVICENAME="$(ls -al /sys/block | grep $PCI | head -n 1 | awk '{print $9}' )"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
"boss") DEVICENAME="$(ls -al /dev/disk/by-id/ | grep -i ata | awk '{print $11}' | cut -c 7- | head -n 1)"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
esac
%end
%include /tmp/rhel-install
%post
/usr/bin/sed -i 's/rhgb quiet/console=tty0 console=ttyS1,115200/gI' /etc/default/grub
/usr/sbin/grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
cat > /usr/lib/systemd/system/install_complete.service << EOF
hostnamectl set-hostname {{.OSNetworkingDetails.HostName}}
[Unit]
Description=Install Complete
After=systemd-firstboot.target systemd-journald.service
[Service]
OSHOSTNAME={{.OSNetworkingDetails.HostName}}
Type=oneshot
User=root
RemainAfterExit=No
ExecStart=/usr/bin/sh -c 'echo "sol_verify_complete" > /dev/kmsg'
ExecStart=/usr/bin/sh -c 'sleep 5m'
ExecStart=/usr/bin/sh -c 'printf "bmo_ip_details_delimiter " >> /dev/kmsg'
ExecStart=/usr/bin/sh -c 'ip -4 addr |egrep "en[a-z][0-9]+|eth[0-9]+" | grep "inet" | cut -d " " -f 12 >> /dev/kmsg'
ExecStart=/usr/bin/sh -c 'printf ":" >> /dev/kmsg'
ExecStart=/usr/bin/sh -c 'hostname -I|cut -d" " -f 1 >> /dev/kmsg'
ExecStart=/usr/bin/sh -c 'printf " bmo_ip_details_delimiter" >> /dev/kmsg'
ExecStart=/usr/bin/sh -c 'sudo hostnamectl set-hostname $OSHOSTNAME '
ExecStart=/usr/bin/sh -c 'cat $OSHOSTNAME >> /etc/hostname'
EOF
/usr/bin/ln -sf /usr/lib/systemd/system/install_complete.service /usr/lib/systemd/system/default.target.wants/install_complete.service
%end
%packages
@^minimal-environment
kexec-tools
%end
Sample hardware profile YAML file for Red Hat Enterprise Linux deployment
apiVersion: mw.dell.com/v4
kind: HardwareProfile
metadata:
name: hwp-dell
labels:
site: gc
spec:
apply: false
preview: true
selectors:
model: dell-R750
# Add fields here
server:
powerState: "On"
bios:
attributes:
bootMode: Uefi
serialPortAddress: Com2
bmc:
- attributes:
serialRedirectEnable: Enabled
rfsIgnoreCertWarning: "Yes"
operatingsystemname: "rhel-media"
operatingsystemconfig:
autoConfigureBoss: true
#installVolumeID: "Disk.Virtual.0:RAID.Slot.2-1"
installVolumeTypeOrder:
- type: BOSS
- type: SDCARD
- type: NVME
- type: RAID
name: "NAME_OF_VIRTUAL_DISK"
- type: HBA
configtype: "kickstart"
configdata: |
lang en_US
keyboard us
timezone America/New_York --isUtc
# Set the root password for the DCUI and Tech Support Mode
rootpw <REPLACE_WITH_ENCRYPTED_PASSWORD> --iscrypted
# Reboot the machine after scripted installation is complete
reboot
text
cdrom
zerombr
clearpart --all --initlabel
network --bootproto=dhcp
auth --passalgo=sha512 --useshadow
selinux --disable
firewall --enabled
skipx
firstboot --enable
%pre
#!/bin/sh
touch /tmp/rhel-install
SASADDRESS={{.SASAddress}}
TARGET={{.Target}}
SERIALNUMBER={{.SerialNumber}}
DEVICETYPE={{.DeviceType}}
DEVICENAME=""
GROUP="$(vgs --noheadings | awk '{print $1}')"
# removing volume group if one exists
if ! [ -z "$GROUP" ]; then
vgremove -f -y $GROUP
fi
# wipe drives section
# clearpart cannot clear existing bios raid configurations.
# adding wipefs -a will remove that configuration
DISKS="$(lsblk | grep disk | awk '{print $1}')"
for DISK in $DISK; do
echo "wiping signature from disk: $DISK"
wipefs -a /dev/$DISK
done
case $DEVICETYPE in
"nvme") DEVICENAME="$(ls -al /dev/disk/by-id/ | grep $SERIALNUMBER | awk '{print $11}' | cut -c 7- | head -n 1)"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
"raid") DEVICENAME="$(smartctl --scan | awk '{print $1}' | head -n 1)"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
"usb") DEVICENAME="$(ls -al /dev/disk/by-id | grep usb | awk '{print $11}' | cut -c 7- | head -n 1)"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
"hba") PCI="$(lspci | grep -i sas | awk '{print $1}')"
DEVICENAME="$(ls -al /sys/block | grep $PCI | head -n 1 | awk '{print $9}' )"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
"boss") DEVICENAME="$(ls -al /dev/disk/by-id/ | grep -i ata | awk '{print $11}' | cut -c 7- | head -n 1)"
echo "ignoredisk --only-use=$DEVICENAME" >> /tmp/rhel-install
;;
esac
%end
%include /tmp/rhel-install
%post
/usr/bin/sed -i 's/rhgb quiet/console=tty0 console=ttyS1,115200/gI' /etc/default/grub
/usr/sbin/grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
cat > /usr/lib/systemd/system/install_complete.service << EOF
[Unit]
Description=Install Complete
After=systemd-firstboot.target systemd-journald.service
[Service]
Type=oneshot
User=root
RemainAfterExit=No
ExecStart=/usr/bin/sh -c 'echo "sol_verify_complete; bmo_ip_details_delimiter TBD bmo_ip_details_delimiter" > /dev/kmsg'
EOF
/usr/bin/ln -sf /usr/lib/systemd/system/install_complete.service /usr/lib/systemd/system/default.target.wants/install_complete.service
%end
%packages
@^minimal-environment
kexec-tools
%end