A request for a virtual machine to change state (power on, suspend, reconfigure, and so on) might cause the virtual machine to ask for additional user input before it can complete.

A vApp that contains a Vm awaiting a user response has status="5", and includes a link that you can GET to discover what input is needed.

This operation requires the rights included in the predefined vApp User role or an equivalent set of rights.

1

Find the question link in the target vApp.

This link has the following form:

<Link
   rel="down"
   type="application/vnd.vmware.vcloud.vmPendingQuestion+xml"
   href="http://vcloud.example.com/api/vApp/vm-5/question" />
2

Make a GET request to the URL in that link's href value.

The response is a VmPendingQuestion response that includes the question and the set of possible answers.

3

Create a VmQuestionAnswer element that supplies the answer.

See Example: Provide User Input Requested by a Virtual Machine.

4

POST the element to the question/action/answer link included in the VmPendingQuestion response.

In this series of examples, a virtual machine that was recently reconfigured in vCenter to add a new parallel port device and then powered on is requesting user input about where to send output from the device. The powerOn request cannot complete until this input is supplied.

The first step is to use the vmPendingQuestion link, shown in Step 1, to get a VmPendingQuestion response that includes the question and the set of possible answers.

Request:

GET https://vcloud.example.com/api/vApp/vm-5/question

Response:

200 OK
Content-type: application/vnd.vmware.vcloud.vmPendingQuestion+xml
...
<VmPendingQuestion
   xmlns="http://www.vmware.com/vcloud/v1.5">
   <Link
      rel="answer"
      type="application/vnd.vmware.vcloud.vmPendingAnswer+xml"
      href="http://vcloud.example.com/api/vApp/vm-5/question/action/answer" />
   <Question>msg.parallel.file.open:Parallel port output file
      "/vmfs/volumes/d6162a46-58e50cab/linuxftp/vm-mgi.log" already
      exists. Do you want to replace it with any newly created content,
      or append new content to the end of the file?
</Question>
   <QuestionId>50</QuestionId>
   <Choices>
      <Id>0</Id>
      <Text>Append</Text>
   </Choices>
   <Choices>
      <Id>1</Id>
      <Text>Replace</Text>
   </Choices>
   <Choices>
      <Id>2</Id>
      <Text>Cancel</Text>
   </Choices>
</VmPendingQuestion>

To supply the answer, POST a VmQuestionAnswer element to the question/action/answer link of the Vm.

Request:

POST http://vcloud.example.com/api/vApp/vm-5/question/action/answer
Content-type: application/vnd.vmware.vcloud.vmPendingAnswer+xml
<?xml version="1.0" encoding="UTF-8"?>
<VmQuestionAnswer
   xmlns="http://www.vmware.com/vcloud/v1.5">
   <ChoiceId>2</ChoiceId>
   <QuestionId>50</QuestionId>
</VmQuestionAnswer>