VMware {code} Community
sengork
Contributor
Contributor

Reliably determining Guest OS status

What would be a reliable way to determine (via API) whether the guest OS is ready to be used (ie. SSH running and no VM deployment related reboots pending).

I'm observing the following sequence of events for a linux guest OS, at each step VM and vApp API status = 4 "The object is powered on.":

- vApp and VM deployed & powered on

- Guest OS boots (and starts SSH server)

- VMware tools are installed/upgraded

- Guest OS reboots (and starts SSH server)

- Guest customisation script is executed

- Guest OS reboots (and starts SSH server)

The above sequence of events can take up to 2-10min to complete (depending on backend resourcing) whilst from an SSH client perspective the instance appears "ready" right after the 1st reboot. Should the SSH client connect at this stage, its work will be abruptly terminated by subsequent guest customisation reboots.

I realise the VM status is not representative of the guest OS status, but at least it'd be good to somehow query whether VMware tools have been deployed and are up and running as means of determining whether the guest OS has become "ready to be used". Ideally determining guest OS status would be event driven, rather than based on guestimate timeline...

[1] http://pubs.vmware.com/vcloud-api-1-5/api_prog/GUID-843BE3AD-5EF6-4442-B864-BCAE44A51867.html

Tags (1)
Reply
0 Kudos
1 Reply
lamw
Community Manager
Community Manager

You're definitely right that the VM status is not a representative state of when the VM is actually ready to be used and if you have a complex %post script, that could also add some additonal time and there is nothing in the vCloud API that provides details into the guestOS on when it is ready as it can be "ready" but still starting up other applications.

One way you could definitively tell when the system is ready is by simplifying using a %post script that would write out a "ready" file somewhere on the guestOS which you can then check from an external system. The process would be ensure that the status of all VMs within the vApp are poweredOn as a validation and then try to remotely connect to your systems and check whether this "ready" file is there to signify the system is ready for use.