I recently had the opportunity to repurpose some Dell hardware at work, PowerEdge R510s. I would like to run the latest Ubuntu server 22.04 however Dell does not currently support OpenManage on 22.04. If there was a problem with the hardware I would have to be in the datacenter and notice an amber light. I’m too lazy for that.

So I had the idea to run OpenManage in a priviledged container with a supported OS as the base.

I started with Ubuntu 20.04 since that’s what I’m running elsewhere and I already have the OpenManage installer scripted. Here’s the script.


#!/bin/bash

echo 'deb http://linux.dell.com/repo/community/openmanage/10200/focal focal main' > /etc/apt/sources.list.d/linux.dell.com.sources.list
gpg --keyserver keyserver.ubuntu.com --recv-key 1285491434D8786F
gpg -a --export 1285491434D8786F | apt-key add -
apt-get update

apt-get install -y srvadmin-all

Naturally when I tried to install this, it didn’t work. So I chased down all the obvious dependencies that apt complained about. Then the not so obvious dependencies on post install and through trial and error. There were some post install scripts that I decided to ignore. And since the installer fails naturally I had to to override the docker RUN return code using || true. After all that I have a working Dockerfile.


FROM ubuntu:20.04

RUN apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates gnupg systemctl libxml-libxslt-perl tini

RUN echo 'deb http://linux.dell.com/repo/community/openmanage/10200/focal focal main' > /etc/apt/sources.list.d/linux.dell.com.sources.list && \
  gpg --keyserver keyserver.ubuntu.com --recv-key 1285491434D8786F && \
  gpg -a --export 1285491434D8786F | apt-key add - && \
  apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y srvadmin-all || true

RUN rm /var/lib/dpkg/info/srvadmin-hapi.postinst && \
  touch /var/lib/dpkg/info/srvadmin-hapi.postinst && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y srvadmin-all || true

RUN rm /var/lib/dpkg/info/srvadmin-idracadm7.postinst && \
  touch /var/lib/dpkg/info/srvadmin-idracadm7.postinst && \
  rm /var/lib/dpkg/info/srvadmin-idracadm8.postinst && \
  touch /var/lib/dpkg/info/srvadmin-idracadm8.postinst && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y srvadmin-all || true

Now to make a startup script. I’ll need a username and password to login to OpenManage. It may be possible to mount /etc/passwd and /etc/shadow but I would rather just generate a random password.

I prefer containers that log activity but OpenManage logs are a hot mess. I have no idea what to do with these. So I decided to tail all logs in the log directory.

Now I have a decent entrypoint script.


#!/bin/bash

if [ ! "${ROOT_PASSWORD}" ]
then
  ROOT_PASSWORD=$(tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null)
fi

echo "root:${ROOT_PASSWORD}" | chpasswd

echo Starting...

systemctl start dsm_om_connsvc
systemctl start dsm_sa_snmpd
systemctl start dsm_sa_datamgrd
systemctl start dsm_sa_eventmgrd

echo
echo ===========================================================================
echo
echo OpenManage Login: "root:${ROOT_PASSWORD}"
echo
echo ===========================================================================
echo

tail -n 0 -f $(find /opt/dell/srvadmin/var/log -type f)

All that’s left to do is build it, push it, and run it wherever I need OpenManage.


docker run -d --privileged --net=host --uts=host --restart=unless-stopped --name=openmanage nickadam/openmanage

Using --net=host is a simple way of avoiding explicitly exposing the container’s services to the host. Any process listener running in the container will be availible on the host just like if it wasn’t running in a container.

Check it out!

Source: https://github.com/nickadam/openmanage

Docker: https://hub.docker.com/r/nickadam/openmanage

So… Now with all this done and working to my satisfaction the time has come for the real lesson. It dawns on me that I didn’t check to see if anyone else has already done this. A search of docker hub reveals some very popular and very old images. Not too surprising. But there is one image that is recent. I checked it out and the Dockerfile is a lot cleaner than mine and it has better environment options. So feel free to check this one out as well. I’m going to continue using mine because now I’m emotionally attached to it. My sweet little supurflous creation.

Take this as a lesson children. Research a little before you start heavy on a new project.

Check out this better image from ShanceMcC!

Source: https://github.com/ShaneMcC/docker-omsa

Docker: https://hub.docker.com/r/shanemcc/docker-omsa