3

I'm using XenServer as a host for disposable QA machines for our application development. I'd like to write a script that automatically creates a new VM from a template, starts it, logs into it, fetches the latest application build and deploys it.

What I'd like my script to do is install the VM using 'xe vm-install', start it using 'xe vm-start', wait until it's finished booting, SSH into it, then perform the app installation procedure.

Problem is, the 'xe vm-start' command does not block the shell. Meaning, the command returns before the machine has completely loaded.

Anyone knows if and how I can query Xen for the machine boot status?

Thanks

Electric Monk
  • 195
  • 3
  • 8

2 Answers2

4

There is no way to tell if your machine has finished starting the OS from outside... But there are two ways to solve this:

  1. Assume that your system is up and running when it finished loading a service (for example the sshd. Probe the system until this service is up and running).

  2. Add an install script to the client that is run once the client is done booting. Let the script pull down a shellscript from an external server an execute it.

pehrs
  • 8,749
  • 29
  • 46
  • Or, to add to #2, have a simple script that posts to Twitter or an internal laconic.ca microblog so that everyone can see the server say "I just started up." Very simple, very handy. – Scott Alan Miller Jan 21 '10 at 18:00
0

Worth looking into using xen-tools and created a custom role for grabbing/installing packages