IPMI

From copec
Jump to: navigation, search

Setup

SuperMicro

SuperMicro has official documentation for their IPMI setup. Motherboard has to support IPMI. Preferably something >= version 2.0.

There is a problem with older IPMI firmwares where you can't get any LAN configuration to work. This is usually on firmwares older than 2.xx. Unfortunately, it appears that the only way you can update the firmware is via 32-bit Linux or rebooting into a DOS image.

If you download the SMCIPMITool from SuperMicro, you can check the version of and cold reboot the BMC. This helps sometimes as the BMC will fallback to one of the primary interfaces if there is nothing connected to the IPMI interface.

grub

Add the following lines on /etc/default/grub and then run update-grub:

GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --unit=1 --speed=152000 --stop=1"

Console

  • Note: This section needs updated for systemd.

Create an init script for getty on ttyS1 /etc/init/ttyS1.conf:

# ttyS1 - getty
#
# This service maintains a getty on ttyS1 from the point the system is
# started until it is shut down again.
# This works for setting up a kvm console that can be accessed via:
# virsh console (guest name)
#

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 115200 ttyS1 vt102

Start ttS1:

start ttyS1

ipmitool

Install ipmitool:

apt-get install ipmitool

Load the kernel modules:

modprobe ipmi_devintf
modprobe ipmi_msghandler
modprobe ipmi_si

Run the following as root on the server:

ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 10.13.(ip address)
ipmitool lan set 1 defgw ipaddr 10.13.0.1
ipmitool lan set 1 netmask 255.255.0.0
ipmitool lan set 1 vlan id off
ipmitool lan set 1 vlan priority 0
ipmitool lan set 1 arp generate on
ipmitool user set name 3 root
ipmitool user set password 3 (password)
ipmitool user enable 3
ipmitool user priv 3 4 1
ipmitool channel setaccess 1 3 callin=off ipmi=on link=off privilege=4
ipmitool user disable 1
ipmitool user disable 2
ipmitool user disable 4
ipmitool user disable 5
ipmitool sol payload enable 1 3
ipmitool sol set character-accumulate-level 12 1
ipmitool sol set character-send-threshold 1 1
ipmitool sol set retry-interval 50 1
ipmitool sol set enabled true 1
ipmitool sol set force-authentication true 1
ipmitool sol set force-encryption true 1
ipmitool sol set non-volatile-bit-rate 115.2 1
ipmitool sol set volatile-bit-rate 115.2 1
ipmitool sol set privilege-level admin 1
ipmitool sol set retry-count 7 1
ipmitool sol set retry-interval 100 1
ipmitool sol set set-in-progress commit-write 1
ipmitool sol set set-in-progress set-complete 1

Sometimes the lan settings will not be set properly. You may have to repeat some of the above. Verify with:

ipmitool lan print

LDAP

Finally use the ldadm tool on mrdb to add servername.ipmi with its IP address to LDAP.

Dell

Dell usually needs some configuration in the boot screens before loading. Make sure the BIOS (not in the IPMI configurator) console redirection is pointed to COM2 with 115200 speed.

Function Keys

Regular function keys don't work during IPMI sol console. You will need to use these key combinations:

Dell Serial Bios keyboard shortcuts
F1      <ESC>1
F2      <ESC>2
F3      <ESC>3
F4      <ESC>4
F5      <ESC>5
F6      <ESC>6
F7      <ESC>7
F8      <ESC>8
F9      <ESC>9
F10     <ESC>0
F11     <ESC>!
F12     <ESC>@
Home    <ESC>h
End     <ESC>k
Insert  <ESC>+
Delete  <ESC>-
PageUp  <ESC>?
PageDn  <ESC>/
Use the <ESC><Ctrl><M> key sequence for <Ctrl><M>
Use the <ESC><Ctrl><H> key sequence for <Ctrl><H>
Use the <ESC><Ctrl><I> key sequence for <Ctrl><I>
Use the <ESC><Ctrl><J> key sequence for <Ctrl><J>
Use the <ESC><X><X> key sequence for <Alt><x>, where x is any letter key, and X is the upper case of that key
Note: Use your keypad for the <ESC>n sequences!

Usage

To connect to the serial text console:

IPMI_PASSWORD=(password) ipmitool -H servername.ipmi -I lanplus -U root -E -C 3 sol activate

Before installation the Supermicro login/password is ADMIN/ADMIN. If you configure the IP address in the BIOS, then you can connect and install everything over IPMI.

IPMI_PASSWORD=ADMIN ipmitool -H 10.13.X.X -I lanplus -U ADMIN -E -C 3 sol activate

To print IPMI lan config:

IPMI_PASSWORD=(password) ipmitool -H servername.ipmi -I lan -U root -E lan print

For sensor info:

IPMI_PASSWORD=(password) ipmitool -H servername.ipmi -I lan -U root -E sensor

To see the power status:

IPMI_PASSWORD=(password) ipmitool -H servername.ipmi -I lan -U root -E power status

To shutdown via ACPI (like ctrl-alt-delete without the reboot):

IPMI_PASSWORD=(password) ipmitool -H servername.ipmi -I lan -U root -E power soft

To cycle the chassis power:

IPMI_PASSWORD=(password) ipmitool -H servername.ipmi -I lan -U root -E power cycle

To turn the chassis off:

IPMI_PASSWORD=(password) ipmitool -H servername.ipmi -I lan -U root -E power off

To turn the chassis on:

IPMI_PASSWORD=(password) ipmitool -H servername.ipmi -I lan -U root -E power on

Alternately, most SuperMicros have a Java-based/HTTP interface to IPMI which can be accessed via http://servername.ipmi/ with the same username and password as above.

Bash Routines

These make life much easier if you're using Bash.

ipmiconsole() {
  if [ ! $2 ]; then
      echo "Usage: ipmiconsole (host) (password)"
      return
  fi
  IPMI_PASSWORD=$2 ipmitool -H ${1}.ipmi -I lanplus -U root -E -C 3 sol activate
}
 
ipmishutdown() {
  if [ ! $2 ]; then
      echo "Usage: ipmishutdown (host) (password)"
      return
  fi
  IPMI_PASSWORD=$2 ipmitool -H ${1}.ipmi -I lan -U root -E power soft
}
 
ipmicycle() {
  if [ ! $2 ]; then
      echo "Usage: ipmicycle (host) (password)"
      return
  fi
  IPMI_PASSWORD=$2 ipmitool -H ${1}.ipmi -I lan -U root -E power cycle
}
 
ipmioff() {
  if [ ! $2 ]; then
      echo "Usage: ipmioff (host) (password)"
      return
  fi
  IPMI_PASSWORD=$2 ipmitool -H ${1}.ipmi -I lan -U root -E power off
}
 
ipmion() {
  if [ ! $2 ]; then
      echo "Usage: ipmion (host) (password)"
      return
  fi
  IPMI_PASSWORD=$2 ipmitool -H ${1}.ipmi -I lan -U root -E power on
}

Java Web Console

There is also a web interface you can go to, via http://servername.ipmi. You can then go to Remote Control -> Console Redirection and start a java app that will take you to the java-based "ikvm" console. While it's nicer to be able to use just use the serial console in a term like any other program, you can sometimes get more consistent results with the java console. It's also required in the unlikely chance you need to view a GUI via ipmi.

Fixing Problems with Java Web Console

Recently, I (Ram) have ran into two separate issues with the java console. On Linux, I've gotten an error "no iKVM64 in java.library.path", while on OS X, it seems to start but hangs within seconds of starting. Both issues were solved for me with the same solution.

Trying to start the web console downloads a file "launch.jnlp", which is then opened by "javaws" to start the console. If you edit the file, you will notice sections similar to this:

   <resources os="Linux" arch="x86">
     <nativelib href="liblinux_x86.jar" download="eager" version="1.0.3"/>
   </resources>
   <resources os="Linux" arch="x86_64">
     <nativelib href="liblinux_x86_64.jar" download="eager" version="1.0.3"/>
   </resources>
   <resources os="Linux" arch="amd64">
     <nativelib href="liblinux_x86_64.jar" download="eager" version="1.0.3"/>
   </resources> 
   <resources os="Mac OS X" arch="x86_64">
     <nativelib href="libmac_x86_64.jar" download="eager" version="1.0.3"/>
   </resources>


The fix is to add the following inside the resources tag for your operating system:

    <property name="jnlp.packEnabled" value="true"/>
    <property name="jnlp.versionEnabled" value="true"/>

So if you were on OS X, for example, it would look like this:

   <resources os="Mac OS X" arch="x86_64">
     <nativelib href="libmac_x86_64.jar" download="eager" version="1.0.3"/>
     <property name="jnlp.packEnabled" value="true"/>
     <property name="jnlp.versionEnabled" value="true"/>
   </resources>

After editing the file, you can start it via javaws, ie "javaws launch.jnlp". Since you're running the file directly, do pay attention to the fact that you may have downloaded the file previously, so your current instance might really be launch-1.jnlp, launch-2.jnlp, etc.

Note there are two different definitions for 64bit linux, x86_64 and amd64. It's not clear to me which you need to fill in under what circumstance, since they refer to the same overall architecture. The kernel might have switched to the x86_64 naming at some version, or... whatever. Fill them both out or experiment and update this wiki page.

I got the information about this fix from here: http://www.p14nd4.com/blog/2011/09/30/solved-no-ikvm64-in-java-library-path-on-supermicro-ip-kvm/

IPMIView

Supermicro makes a single Java program packaged with its target JRE that can view as well as edit all the IPMI parameters as well as access the proprietarded VNC of the actual console: ftp://ftp.supermicro.com/utility/IPMIView/

(The most recent specific version I used was ftp://ftp.supermicro.com/utility/IPMIView/Linux/IPMIView_2.13.1_build.171024_bundleJRE_Linux_x64.tar.gz )

Download and extract the tarball and then cd into the root of the extracted directory and execute:

copec@copesetic:~$ cd ipmi/IPMIView_V2.10.2_bundleJRE_Linux_x64_20150909/
copec@copesetic:~/ipmi/IPMIView_V2.10.2_bundleJRE_Linux_x64_20150909$ ./jre/bin/java -Djava.library.path=. -jar IPMIView20.jar

Xpra

I [copec] often use xpra that is part of winswitch to use the IPMIView tool.

Here is a session example between my workstation at home and my workstation at work.

  • On my work workstation after installing the xpra and winswitch [Debian] packages:
copec@copetacular:~$ tmux new-session -s xpra
copec@copetacular:~$ xpra start :9293
Entering daemon mode; any further errors will be reported to:
  /home/users/c/copec/.xpra/:9293.log
copec@copetacular:~$ export DISPLAY=:9293
copec@copetacular:~$ cd ipmi/IPMIView_V2.10.2_bundleJRE_Linux_x64_20150909/
copec@copetacular:~/ipmi/IPMIView_V2.10.2_bundleJRE_Linux_x64_20150909$ ./jre/bin/java -Djava.library.path=. -jar IPMIView20.jar
  • On my home workstation after installing the xpra and winswitch [Debian] packages:
copec@copesetic:~$ tmux new-session -s xpra
copec@copesetic:~$ xpra attach --dpi=96 --desktop-scaling=off --speaker=no --ssh="ssh -4" ssh:copetacular.xmission.com:9293
2018-02-12 12:14:37,136 Xpra gtk2 client version 0.17.6-r14322
2018-02-12 12:14:37,136  running on Linux Ubuntu 17.10 artful
2018-02-12 12:14:37,137 Warning: failed to import opencv:
2018-02-12 12:14:37,137  No module named cv2
2018-02-12 12:14:37,137  webcam forwarding is disabled
2018-02-12 12:14:37,457 GStreamer version 1.12 for Python 2.7
2018-02-12 12:14:37,510 Warning: csc_swscale failed its self test
2018-02-12 12:14:37,510  No module named numpy
2018-02-12 12:14:37,516 Warning: csc_cython failed its self test
2018-02-12 12:14:37,516  No module named numpy
2018-02-12 12:14:38,220 PyOpenGL warning: missing accelerate module
2018-02-12 12:14:38,270 keyboard layouts: us
2018-02-12 12:14:38,343  detected keyboard: rules=evdev, model=pc105, layout=us,us
2018-02-12 12:14:38,344  desktop size is 1920x1080 with 1 screen:
2018-02-12 12:14:38,345   :0.0 (508x285 mm - DPI: 96x96) workarea: 1920x1053 at 0x27
2018-02-12 12:14:38,345     monitor 1 (280x160 mm - DPI: 174x171)
2018-02-12 12:14:52,899 Xpra X11 server version 0.17.6-r14322
2018-02-12 12:14:52,901  running on Linux Ubuntu 17.10 artful
2018-02-12 12:14:52,901 enabled remote logging
2018-02-12 12:14:52,906 Attached to ssh:copetacular.xmission.com:9293 (press Control-C to detach)