summaryrefslogtreecommitdiffstats
path: root/docs/docsite/rst/scenario_guides/vmware_rest_scenarios/vm_tool_information.rst
blob: 2f92871db37df6bfbcab0126eca97cc9b986c483 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.. _vmware_rest_vm_tool_information:

*****************************************************
How to get information from a running virtual machine 
*****************************************************

.. contents::
  :local:


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

This section shows you how to collection information from a running virtual machine.

Scenario requirements
=====================

You've already followed :ref:`vmware_rest_run_a_vm` and your virtual machine runs VMware Tools.

How to collect information
==========================

In this example, we use the ``vcenter_vm_guest_*`` module to collect information about the associated resources.

Filesystem
----------

Here we use ``vcenter_vm_guest_localfilesystem_info`` to retrieve the details
about the filesystem of the guest. In this example we also use a ``retries``
loop. The VMware Tools may take a bit of time to start and by doing so, we give
the VM a bit more time.

.. literalinclude:: task_outputs/Get_guest_filesystem_information.task.yaml

Result
______

.. literalinclude:: task_outputs/Get_guest_filesystem_information.result.json

Guest identity
--------------

You can use ``vcenter_vm_guest_identity_info`` to get details like the OS family or the hostname of the running VM.

.. literalinclude:: task_outputs/Get_guest_identity_information.task.yaml

Result
______

.. literalinclude:: task_outputs/Get_guest_identity_information.result.json

Network
-------

``vcenter_vm_guest_networking_info`` will return the OS network configuration.

.. literalinclude:: task_outputs/Get_guest_networking_information.task.yaml

Result
______

.. literalinclude:: task_outputs/Get_guest_networking_information.result.json

Network interfaces
------------------

``vcenter_vm_guest_networking_interfaces_info`` will return a list of NIC configurations.

See also :ref:`vmware_rest_attach_a_network`.

.. literalinclude:: task_outputs/Get_guest_network_interfaces_information.task.yaml

Result
______

.. literalinclude:: task_outputs/Get_guest_network_interfaces_information.result.json

Network routes
--------------

Use ``vcenter_vm_guest_networking_routes_info`` to explore the route table of your virtual machine.

.. literalinclude:: task_outputs/Get_guest_network_routes_information.task.yaml

Result
______

.. literalinclude:: task_outputs/Get_guest_network_routes_information.result.json