Hello,
as many others before I need to have a method to reboot or shutdown the guest from the API. There are alternatives but all of them have some rougth edges that cannot be avoided so would be much better to have a method from the API.
I've seen that at 2008 this was planned to be implemented. What has happened with it? Will it be implemented in any version?
Thanks for your answers.
As of VIX 1.10.2, there is an API available to shutdown a guest:
VixHandle VixVM_PowerOff(VixHandle vmHandle, VixVMPowerOpOptions powerOffOptions, VixEventProc *callbackProc, void *clientData);This function powers off a virtual machine.
I don't think there is a supported function to restart a VM using VIX api.
The function VixVM_Reset will reboot a virtual machine. (VixVM_Reset in C, VMReset in Perl, and vm::Reset in COM).
http://www.vmware.com/support/developer/vix-api/vix110_reference/lang/c/functions/VixVM_Reset.html
VixVM_Reset
VixHandle VixVM_Reset(VixHandle vmHandle, VixVMPowerOpOptions powerOnOptions, VixEventProc *callbackProc, void *clientData);
This function resets a virtual machine.
Note that this can either be a hard reset ( VIX_VMPOWEROP_NORMAL, reboot at virtual hardware level) or a soft reset ( VIX_VMPOWEROP_FROM_GUEST, which does a "resart" in the guest operating system, and requires VMware Tools to be running in the guest.)
Hope that helps,
Matt
Sorry if my explanation was not good enough, I'm talking about rebooting or shutting down the guest SO, not the virtual machine. I mean, I want to do a SO power off no a hardware power off, of course.
Calling VixVM_Reset with the option VIX_VMPOWEROP_FROM_GUEST will perform a soft restart triggered from within the guest OS.
--Matt
Thanks for the information. The problem that I face now is that some guests work fine with this call while others hang when calling the wait handle and the wait never returns. Any idea?
I am seeing the same thing. Sometimes it works, sometimes it doesn't. I tried VixJob_Wait, VixJob_Completion and a callback procedure... none of them work reliably.
I also posted about another bug in the VIX API and funky power states that are being returned. I guess one has to pay for the developer support to really get help here.
I agree but we won't pay anymore, we already have a bunch of licenses for something that does not works accurately. We're trying to switch from VIX to vmrun and if that does not work we will switch to Virtual PC.
See this related post: http://communities.vmware.com/message/1848652
"I am experiencing the same issue... Windows XP x86...
It seems that I do not experience this behavior if the guest OS is Windows XP Professional x86 Service Pack 2."