Linux Task Execution Automation

Posted March 18, 2008 by miked
Categories: automation, linux, technology

Tags: , , , ,

We have a set of 11 linux servers that function as our VMware hosts. While these systems are not necessarily all the same hardware, they need to look identical as it relates to software and kernel versions. I’ve been working on system to automate the tasks done on these machines. What I’ve come up with has so far and will work pretty well.

On each host there is a simple script, which runs every 5 minutes, that grabs another script from a central location. The script sleeps for a random amount of time (to keep load down on the MySQL server), checks a database for tasks to run, compares the id of the tasks against a local file with tasks already run, if it hasn’t run them, it runs them.

The database is really simple. It consists of one table with three columns: id, task to run, and a timestamp (possible future functionality). When a task is added to the database, it is executed within 5 minutes on all 11 hosts. I’ve included the scripts below.

Simple host script connectcontrol.py

Centrally stored control script controlscript.py

VMware Automation Part 2

Posted March 15, 2008 by miked
Categories: VMware, automation, linux, technology

Tags: , , , , ,

Eureka! I found it. So now I can automate the vmware-config.pl part of the installation. It turns out that VMware Server keeps a database of sorts in /etc/vmware/locations. This is created during the vmware-install.pl run. If you append “answer EULA_AGREED yes” (without the quotes) to the locations file, it will not present you with the EULA. Here is the complete code. Again, please comment.

vmwareInstall.txt (revised)

VMware Automation

Posted March 14, 2008 by miked
Categories: VMware, automation, linux, technology

Tags: , , , , ,

I’ve been looking around the net to find a way to automate a VMware Server install on Linux. In the documentation there is a way to automate the install for Windows, but not Linux. In our environment, we run a minimal Ubuntu 7.10 install for our hosts. Below is my hackish attempt to automate it. This works for our environment but I make no claims it will work for yours. The first script (hostprep-distrib.txt) installs the packages and sets a couple variables that are important to us. The second script (vmwareInstall.txt) handles the vmware-install.pl portion automatically, but hands the vmware-config.pl over to the user. I welcome any comments as I know that there is a better way to do this.

Beginning the Journey

Posted March 13, 2008 by miked
Categories: Uncategorized

Tags: ,

My name is Mike and I’m a Sys Admin for a local university in Western Washington. I decided to start this blog to chronicle the everyday issues and problems I face during the work day. I am a self taught system administrator primarily responsible for supporting the email environment for the university. I am a troubleshooter at heart so while my method’s may not be traditional in approach, my goal is always to get to the base issues of a problem and get them solved.

My hope is that the issues I face will resonate with you and that I can hopefully find some resolutions that might help you with your work/hobby. Please feel free to comment and point out things that you don’t agree with or might do better. I’m not a coder so many of my programming methods may make you scratch your head. I thank you for reading and enjoy.

Thus begins the journey…