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
There is no way to tell if your machine has finished starting the OS from outside... But there are two ways to solve this:
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).
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.
Worth looking into using xen-tools and created a custom role for grabbing/installing packages