0
votes

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?

1
Are vmtools part of your image?Vano
Yes, vmtools is part of the image.Suresh Jaganathan

1 Answers

2
votes

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: