Shut Down Guest OS operation
The Shut Down Guest OS operation shuts down the guest operating system without powering off the virtual machine. You cannot immediately act on a virtual machine whose guest OS is being shut down; instead, you must verify that the guest OS for which shutdown has been initiated has indeed completed by verifying that the {{<status>}} element contains success.
The following table describes the elements for this request.
Adapter request elements for the Shut Down Guest OS operation
Element | Definition | Required |
|---|---|---|
<operation-type> | Defines the type of operation: Basic_Vm | Yes |
<operation-name> | Defines the name of operation: Shut_Down_Guest_OS | Yes |
<soap-url> | Specifies the URL for the remote SOAP service running on the VMware VirtualCenter | No |
<transport> | Specifies the transport protocol for the message | No |
<user-name> | Specifies the user name that is used for HTTP basic authentication on the VMware Virtual Center | No |
<password> | Specifies the password corresponding to <user-name> | Conditional; required if <user-name> is specified |
<parameters> | Contains the <virtual-machine> element required to execute the operation | Yes |
<virtual-machine> | Contains the name of the virtual machine on which this operation is to be executed | Yes |
The following code sample shows a sample adapter request for the Shut Down Guest OS operation.
Sample adapter request for the Shut Down Guest OS operation
<operation-type>Basic_Vm</operation-type>
<operation-name>Shut_Down_Guest_OS</operation-name>
<soap-url></soap-url>
<transport></transport>
<user-name></user-name>
<password></password>
<parameters>
<virtual-machine>win1</virtual-machine>
</parameters>
</vmware-infrastructure-request>
The following code sample shows the response for the sample Shut Down Guest OS operation.
Sample adapter response for the Shut Down Guest OS operation
<metadata>
<status>success</status>
</metadata>
<ShutdownGuestResponse>
</ShutdownGuestResponse>
</vmware-infrastructure-response>
Adapter response element for the Shut Down Guest OS operation
Element | Definition |
|---|---|
<status> | Contains the status of the operation <vmware-infrastructure-response> <metadata> <status>error</status> </metadata> <Fault> <faultcode>ServerFaultCode</faultcode> <faultstring>The attempted operation cannot be performed in the current state (Suspended).</faultstring> <detail> <InvalidPowerState> <requestedState>poweredOn</requestedState> <existingState>suspended</existingState> </InvalidPowerState> </detail> </Fault> </vmware-infrastructure-response |
<ShutdownGuestResponse> | Is empty if the <status> element contains success; contains the <Fault> element if the <status> element contains error |