W3cubDocs

/Ansible

vmware_resource_pool - Add/remove resource pools to/from vCenter

New in version 2.3.

Synopsis

  • This module can be used to add/remove a resource pool to/from vCenter

Requirements (on host that executes module)

  • python >= 2.6
  • PyVmomi

Options

parameter required default choices comments
cluster
yes
Name of the cluster to add the host.
cpu_expandable_reservations
no True
In a resource pool with an expandable reservation, the reservation on a resource pool can grow beyond the specified value.
cpu_limit
no -1 (No limit)
The utilization of a virtual machine/resource pool will not exceed this limit, even if there are available resources.
cpu_reservation
no
Amount of resource that is guaranteed available to the virtual machine or resource pool.
cpu_shares
no Normal
  • high
  • custom
  • low
  • normal
Memory shares are used in case of resource contention.
datacenter
yes
Name of the datacenter to add the host.
hostname
yes
ESXi hostname to manage.
mem_expandable_reservations
no True
In a resource pool with an expandable reservation, the reservation on a resource pool can grow beyond the specified value.
mem_limit
no -1 (No limit)
The utilization of a virtual machine/resource pool will not exceed this limit, even if there are available resources.
mem_reservation
no
Amount of resource that is guaranteed available to the virtual machine or resource pool.
mem_shares
no Normal
  • high
  • custom
  • low
  • normal
Memory shares are used in case of resource contention.
password
yes
ESXi password.
resource_pool
yes
Resource pool name to manage.
state
no present
  • present
  • absent
Add or remove the resource pool
username
yes
ESXi username.
validate_certs
no True
  • True
  • False
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.

Examples

# Create a resource pool
  - name: Add resource pool to vCenter
    vmware_resource_pool:
      hostname: vcsa_host
      username: vcsa_user
      password: vcsa_pass
      datacenter: datacenter
      cluster: cluster
      resource_pool: resource_pool
      mem_shares: normal
      mem_limit: -1
      mem_reservation: 0
      mem_expandable_reservations: True
      cpu_shares: normal
      cpu_limit: -1
      cpu_reservation: 0
      cpu_expandable_reservations: True
      state: present

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
instance
metadata about the new resource pool
always dict None

Notes

Note

  • Tested on vSphere 6.5

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/vmware_resource_pool_module.html