Reboot Guest OS on vSphere VM and wait

VMware vRealize Orchestrator action sample
Reboots a vSphere VM and waits for the guest OS to be
back on the network

Requires VMtools to be functional in the guest OS.


Sign in to be able to add comments.

Comments 3


1974065885 3 years ago
So i have added this to our VRA and it does reboot the server but it never seems to see it when it comes back up. The VM does have current VM tools.

Here is debug from VRA with the VM name redacted..... any help is welcomed...... vro 7.3.0.5481809 and vsphere 6.5.0.13000

[2018-07-10 07:09:36.057] [I] Rebooting vm 'xxxxxx'
[2018-07-10 07:09:36.060] [I] Waiting for upto 5 minutes for VMtools to stop...
[2018-07-10 07:09:36.061] [I] VM = 'xxxxx', Tools Status = 'toolsOk'
[2018-07-10 07:14:36.156] [E] (bok.systemadmin.get vm tag/BOKFSysAdminRebootGuestVM) Error in (Dynamic Script Module name : BOKFSysAdminRebootGuestVM#51) Timed out! Host 'xxxxxx' is still not running after 5 minutes!
[2018-07-10 07:14:36.167] [E] Workflow execution stack:
***
item: 'xxxxx - Reboot Guest/item1', state: 'failed', business state: 'null', exception: 'Timed out! Host 'xxxxx' is still not running after 5 minutes! (Dynamic Script Module name : BOKFSysAdminRebootGuestVM#51)'
workflow: xxxxxx - Reboot Guest' (4616bf36-6ac2-4b41-b52b-2975593e6fad)
| 'attribute': name=vm type=VC:VirtualMachine value=dunes://service.dunes.ch/CustomSDKObject?id='xxxxxxxx.bok.com%2Cid:vm-958'&dunesName='VC:VirtualMachine'
| 'attribute': name=guestRebootTimeoutMinutes type=string value=5
| 'no inputs'
| 'no outputs'
*** End of execution stack.
5441220246 2 years ago
Hi Jeffrey, did you ever get any feedback or help with this post?
I ask because I am looking into setting up scheduled server reboots and I am not sure whether this is going to be done from vRA or vRO via the task scheduler.
sadlekj 9 months ago
Made some updates to this code: https://code.vmware.com/samples?id=7540