VMware {code} Community
beckhamk
Enthusiast
Enthusiast
Jump to solution

Is VM running after reboot?

What is the suggested proper way to determine is a VM is running after issuing a reboot power operation?

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

If you're using the RebootVM_Task() you'll be able to monitor when the task has completed. Then you'll want to query the powerState of the VM and you can probably monitor the bootTime value which how uptime is computed on the vSphere Client under the "Virtual Machines" tab. This should then let you know when the system is running. The other thing you could do versus doing a loop or sleep is to check for the VMware Tools status or guest info such as IP Address as that won't be available until the OS has booted up and VMware Tools service is running. So there's a few ways and all of which can be checked using the vSphere APIs

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
2 Replies
lamw
Community Manager
Community Manager
Jump to solution

If you're using the RebootVM_Task() you'll be able to monitor when the task has completed. Then you'll want to query the powerState of the VM and you can probably monitor the bootTime value which how uptime is computed on the vSphere Client under the "Virtual Machines" tab. This should then let you know when the system is running. The other thing you could do versus doing a loop or sleep is to check for the VMware Tools status or guest info such as IP Address as that won't be available until the OS has booted up and VMware Tools service is running. So there's a few ways and all of which can be checked using the vSphere APIs

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
dmitrif
Enthusiast
Enthusiast
Jump to solution

If you have the VMware Tools isntalled then virtulal-machine.guest.guestState.

If you don't have the VMware Tools IMHO there is no reliable way to tell whether the guest operating system is up and running.

D.