ThorneLabs

Dell iDRAC racadm Commands and Scripts

• Updated March 17, 2019


The Dell iDRAC web interface has always been cumbersome to deal with. However, you can log in via SSH to a Dell iDRAC and use the racadm command to perform actions against the physical server. Because of SSH, it is possible to automate actions that would otherwise take a long time to do via the web interface.

This post will be an ever growing list of Dell iDRAC racadm commands, scripts, and ways to automate repetitive tasks.

Set Server to Boot from Virtual CD/DVD Once and Power Cycle

Log in via SSH to the Dell iDRAC:

ssh root@IP_ADDRESS

Configure the server to boot from Virtual CD/DVD once and reboot immediately:

racadm config -g cfgServerInfo -o cfgServerBootOnce 1
racadm config -g cfgServerInfo -o cfgServerFirstBootDevice VCD-DVD
racadm serveraction powercycle

Set Server to PXE Boot Once and Power Cycle

Log in via SSH to the Dell iDRAC:

ssh root@IP_ADDRESS

Configure the server to PXE boot once and reboot immediately:

racadm config -g cfgServerInfo -o cfgServerBootOnce 1
racadm config -g cfgServerInfo -o cfgServerFirstBootDevice PXE
racadm serveraction powercycle

Set Persistent Boot Device

Log in via SSH to the Dell iDRAC:

ssh root@IP_ADDRESS

Configure the server to boot to the local hard drive every time:

racadm config -g cfgServerInfo -o cfgServerBootOnce 0
racadm config -g cfgServerInfo -o cfgServerFirstBootDevice HDD

Change the Dell iDRAC7 System Host Name

If you need to change the Host Name field as reported by command racadm getsysinfo and the System Host Name field as shown in the Dell iDRAC7 web GUI in the following screenshot, you must install Dell OpenManage on the particular server:

Dell iDrac7 web GUI screenshot

The attribute that contains this value in the Dell iDRAC7 is read only and cannot be changed by the user as shown with the following command:

/admin1-> racadm config -g ifcRacManagedNodeOs -o ifcRacMnOsHostname build01
ERROR: The specified object is READ ONLY and cannot be modified.

You can install Dell OpenManage on CentOS and RHEL by following the instructions here and on Ubuntu by following the instructions here.

Reset Dell iDRAC

If you ever run into the following error when trying to log in to the Dell iDRAC via the web interface:

Dell DRAC: RAC0218: The maximum number of user sessions is reached

Log in via SSH to the Dell iDRAC:

ssh root@IP_ADDRESS

And reset the Dell iDRAC (it may take a few minutes to come back online):

racadm racreset

After a few minutes you should be able to log in to the web interface again.

Reconfigure a Dell RAID (PERC) Controller through the Dell iDRAC Using racadm

If you have a lot of servers that need their RAID (PERC) Controllers reconfigured quickly, you can reconfigure a Dell iDRAC using racadm.

racadm Scripts

Set Many Servers to PXE Boot Once and Power Cycle

If you have a handful of servers that you need to set to PXE boot once and then power cycle the server, you can do so with the following script. Be sure to input the correct password, otherwise you will be locked out of the Dell iDRAC via SSH for about 5 minutes. In addition, whatever server you run the script from, the sshpass program will need to be installed for this to work.

#!/bin/bash
echo -n "Enter iDRAC root password (password will not be displayed): "
read -s DRACPASS
echo

for IP in IP_ADDRESS_1 IP_ADDRESS_2 IP_ADDRESS_3 IP_ADDRESS_N
do
echo "Setting $IP to boot once"
sshpass -p "$DRACPASS" ssh root@$IP racadm config -g cfgServerInfo -o cfgServerBootOnce 1
echo "Setting $IP boot device to PXE"
sshpass -p "$DRACPASS" ssh root@$IP racadm config -g cfgServerInfo -o cfgServerFirstBootDevice PXE
echo "Power cycling $IP now"
sshpass -p "$DRACPASS" ssh root@$IP racadm serveraction powercycle
done

References