PowerOff method

Jul 15, 2009 at 8:43 AM

in the documentation it says that the PowerOff method can take two parameters, one for powerOffOptions and one for timeoutInSeconds, both being numbers.

public void PowerOff(	int powerOffOptions,	int timeoutInSeconds)

The timeout works fine on its own but I've had no joy figuring out what the powerOffOptions are that can be passed?


thanks again

Jul 15, 2009 at 12:59 PM

Since VMWareTasks is just a wrapper, this calls PowerOff synchronously. The options are documented here.

Jul 16, 2009 at 9:18 AM

not sure i'm following, (dont forget im a beginner :)  i thought the virtualMachine.PowerOff() is looking for two Int's as parameters?  how does VixCOM.Constants.VIX_VMPOWEROP_FROM_GUEST fit in.

thanks again for the guidance

Jul 16, 2009 at 1:17 PM

The first one is VixCOM.Constants.VIX_VMPOWEROP_FROM_GUEST, the second one is a timeout. VMWareTasks is synchronous and the timeout is the longest time in seconds that you want to give to this operation to timeout with a TimeoutException. A good value is 30.