summaryrefslogtreecommitdiffstats
path: root/docs/docsite/rst/scenario_guides/vmware_rest_scenarios/run_a_vm.rst
blob: be723866e7860073173d48288e6cf388081bdc04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.. _vmware_rest_run_a_vm:

****************************
How to run a virtual machine
****************************

.. contents::
  :local:


Introduction
============

This section covers the power management of your virtual machine.

Power information
=================

Use ``vcenter_vm_power_info`` to know the power state of the VM.

.. literalinclude:: task_outputs/Get_guest_power_information.task.yaml

Result
______

.. literalinclude:: task_outputs/Get_guest_power_information.result.json


How to start a virtual machine
==============================

Use the ``vcenter_vm_power`` module to start your VM:

.. literalinclude:: task_outputs/Turn_the_power_of_the_VM_on.task.yaml

Result
______

.. literalinclude:: task_outputs/Turn_the_power_of_the_VM_on.result.json

How to wait until my virtual machine is ready
=============================================

If your virtual machine runs VMware Tools, you can build a loop
around the ``center_vm_tools_info`` module:

.. literalinclude:: task_outputs/Wait_until_my_VM_is_ready.task.yaml

Result
______

.. literalinclude:: task_outputs/Wait_until_my_VM_is_ready.result.json