Power management of Bare Metal servers with Foreman

Power management of bare-metal servers is a new feature that comes with Foreman 1.2. You will need to have deployed Foreman and smart-proxy to 1.2 to enjoy this.
With that feature you will be able to provide a way to start, stop and reboot servers directly from Foreman’s Webinterface or from REST API.
This has been tested on DELL servers configuring DRAC/

Smart-proxy configuration

On your smart-proxy, you need:

* The rubyipmi gem installed

# gem install rubyipmi

* ipmitool installed:

# apt-get install ipmitool

Configuration in Foreman

You need to edit the host you want to manage with BMC:

  • Go on foreman/hosts/server.example.com/edit
  • Click on  Network tab
  • Click on ‘Add Interface’
  • Type = ‘BMC’
  • You need then to get the MAC address of your BMC interface. Connect to your server (server.example.com in my example) in ssh and then using ipmitool command :
# ipmitool lan print

Foreman will automaticaly add a DNS record and a DHCP lease for your interface.
However, there is a bug in 1.2.0 where Foreman doesn’t append correctly the domain to the name of the card (see the open bug ). As a woraround, you can set in Name field the FQDN of your interface name (ie: server-ipmi.example.com)

  • Eventualy choose a user/password then save.

IPMI configuration

On the server, you still need to configure it to allow Foreman to use it :
You can use the following ipmitool commands :

# ipmitool lan set 1 ipsrc dhcp
# ipmitool lan set 1 access on
# ipmitool user set name 3 your_user
# ipmitool user set password 3 your_password
# ipmitool channel setaccess 1 3 callin=on ipmi=on link=on privilege=4
# ipmitool user enable 3

How to use that feature

On the host page, if all went well, you should be able to manage from Foreman the power of the server :


A new feature to integrate more deeply Foreman with all your servers. Foreman is getting better and better !

  1. There’s a typo in the rubyipmi install command, it should be:

    # gem install rubyipmi

  2. Thanks for this tutorial. I am using Foreman 1.3.1. I had to do a few more steps, for details see my post to foreman-users at https://groups.google.com/d/msg/foreman-users/W8XOS5AYYSw/Wp4eRd9V_tMJ

  3. If some one wants to be updated with latest technologies afterward he must
    be go to see this web site and be up to date all the time.

  4. I get pleasure from, cause I discovered just what I was looking for. You have ended my four day long hunt! God Bless you man. Have a great day. Bye|

Leave a Comment