Provide User Input Requested by a Virtual Machine
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.
status="5"
, and includes a link that you can GET to
discover what input is needed.
Prerequisites
This operation requires the rights included in the predefined vApp User role or an equivalent set of rights.
Procedure
Example: Provide User Input Requested by a Virtual Machine
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.
GET https://vcloud.example.com/api/vApp/vm-5/question
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.
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>