this function depends on the vmrun command since...

4 views
Skip to first unread message

ronaldlw

unread,
Jul 27, 2009, 4:38:29 PM7/27/09
to vmsbackup
function suspendvm {
# this function depends on the vmrun command since it's the only that
waits
# for the completion of the requested operation
# if someone knows a way to wait for the suspend by using vmware-vim-
cmd vmsvc/power.suspend
# PLEASE TELL ME HOW!

http://lists.linux-ha.org/pipermail/linux-ha-dev/2008-July/015852.html

this shows how you can use the vmware-vim-cmd to suspend and then wait
until it is suspended to continue by polling the actual machine
status.

Hope this helps,
Ron

Par_Tojkander

unread,
Jul 28, 2009, 3:39:25 AM7/28/09
to vmsbackup
I wrote about this in another thread, here's a quote:

-----
One command to get the guest state (and more) is "vmsvc/get.guest",
perhaps that could be used, i.e:

vmware-vim-cmd -U user -P passwd vmsvc/get.guest $VMID | grep
guestState | awk '{print $3}' | sed s/[\",]//g

As long as the suspend command is working, the above command will
return "running". When the suspend is complete, it will return
"notRunning".
-----

I'll create a request in the issue tracker.

/ Pär
Reply all
Reply to author
Forward
0 new messages