Restart Guest OS operation


The Restart Guest OS operation shuts down and restarts the guest operating system without powering off the virtual machine.

The following table describes the elements for this request.

Adapter request elements for the Restart Guest OS operation

Element

Definition

Required

<operation-type>

Defines the type of the operation: Basic_Vm

Yes

<operation-name>

Defines the name of the operation: Restart_Guest_OS

Yes

<soap-url>

Specifies the URL for the remote SOAP service running on the VMware VirtualCenter

If the <soap-url> element is not specified, the request uses the VirtualCenter Server details specified in the adapter configuration.

Default format for HTTPS: https://<hostName>:<port>/sdk/vim

Default format for HTTP: http://<hostName>:<port>/sdk/vim

Note: If you want to use an HTTP value, you might need to change the configuration of the VMware Infrastructure application.

No

<transport>

Specifies the transport protocol for the message

If the <transport> element is not provided, the request uses the VirtualCenter Server details specified in the adapter configuration.

Valid values: https-rpc (default), http-rpc

Note: If the value of the <transport> element is https-rpc, you must install the security certificate for the VMware Virtual Center to the keystore of the peer on which the adapter is enabled.

No

<user-name>

Specifies the user name that is used for HTTP basic authentication on the VMware Virtual Center

If no user name is specified, the request is executed with the user name that is specified in the configuration.

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 the Restart Guest OS operation is to be executed

Yes

The following code sample shows a sample adapter request for the Restart Guest OS operation.

Sample adapter request for the Restart Guest OS operation

<vmware-infrastructure-request>
    <operation-type>Basic_Vm</operation-type>
    <operation-name>Restart_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 Restart Guest OS operation.

Sample adapter response for the Restart Guest OS operation

<vmware-infrastructure-response>
    <metadata>
       <status>success</status>
    </metadata>
    <RebootGuestResponse>
    </RebootGuestResponse>
</vmware-infrastructure-response>

The following table describes the response element.

Adapter response element for the Restart Guest OS operation 

Element

Definition

<status>

Contains the status of the operation

Valid values: success, error

If the <status> element contains error, the response is similar to the response for an invalid state of a VM as shown in the following code snippet:

<vmware-infrastructure-response>
<metadata>
<status>error</status>
</metadata>
<Fault>
<faultcode>ServerFaultCode</faultcode>
<faultstring>The attempted operation cannot be performed in the current state (Powered off).</faultstring>
<detail>
<InvalidPowerState>
<requestedState>poweredOn</requestedState>
<existingState>poweredOff</existingState>
</InvalidPowerState>
</detail>
</Fault>
</vmware-infrastructure-response>
<RebootGuestResponse>

Is empty if the <status> element contains success; contains the <Fault> element if the <status> element contains error

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*