Share via


IVMVirtualMachine::ShutdownActionOnQuit property

The ShutdownActionOnQuit property contains how to shut down this virtual machine (VM) if it is running when Virtual Server is quit.

This property is read/write.

Syntax

HRESULT put_ShutdownActionOnQuit(
  [in]  VMShutdownAction shutdownAction
);

HRESULT get_ShutdownActionOnQuit(
  [out] VMShutdownAction *shutdownAction
);

VB
VMVirtualMachine.ShutdownActionOnQuit( _
  ByRef shutdownAction, _
  ByVal shutdownAction _
)

Property value

Contains a flag which specifies how to shut down this VM if it is running when Virtual Server is quit.

This property value is read/write.

Error codes

Name Meaning
S_OK
The operation was successful.
E_POINTER
shutdownAction is NULL.
E_POINTER
shutdownAction is not a valid value.
VM_E_VM_UNKNOWN
The configuration is unknown.
DISP_E_EXCEPTION
An unexpected error has occurred.

Remarks

By default, running VMs are saved when Virtual Server is quit. The shutdown action vmShutdownAction_Save will save the VM's state. The vmShutdownAction_TurnOff action will turn off the VM. The vmShutdownAction_Shutdown action will shut down the guest operating system if the Virtual Server Additions are available and will fall back onto saving the VM otherwise.

Examples

The following example displays the ShutdownActionOnQuit property value of a VMVirtualMachine object.

Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("Windows Server 2003")

WScript.Echo "VM Name: " & objVM.Name
WScript.Echo "Shutdown action on quit: " & objVM.ShutdownActionOnQuit

Requirements

Product
Microsoft Virtual Server 2005 onWindows Server 2003
Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VsComInterfaces.h

See also

IVMVirtualMachine

VMShutdownAction