salt.modules.dracr

Manage Dell DRAC.

New in version 2015.8.2.

salt.modules.dracr.bare_rac_cmd(cmd, host=None, admin_username=None, admin_password=None)
salt.modules.dracr.change_password(username, password, uid=None, host=None, admin_username=None, admin_password=None, module=None)

Change user's password

CLI Example:

salt dell dracr.change_password [USERNAME] [PASSWORD] uid=[OPTIONAL]
    host=<remote DRAC> admin_username=<DRAC user>
    admin_password=<DRAC PW>
salt dell dracr.change_password diana secret

Note that if only a username is specified then this module will look up details for all 16 possible DRAC users. This is time consuming, but might be necessary if one is not sure which user slot contains the one you want. Many late-model Dell chassis have 'root' as UID 1, so if you can depend on that then setting the password is much quicker. Raises an error if the supplied password is greater than 20 chars.

salt.modules.dracr.create_user(username, password, permissions, users=None, host=None, admin_username=None, admin_password=None)

Create user accounts

CLI Example:

salt dell dracr.create_user [USERNAME] [PASSWORD] [PRIVILEGES]
salt dell dracr.create_user diana secret login,test_alerts,clear_logs
DRAC Privileges
  • login : Login to iDRAC

  • drac : Configure iDRAC

  • user_management : Configure Users

  • clear_logs : Clear Logs

  • server_control_commands : Execute Server Control Commands

  • console_redirection : Access Console Redirection

  • virtual_media : Access Virtual Media

  • test_alerts : Test Alerts

  • debug_commands : Execute Debug Commands

salt.modules.dracr.delete_user(username, uid=None, host=None, admin_username=None, admin_password=None)

Delete a user

CLI Example:

salt dell dracr.delete_user [USERNAME] [UID - optional]
salt dell dracr.delete_user diana 4
salt.modules.dracr.deploy_password(username, password, host=None, admin_username=None, admin_password=None, module=None)

Change the QuickDeploy password, used for switches as well

CLI Example:

salt dell dracr.deploy_password [USERNAME] [PASSWORD]
    host=<remote DRAC> admin_username=<DRAC user>
    admin_password=<DRAC PW>
salt dell dracr.change_password diana secret

Note that if only a username is specified then this module will look up details for all 16 possible DRAC users. This is time consuming, but might be necessary if one is not sure which user slot contains the one you want. Many late-model Dell chassis have 'root' as UID 1, so if you can depend on that then setting the password is much quicker.

salt.modules.dracr.deploy_snmp(snmp, host=None, admin_username=None, admin_password=None, module=None)

Change the QuickDeploy SNMP community string, used for switches as well

CLI Example:

salt dell dracr.deploy_snmp SNMP_STRING
    host=<remote DRAC or CMC> admin_username=<DRAC user>
    admin_password=<DRAC PW>
salt dell dracr.deploy_password diana secret
salt.modules.dracr.email_alerts(action, host=None, admin_username=None, admin_password=None)

Enable/Disable email alerts

CLI Example:

salt dell dracr.email_alerts True
salt dell dracr.email_alerts False
salt.modules.dracr.get_chassis_datacenter(host=None, admin_username=None, admin_password=None)

Get the datacenter of the chassis.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt '*' dracr.set_chassis_location host=111.222.333.444
   admin_username=root admin_password=secret
salt.modules.dracr.get_chassis_location(host=None, admin_username=None, admin_password=None)

Get the location of the chassis.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt '*' dracr.set_chassis_location host=111.222.333.444
   admin_username=root admin_password=secret
salt.modules.dracr.get_chassis_name(host=None, admin_username=None, admin_password=None)

Get the name of a chassis.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt '*' dracr.get_chassis_name host=111.222.333.444
    admin_username=root admin_password=secret
salt.modules.dracr.get_dns_dracname(host=None, admin_username=None, admin_password=None)
salt.modules.dracr.get_general(cfg_sec, cfg_var, host=None, admin_username=None, admin_password=None)
salt.modules.dracr.get_slotname(slot, host=None, admin_username=None, admin_password=None)

Get the name of a slot number in the chassis.

slot

The number of the slot for which to obtain the name.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt-call --local dracr.get_slotname 0 host=111.222.333.444
   admin_username=root admin_password=secret
salt.modules.dracr.idrac_general(blade_name, command, idrac_password=None, host=None, admin_username=None, admin_password=None)

Run a generic racadm command against a particular blade in a chassis. Blades are usually named things like 'server-1', 'server-2', etc. If the iDRAC has a different password than the CMC, then you can pass it with the idrac_password kwarg.

Parameters:
  • blade_name -- Name of the blade to run the command on

  • command -- Command like to pass to racadm

  • idrac_password -- Password for the iDRAC if different from the CMC

  • host -- Chassis hostname

  • admin_username -- CMC username

  • admin_password -- CMC password

Returns:

stdout if the retcode is 0, otherwise a standard cmd.run_all dictionary

CLI Example:

salt fx2 chassis.cmd idrac_general server-1 'get BIOS.SysProfileSettings'
salt.modules.dracr.inventory(host=None, admin_username=None, admin_password=None)
salt.modules.dracr.list_slotnames(host=None, admin_username=None, admin_password=None)

List the names of all slots in the chassis.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt-call --local dracr.list_slotnames host=111.222.333.444
    admin_username=root admin_password=secret
salt.modules.dracr.list_users(host=None, admin_username=None, admin_password=None, module=None)

List all DRAC users

CLI Example:

salt dell dracr.list_users
salt.modules.dracr.nameservers(ns, host=None, admin_username=None, admin_password=None, module=None)

Configure the nameservers on the DRAC

CLI Example:

salt dell dracr.nameservers [NAMESERVERS]
salt dell dracr.nameservers ns1.example.com ns2.example.com
    admin_username=root admin_password=calvin module=server-1
    host=192.168.1.1
salt.modules.dracr.network_info(host=None, admin_username=None, admin_password=None, module=None)

Return Network Configuration

CLI Example:

salt dell dracr.network_info
salt.modules.dracr.server_hardreset(host=None, admin_username=None, admin_password=None, module=None)

Performs a reset (reboot) operation on the managed server.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

module

The element to hard reset on the chassis such as a blade. If not provided, the chassis will be reset.

CLI Example:

salt dell dracr.server_hardreset
salt dell dracr.server_hardreset module=server-1
salt.modules.dracr.server_power(status, host=None, admin_username=None, admin_password=None, module=None)
status

One of 'powerup', 'powerdown', 'powercycle', 'hardreset', 'graceshutdown'

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

module

The element to reboot on the chassis such as a blade. If not provided, the chassis will be rebooted.

CLI Example:

salt dell dracr.server_reboot
salt dell dracr.server_reboot module=server-1
salt.modules.dracr.server_poweroff(host=None, admin_username=None, admin_password=None, module=None)

Powers down the managed server.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

module

The element to power off on the chassis such as a blade. If not provided, the chassis will be powered off.

CLI Example:

salt dell dracr.server_poweroff
salt dell dracr.server_poweroff module=server-1
salt.modules.dracr.server_poweron(host=None, admin_username=None, admin_password=None, module=None)

Powers up the managed server.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

module

The element to power on located on the chassis such as a blade. If not provided, the chassis will be powered on.

CLI Example:

salt dell dracr.server_poweron
salt dell dracr.server_poweron module=server-1
salt.modules.dracr.server_powerstatus(host=None, admin_username=None, admin_password=None, module=None)

return the power status for the passed module

CLI Example:

salt dell drac.server_powerstatus
salt.modules.dracr.server_pxe(host=None, admin_username=None, admin_password=None)

Configure server to PXE perform a one off PXE boot

CLI Example:

salt dell dracr.server_pxe
salt.modules.dracr.server_reboot(host=None, admin_username=None, admin_password=None, module=None)

Issues a power-cycle operation on the managed server. This action is similar to pressing the power button on the system's front panel to power down and then power up the system.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

module

The element to reboot on the chassis such as a blade. If not provided, the chassis will be rebooted.

CLI Example:

salt dell dracr.server_reboot
salt dell dracr.server_reboot module=server-1
salt.modules.dracr.set_chassis_datacenter(location, host=None, admin_username=None, admin_password=None)

Set the location of the chassis.

location

The name of the datacenter to be set on the chassis.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt '*' dracr.set_chassis_datacenter datacenter-name host=111.222.333.444
    admin_username=root admin_password=secret
salt.modules.dracr.set_chassis_location(location, host=None, admin_username=None, admin_password=None)

Set the location of the chassis.

location

The name of the location to be set on the chassis.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt '*' dracr.set_chassis_location location-name host=111.222.333.444
    admin_username=root admin_password=secret
salt.modules.dracr.set_chassis_name(name, host=None, admin_username=None, admin_password=None)

Set the name of the chassis.

name

The name to be set on the chassis.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt '*' dracr.set_chassis_name my-chassis host=111.222.333.444
    admin_username=root admin_password=secret
salt.modules.dracr.set_dns_dracname(name, host=None, admin_username=None, admin_password=None)
salt.modules.dracr.set_general(cfg_sec, cfg_var, val, host=None, admin_username=None, admin_password=None)
salt.modules.dracr.set_network(ip, netmask, gateway, host=None, admin_username=None, admin_password=None)

Configure Network on the CMC or individual iDRAC. Use set_niccfg for blade and switch addresses.

CLI Example:

salt dell dracr.set_network [DRAC IP] [NETMASK] [GATEWAY]
salt dell dracr.set_network 192.168.0.2 255.255.255.0 192.168.0.1
    admin_username=root admin_password=calvin host=192.168.1.1
salt.modules.dracr.set_niccfg(ip=None, netmask=None, gateway=None, dhcp=False, host=None, admin_username=None, admin_password=None, module=None)
salt.modules.dracr.set_nicvlan(vlan=None, host=None, admin_username=None, admin_password=None, module=None)
salt.modules.dracr.set_permissions(username, permissions, uid=None, host=None, admin_username=None, admin_password=None)

Configure users permissions

CLI Example:

salt dell dracr.set_permissions [USERNAME] [PRIVILEGES]
     [USER INDEX - optional]
salt dell dracr.set_permissions diana login,test_alerts,clear_logs 4
DRAC Privileges
  • login : Login to iDRAC

  • drac : Configure iDRAC

  • user_management : Configure Users

  • clear_logs : Clear Logs

  • server_control_commands : Execute Server Control Commands

  • console_redirection : Access Console Redirection

  • virtual_media : Access Virtual Media

  • test_alerts : Test Alerts

  • debug_commands : Execute Debug Commands

salt.modules.dracr.set_slotname(slot, name, host=None, admin_username=None, admin_password=None)

Set the name of a slot in a chassis.

slot

The slot number to change.

name

The name to set. Can only be 15 characters long.

host

The chassis host.

admin_username

The username used to access the chassis.

admin_password

The password used to access the chassis.

CLI Example:

salt '*' dracr.set_slotname 2 my-slotname host=111.222.333.444
    admin_username=root admin_password=secret
salt.modules.dracr.set_snmp(community, host=None, admin_username=None, admin_password=None)

Configure CMC or individual iDRAC SNMP community string. Use deploy_snmp for configuring chassis switch SNMP.

CLI Example:

salt dell dracr.set_snmp [COMMUNITY]
salt dell dracr.set_snmp public
salt.modules.dracr.syslog(server, enable=True, host=None, admin_username=None, admin_password=None, module=None)

Configure syslog remote logging, by default syslog will automatically be enabled if a server is specified. However, if you want to disable syslog you will need to specify a server followed by False

CLI Example:

salt dell dracr.syslog [SYSLOG IP] [ENABLE/DISABLE]
salt dell dracr.syslog 0.0.0.0 False
salt.modules.dracr.system_info(host=None, admin_username=None, admin_password=None, module=None)

Return System information

CLI Example:

salt dell dracr.system_info
salt.modules.dracr.update_firmware(filename, host=None, admin_username=None, admin_password=None)

Updates firmware using local firmware file

salt dell dracr.update_firmware firmware.exe

This executes the following command on your FX2 (using username and password stored in the pillar data)

racadm update –f firmware.exe -u user –p pass
salt.modules.dracr.update_firmware_nfs_or_cifs(filename, share, host=None, admin_username=None, admin_password=None)

Executes the following for CIFS (using username and password stored in the pillar data)

racadm update -f <updatefile> -u user –p pass -l //IP-Address/share

Or for NFS (using username and password stored in the pillar data)

racadm update -f <updatefile> -u user –p pass -l IP-address:/share

Salt command for CIFS:

salt dell dracr.update_firmware_nfs_or_cifs          firmware.exe //IP-Address/share

Salt command for NFS:

salt dell dracr.update_firmware_nfs_or_cifs          firmware.exe IP-address:/share