Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer
Or, to add to #2, have a simple script that posts to Twitter or an internal 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

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.