Power cycling your system

The IPMItool chassis command can be used to obtain information and the status of a system locally or remotely.

In the test environment, running ipmitool chassis status command returned the following results:

# ipmitool chassis status
System Power          : on
Power Overload        : false
Power Interlock       : inactive
Main Power Fault      : false
Power Control Fault   : false
Power Restore Policy  : always-off
Last Power Event      : 
Chassis Intrusion     : inactive
Front-Panel Lockout   : inactive
Drive Fault           : false
Cooling/Fan Fault     : false

You can use the IPMItool on a second server (it does not need to have IPMI hardware) to display the chassis status of your first IPMI server by accessing the BMC LAN interface. To complete this task, you must know the BMC IP address and the user ID and password for the remote BMC's LAN channel. To determine the BMC IP address of the remote IPMI server, run the ipmitool lan print command in the remote server.

# ipmitool lan print | grep "IP Address " 
IP Address       : 192.168.0.3

To view the chassis status from a remote server, run the following command. Use your BMC IP address for the -H parameter:

# ipmitool -I lan -H 192.168.0.3 -U <User ID> -a chassis status
Note: You must use the -I option for specific use of the LAN channel. The -U option parameter is the userid name. The -a option indicates to prompt for password. You can use -f <filename> to get the password from a file or you can use -P <password> to include the password on the command line.

If the command returns successfully, you can remotely power cycle your system. Be careful with this command as you might have to physically locate the machine and manually start the system back on if the operation fails:

# ipmitool -I lan -H 192.168.0.3 -U <User ID> -a chassis power cycle 

System Power          : on 
Power Overload        : false 
Power Interlock       : inactive 
Main Power Fault      : false 
Power Control Fault   : false 
Power Restore Policy  : always-off 
Last Power Event      : 
Chassis Intrusion     : inactive 
Front-Panel Lockout   : inactive 
Drive Fault           : false 
Cooling/Fan Fault     : false

You can use the ipmitool chassis policy command to determine what the system does when the system experiences a power loss (and after the power is restored).
# ipmitool chassis policy <state> 

list        : return supported policies
always-on   : power on the system after the power is restored
previous    : return to the previous power state after power is restored
always-off  : leave the system powered off after power is restored

For example, if the system experiences a power loss, you can restore the system to the previous state that the system was last in (and after power is restored) by running the following command:

# ipmitool -I lanplus -U <bmcUserID> -P <bmcPW> -H <bmcIP> chassis policy previous
Note: You must use the -I option for specific use of the LAN channel. Use your BMC IP address for the -H parameter. The -U option parameter is the bmcuserid name.