Deploying OMS for Docker via Rancher

Today we’ll be deploying Microsoft Operations Management Suite (OMS) for Docker via Rancher… Sound cool? It is! Basically we’re going to do the following guide and add Rancher to the twist.

For those unfamiliar with the Microsoft offering and more knowledgeable ย in the OSS community. Imaging OMS as being the Microsoft counterpart of a typical ELK stack. The advantage is that it’s managed and that there are already a lot of integrations possible.

Preparing the host
The host I used is an Ubuntu 16.04 (Xenial). So we’ll need to follow the systemd part… So go to the following file (/etc/systemd/system/ and update the highlighted lines

root@docker02:/etc/systemd# cat /etc/systemd/system/
Description=Docker Application Container Engine
Documentation= docker.socket

# OMS added :
Environment="DOCKER_OPTS=--log-driver=fluentd --log-opt fluentd-address=localhost:25225"
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
# set delegate yes so that systemd does not reset the cgroups of docker containers
# kill only the docker process, not all processes in the cgroup


Once that’s been done, reload systemd and restart the docker.service

root@docker02:/etc/systemd# systemctl daemon-reload
root@docker02:/etc/systemd# systemctl restart docker.service

Deploying the OMS agent via Rancher
To deploy the agent, use the following docker-compose file ;

    WSID: <your workspace id>
    KEY: <your key>
  labels: 'true'
    io.rancher.container.pull_image: always
    io.rancher.scheduler.affinity:host_label: deployoms=true
    io.rancher.container.hostname_override: container_name
  tty: true
  image: microsoft/oms
  privileged: true
  - /var/run/docker.sock:/var/run/docker.sock
  stdin_open: true

(Sidenote ; Remove the scheduler.affinity if you do not want to use a certain label… The above docker-compose will launch OMS on -all- hosts with the label “deployoms” set to “true”)

After a few seconds/minutes it’ll be started…


And you can see from the shell that it’s doing -something- ๐Ÿ™‚


Let’s check the footprint… It’s about 36MiB, which is kinda fair for what it does.



Validation in OMS

And yes, we can see our data in OMS ;


One improvement, as you might have noticed… I’m using the container name as hostname for OMS. Which doesn’t make it easy to map a hostname to the container. That’s definitely something to improve, though it was a bit out-of-scope for my brief 5″ PoC. ๐Ÿ˜‰

2 thoughts on “Deploying OMS for Docker via Rancher

  1. I would suggest to clarify what “ELK stack” refers to – not everyone is familiar with this acronym. By the way, the first link in the post assumes that your English-speaking readers, like me, are also fluent in Dutch. I wish it was true… ๐Ÿ˜‰

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.