How to configure the VMware tools of a running virtual machine

Introduction

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

Scenario requirements

You’ve already followed How to run a virtual machine and your virtual machine runs VMware Tools.

How to change the upgrade policy

Change the upgrade policy to MANUAL

You can adjust the VMware Tools upgrade policy with the vcenter_vm_tools module.

- name: Change vm-tools upgrade policy to MANUAL
  vmware.vmware_rest.vcenter_vm_tools:
    vm: '{{ test_vm1_info.id }}'
    upgrade_policy: MANUAL
  register: _result

Result

{
    "id": null,
    "changed": true
}

Change the upgrade policy to UPGRADE_AT_POWER_CYCLE

- name: Change vm-tools upgrade policy to UPGRADE_AT_POWER_CYCLE
  vmware.vmware_rest.vcenter_vm_tools:
    vm: '{{ test_vm1_info.id }}'
    upgrade_policy: UPGRADE_AT_POWER_CYCLE
  register: _result

Result

{
    "id": null,
    "changed": true
}

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/scenario_guides/vmware_rest_scenarios/vm_tool_configuration.html