A SERVICE OF

logo

CHAPTER 4 Operations on Virtual Machines
57
RC1
VixVM_PowerOff
Function Signature
VixHandle
VixVM_PowerOff(VixHandle vmHandle,
VixVMPowerOpOptions powerOffOptions,
VixEventProc *callbackProc,
void *clientData);
Parameters
Results
VixHandle — A job handle that describes the state of this asynchronous operation.
Notes
This function powers off a virtual machine. It is an asynchronous operation, and
the job will be signalled when the operation completes. If the virtual machine is
not powered on when you call this function, then it returns an error.
If you call this function while the virtual machine is already powered off, then the
operation returns a VIX_E_VM_NOT_RUNNING error. You can safely ignore
this error.
Example
VixError err = VIX_OK;
VixHandle hostHandle = VIX_INVALID_HANDLE;
VixHandle jobHandle = VIX_INVALID_HANDLE;
VixHandle vmHandle = VIX_INVALID_HANDLE;
jobHandle = VixHost_Connect(VIX_API_VERSION,
VIX_SERVICEPROVIDER_VMWARE_SERVER,
NULL, // hostName
0, // hostPort
NULL, // userName
vmHandle Identifies a virtual machine. Call VixVM_Open() to create a virtual
machine handle.
powerOffOptions Must be 0.
callbackProc A callback function that will be invoked when the power operation is
complete.
clientData A parameter that will be passed to the callbackProc function.