Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

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 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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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.