Friday, November 27, 2015

XML Export/Import Dell iDRAC settings via RACADM

For iDRAC 7/8 you can now use RACADM command line interface to configure BIOS, iDRAC, RAID and NIC on the server using XML file, for iDRAC 5/6 you can continue to use legacy methods via export/import ini file. It is very useful when you want to have identical cloned settings across bunch of Dell servers.
You can make use of various racadm interfaces (Local, Remote and Firmware) to export system config to XML file and import the XML config file to the server from XML file. You can use this feature to take a backup of system configuration, configuring multiple server BIOS, iDRAC, RAID and NIC and to script configuration of BIOS, iDRAC, RAID and NIC of the server.

Prerequisites for XML import/export

You need to use Open Manage 7.2+ and iDRAC7+ Firmware 1.30.30+ onward to use this feature. You need to have iDRAC/OS Administrator privilege to do XML export or import.  The read only objects will be enclosed with exclamatory tag in that XML file. iDRAC should have minimum of “express” license to export the xml file.

Export iDRAC 7/8
System Config to XML file:

Using Racadm you can export system configuration to a XML file. This can be done using any racadm interface (Local, Remote and FW Racadm – SSH, Telnet and Serial). Export of the XML file can be done to a Local File (Using Local and Remote Racadm) or to a remote CIFS / NFS share (Using Local, Remote and FW Racadm). Once XML Export command is initiated a job will be created for export operation.
Using racadm jobqueue view -i <JOB ID> command you can get the status of export job. Once job is completed the XML file which contains configuration of BIOS, iDRAC, RAID and NIC will be created on the mentioned location. 

Syntax:
racadm get -t xml -f <filename.xml> [-l <share IP/path>] [-u <username>] [-p <password>]

CIFS Share:
racadm get -t xml -f <filename.xml> -l <//share IP/path> -u <username> -p <password>

NFS Share:
racadm get -t xml -f <filename.xml> -l <share IP:/path>

Local Share:
racadm get -t xml -f <path/filename.xml>

Local folder:
racadm -r <IP address> -u root -p calvin get -t xml -f <filename>.xml


Import iDRAC 7/8 System Config from XML file:

Once System config is exported to XML file, you can import the configuration back to the system any time. You can also modify various setting on XML file before importing the XML file to iDRAC. Similar to Export, Import of the XML file can be done from a Local File (Using Local and Remote Racadm) or from a remote CIFS / NFS share (Using Local, Remote and FW Racadm). After import operation, server goes for reboot if there are any changes on BIOS, RAID and NIC attributes. Server does not require a reboot if there are changes only to iDRAC attributes or if there is no change in that exported XML file. The command itself we can specify the Shutdown type which needs to be done before import starts and end state of the server after import. The shutdown type refers the shutdown method of the server once the Import is begun, supported values “Graceful & Forced”. End state used to specify the Server state once the import operation completes, supported values are “On & Off”. Once XML Import command is executed a job will be created for an import operation.
Using racadm jobqueue view -i <JOB ID> command you can get the status of export job. 

Syntax:
racadm set -t xml -f <filename.xml> [-l <share IP/path>] [-u <username>] [-p <password>] [-b <Shut Down Type>] [-w <Wait Time>] [-s <End Power State>]

CIFS Share:
racadm set -t xml -f <filename.xml> -l <//share IP/path> -u <username> -p <password> [-b <Shutdown type>] [-w <wait time>] [-s <End state>]

NFS Share:
racadm set -t xml -f <filename.xml> -l <share IP:/path> [-b <Shutdown type>] [-w <wait time>] [-s <End state>]

Local Share:
racadm set -t xml -f <path/filename.xml> [-b <Shutdown type>] [-w <wait time>] [-s <End state>]

Local folder:
racadm -r <IP address> -u root -p calvin set -t xml -f <filename>.xml


Sample iDRAC 7/8 config XML file:


Export iDRAC 5/6 System Config to legacy INI file

Syntax:



racadm -r <IP address> -u root -p calvin getconfig -f <filename>.ini

After you have exported  iDRAC configuration to file you can edit it with any text editor and then import to multiple iDRACs. Don't forget to comment or remove "cfgNicIpAddress" and "cfgDNSRacName" from INI file before importing file to another systems to avoid IP conflicts and name duplicates. 

Import iDRAC 5/6 System Config from legacy INI file

Syntax:

racadm
-r <IP address> -u root -p calvin config -f <filename>.ini

You need to reset iDRAC after settings imported:

racadm
-r <IP address> -u root -p calvin racreset

Sample iDRAC 5/6 config INI file:


References: