Posts Tagged: ‘ipmi’

Managing servers using IPMI

September 4, 2012 Posted by admin

This Howto covers enabling IPMI from a running node. Note this howto works only for Centos 5.4 enabled nodes. Some might work on gentoo nodes providing if they have ipmi support enabled in the kernel. Having ipmi support in the kernel allows you to talk directly to the ipmi card without using a user name and password (could be used for a monitoring script)

An ipmi enabled kernel should have these 2 modules

ipmi_si
ipmi_devintf
To load the modules run the following commands

modprobe ipmi_si
modprobe ipmi_devintf

dmidecode is a linux package that allows you to probe the system bios. In this example we are only intrested to see if it has an ipmi card onboard

infra:~# dmidecode –type 38
# dmidecode 2.8
SMBIOS 2.5 present.

Handle 0x2600, DMI type 38, 18 bytes
IPMI Device Information
Interface Type: KCS (Keyboard Control Style)
Specification Version: 2.0
I2C Slave Address: 0x10
NV Storage Device: Not Present
Base Address: 0x0000000000000CA8 (I/O)
Register Spacing: 32-bit Boundaries
To install ipmi on Centos 5.4

yum install OpenIPMI.x86_64 OpenIPMI-tools.x86_64

Using ipmitool we can get HW chassis information

infra:~# 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 : command
Chassis Intrusion : inactive
Front-Panel Lockout : inactive
Drive Fault : false
Cooling/Fan Fault : false
Sleep Button Disable : not allowed
Diag Button Disable : allowed
Reset Button Disable : not allowed
Power Button Disable : allowed
Sleep Button Disabled: false
Diag Button Disabled : true
Reset Button Disabled: false
Power Button Disabled: true

The command can be used to power on, off and soft reset a node. Note be careful when running the following commands

ipmitool chassis power on
ipmitool chassis power off
ipmitool chassis power soft

To view sensory info such as Temp, Voltage and Fan speed run the following command

[root@node219004 ~]# ipmitool sensor

CPU1 Temp | 0.000 | unspecified | ok | na | na | na | na | na | na
CPU2 Temp | 0.000 | unspecified | ok | na | na | na | na | na | na
System Temp | 27.000 | degrees C | ok | 0.000 | 0.000 | 0.000 | 81.000 | 82.000 | 83.000
CPU1 Vcore | 0.936 | Volts | ok | 0.808 | 0.816 | 0.824 | 1.384 | 1.392 | 1.400
CPU2 Vcore | 0.872 | Volts | ok | 0.808 | 0.816 | 0.824 | 1.384 | 1.392 | 1.400
+5V | 5.080 | Volts | ok | 4.280 | 4.320 | 4.360 | 5.240 | 5.280 | 5.320
+12V | 12.288 | Volts | ok | 10.464 | 10.560 | 10.656 | 13.344 | 13.440 | 13.536
CPU1DIMM | 1.544 | Volts | ok | 1.320 | 1.328 | 1.336 | 1.656 | 1.664 | 1.672
CPU2DIMM | 1.544 | Volts | ok | 1.320 | 1.328 | 1.336 | 1.656 | 1.664 | 1.672
+1.5V | 1.520 | Volts | ok | 1.320 | 1.328 | 1.336 | 1.656 | 1.664 | 1.672
+3.3V | 3.240 | Volts | ok | 2.880 | 2.904 | 2.928 | 3.648 | 3.672 | 3.696
+3.3VSB | 3.360 | Volts | ok | 2.880 | 2.904 | 2.928 | 3.648 | 3.672 | 3.696
VBAT | 3.360 | Volts | ok | 2.880 | 2.904 | 2.928 | 3.648 | 3.672 | 3.696
Fan1 | 9384.000 | RPM | ok | 340.000 | 408.000 | 476.000 | 17204.000 | 17272.000 | 17340.000
Fan2 | 9384.000 | RPM | ok | 340.000 | 408.000 | 476.000 | 17204.000 | 17272.000 | 17340.000
Fan3 | na | RPM | na | 340.000 | 408.000 | 476.000 | 17204.000 | 17272.000 | 17340.000
Fan4 | na | RPM | na | 340.000 | 408.000 | 476.000 | 17204.000 | 17272.000 | 17340.000
PS Status | 0.000 | unspecified | ok | na | na | na | na | na | na
To view the ip and mac addresss that are assigned to the ipmi card. This info could be used to register the ipmi with genesis

[root@node219004 ~]# ipmitool lan print 1
Set in Progress : Set Complete
Auth Type Support : NONE MD2 MD5 OEM
Auth Type Enable : Callback : NONE MD2 MD5 OEM
: User : NONE MD2 MD5 OEM
: Operator : NONE MD2 MD5 OEM
: Admin : NONE MD2 MD5 OEM
: OEM :
IP Address Source : DHCP Address
IP Address : 10.239.219.164
Subnet Mask : 255.255.255.0
MAC Address : 00:30:48:c9:8b:1f
SNMP Community String : AMI
IP Header : TTL=0x00 Flags=0x00 Precedence=0x00 TOS=0x00
BMC ARP Control : ARP Responses Disabled, Gratuitous ARP Disabled
Gratituous ARP Intrvl : 0.0 seconds
Default Gateway IP : 10.239.219.254
Default Gateway MAC : 00:00:00:00:00:00
Backup Gateway IP : 0.0.0.0
Backup Gateway MAC : 00:00:00:00:00:00
802.1q VLAN ID : Disabled
802.1q VLAN Priority : 0
RMCP+ Cipher Suites : 1,2,3,6,7,8,11,12,0
Cipher Suite Priv Max : aaaaXXaaaXXaaXX
: X=Cipher Suite Unused
: c=CALLBACK
: u=USER
: o=OPERATOR
: a=ADMIN
: O=OEM

[root@node219004 ~]# ipmitool lan print 2
Channel 2 is not a LAN channel

To set a static ip address you would run these commands but in our case we use genesis to asign dhcp ip’s based on mac address

[root@node219004 ~]# ipmitool lan set 1 ipsrc static
[root@node219004 ~]# ipmitool lan set 1 ipaddr 10.239.219.164
Setting LAN IP Address to 10.239.219.164
[root@node219004 ~]# ipmitool lan set 1 netmask 255.255.255.0
Setting LAN Subnet Mask to 255.255.255.0
[root@node219004 ~]# ipmitool lan set 1 defgw ipaddr 10.239.219.254
Setting LAN Default Gateway IP to 10.239.219.254

To Create an IPMI user

infra:~# ipmitool lan set 1 user
infra:~# ipmitool lan set 1 password password
Password set for user 1
infra:~# ipmitool lan set 1 auth callback,user,operator,admin md2,md5
infra:~# ipmitool lan set 1 access on

You can also run ipmi commands against a remote host if you know the creds and ipaddress

[root@node219005 ~]# IPMI_PASSWORD=password ipmitool -E -I lan -H 10.239.219.164 -U root chassis status
System Power : on
Power Overload : false
Power Interlock : inactive

To enable the serial console to output to the IPMI console add these lines to the genesis pxe config on the APPEND line

console=ttyS1,57600 console=tty0

You will need to update the inittab in the image in order to output to the serial port. You would want to enable this if you don’t have the ipmiviewer

/etc/inittab
T0:23:respawn:/sbin/getty -L ttyS1 57600 vt100

You might also have to enable the serial port in the securetty file
Edit /etc/securetty to enable terminal
ttyS1

To Activate the serial port run this comand
[root@node219005 ~]#IPMI_PASSWORD=password ipmitool -E -I lanplus -H 10.239.219.164 -U root sol activate
Info: SOL payload already active on another session
To start the ipmi service

infra:~# /etc/init.d/ipmievd restart