Manage your XenServer pool with RES Automation Manager 2012

By | February 9, 2012

For those XenServer administrators who don’t know what RES Automation Manager is, it’s a task automation tool which makes it possible to run almost any command on managed computers with an agent. You can create runbooks with multiple commands or install software remotely unattended. With the release of RES Automation Manager 2012, Linux is now also supported as a platform to install agents on. This makes it possible to manage XenServer from RES AM. Where you previously used bash scripts and the cron scheduler, you can now put those commands in RES AM and schedule them. For example you can create a runbook to stop a vm on a schedule, export the vm for backup purpose and after that start the vm. Multiple triggers are possible. When you look to my previous post, you can schedule a vApp to start after every reboot of the XenServer host.

Installation is easy. These steps assume you already have RES AM running on a server. I will describe the installation and configuration of the agent on XenServer 6.0. When you have a XenServer pool, you only need to install the agent on one host only if you want to manage VMs. Every host in a pool can run XenServer XE commands. This is not necessarily the pool master. Only when you want to manage the hosts itself, e.g. reboot the host, you have to install the agent on every host node.

  • Download the RES AM Linux software from the RES site.
  • This is a tgz file which contains multiple agents for different Linux versions. It was not clear for me which version to use on XenServer. When you run the command “cat /proc/version” on your XenServer 6.0, you will find Red Hat 4.1.2-48. But the RedHat 4 version of RES AM Agent is not working. So I tried the others until one was successful. This was the RedHat Release 5 version.
  • Extract res-am-6.5-0.89780.tgz\res-am-6.5-0.89780.tar\RedHat\Release5\i386\res-am-agent-6.5-0.89780.i386.rpm with 7-Zip or other tool.
  • Upload the rpm to the XenServer with WinSCP in the /root dir.
  • Log on to XenServer with PuTTY
  • Change the working directory to the /root dir with the command: cd /root
  • Install the RPM with the command: rpm -ivh res-am-agent-6.5-0.89780.i386.rpm
  • Configure the agent to start automatically with: chkconfig –add resamad
  • This can be toggled with: chkconfig resamad off or chkconfig resamad on
  • Change the working dir with: cd /usr/local/bin
  • Configure the agent with: ./resamad –dd<IP of RES server> (No spaces between dd and IP address)
  • The command will show the available RES AM environments, e.g.:
    1. IT-Concern
    2. Other
  • Enter value for your environment: 1
  • The agent will register itself and will be visible in the RES AM console

  • You can start and stop the agent with the following commands:
    • /etc/init.d/resamad stop
    • /etc/init.d/resamad start
  • When you want to remove the agent from the XenServer use the following command: rpm -ev res-am-agent-6.5-0.89780.i386 (please note, no rpm after package name)

So now we have the agent running. Let’s take a look in the RES AM console. When we look at licensing, it seems that a Linux server consumes 4 licenses, just like a Windows server.

We also have Linux commands now in the RES AM console under tasks:

Let’s create some tasks. I will use a simple task to test functionality; start a vm.

Under Modules I created a new folder, called XenServer, to put my XenServer tasks in it. Then create a New Module:

Under Tasks, Add a Linux Command. We add a simple XE vm-start command:

As you can see, you can also add complete bash scripts on the Scripts tab. Click OK

Now schedule the job:

You will see in a few seconds the VM is started. Above is a very simple example, but almost everything for which you now have created bash scripts and used the cron scheduler, you can put in RES AM. And costs will be limited, only 4 licenses for you entire XenServer pool (when you only want to manage VMs). This will only cost you about 32,- Euro per XenServer with current list price. So go ahead and start using RES Automation Manager 2012 to manage your XenServer pool.