vBMC, faux'ing bare-metal

vBMC, faux'ing bare-metal

VirtualBMC, or vBMC for short, is an excellent little tool which provides an IMPI interface to KVM virtual machines within libvirt. This tiny post will show how it can be setup as a service, which allows it to be started and stopped with the host machine.

Because vBMC is a python application, python is required; so make sure you have python installed. To install this service we're also going to need python3-virtualenv installed. For my setup I'll be running this on Fedora 30 Server Edition.

Lets Get Started

Install the python3-virtualenv package.

dnf install -y python3-virtualenv

Now create a virtual environment for the vBMC installation.

python3 -m virtualenv --system-site-packages --download /opt/vbmc

Now install vBMC.

/opt/vbmc/bin/pip install virtualbmc

With the application installed create a systemd service unit file to run vbmcd. The service unit file will be placed in /etc/systemd/system/vbmcd.service.

[Install]
WantedBy = multi-user.target

[Service]
BlockIOAccounting = True
CPUAccounting = True
ExecReload = /bin/kill -HUP $MAINPID
ExecStart = /opt/vbmc/bin/vbmcd --foreground
Group = root
MemoryAccounting = True
PrivateDevices = False
PrivateNetwork = False
PrivateTmp = False
PrivateUsers = False
Restart = on-failure
RestartSec = 2
Slice = vbmc.slice
TasksAccounting = True
TimeoutSec = 120
Type = simple
User = root

[Unit]
After = libvirtd.service
After = syslog.target
After = network.target
Description = vbmc service

Now reload the systemd daemon, enable vbmcd, and start it.

systemctl daemon-reload
systemctl enable vbmcd.service
systemctl start vbmcd.service

# Check the service is in fact running
systemctl status vbmcd.service

Once vbmcd has started run a simple command to ensure it's working.

# /opt/vbmc/bin/vbmc list
+------------------+---------+--------------+-------+
| Domain name      | Status  | Address      |  Port |
+------------------+---------+--------------+-------+
+------------------+---------+--------------+-------+

And that concludes the installation and service setup parts. Lets now enroll a VM so that we can use ipmi with it. To add a node into the vBMC you will need to know the domain name of the VM. In my case the domain name is node1. I'm also setting the port vBMC will listen on and the username & password for the vBMC connection.

/opt/vbmc/bin/vbmc add node1 --port 16001 \
                             --username admin \
                             --password secrete

Once added to vBMC make sure the node is started within vBMC.

/opt/vbmc/bin/vbmc start node1

Now validate that the node added and started is listed within vBMC.

/opt/vbmc/bin/vbmc list
+------------------+---------+--------------+-------+
| Domain name      | Status  | Address      |  Port |
+------------------+---------+--------------+-------+
| node1            | running | ::           | 16001 |
+------------------+---------+--------------+-------+

To validate this all works ipmitool will need to be installed on the local system. Within impi check the "power status" of the VM.

ipmitool -I lanplus -U admin -P secrete -H 127.0.0.1 -p 16001 power status
Chassis Power is off
Quick recap
  • vBMC installed
  • Setup systemd service for vBMC
  • Covered adding nodes to vBMC
  • Covered validating nodes that are connected to vBMC
  • Profit!

That's all folks.

I hope this quick and dirty post was useful. If this was at all helpful let me know, otherwise have a good one!

Mastodon