I have created VM using pyvmomi module and made it to boot from ISO. Once the vm is powered on, the VM will be booting from ISO. How to check the status whether the VM is booted or not?
Asked
Active
Viewed 3,790 times
0
-
Are vmtools part of your image? – Vano Apr 12 '16 at 19:57
-
Yes, vmtools is part of the image. – Suresh Jaganathan Apr 15 '16 at 02:46
1 Answers
2
I check if the VM is running and if the status of the VMTools is 'toolsOk' (meaning they are installed and running).
from pyVmomi import vim
#...
# connect and get your vm
#...
vm_running = False
if (vm.runtime.powerstate == vim.VirtualMachinePowerState.poweredOn) and (vm.guest.toolsStatus == vim.vm.GuestInfo.ToolsStatus.toolsOk):
vm_running = True
#...
Further reading:

Daniel
- 897
- 6
- 11