community.vmware.vmware_vm_storage_policy – Create vSphere storage policies
community.vmware.vmware_vm_storage_policy – Create vSphere storage policies
Note
This plugin is part of the community.vmware collection (version 1.6.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_vm_storage_policy
.
New in version 1.0.0: of community.vmware
Synopsis
- A vSphere storage policy defines metadata that describes storage requirements for virtual machines and storage capabilities of storage providers.
- Currently, only tag-based storage policy creation is supported.
Requirements
The below requirements are needed on the host that executes this module.
- python >= 2.7
- PyVmomi
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
description string |
Description of the storage policy to create or update. This parameter is ignored when | |
hostname string |
The hostname or IP address of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. | |
name string / required |
Name of the storage policy to create, update, or delete. | |
password string |
The password of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6.
| |
port integer |
Default: 443 |
The port number of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. |
proxy_host string |
Address of a proxy that will receive all HTTPS requests and relay them. The format is a hostname or a IP. If the value is not specified in the task, the value of environment variable This feature depends on a version of pyvmomi greater than v6.7.1.2018.12 | |
proxy_port integer |
Port of the HTTP proxy that will receive all HTTPS requests and relay them. If the value is not specified in the task, the value of environment variable | |
state string |
|
State of storage policy. If set to If set to |
tag_affinity boolean |
|
If set to If set to This parameter is ignored when |
tag_category string |
Name of the pre-existing tag category to assign to the storage policy. This parameter is ignored when This parameter is required when | |
tag_name string |
Name of the pre-existing tag to assign to the storage policy. This parameter is ignored when This parameter is required when | |
username string |
The username of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6.
| |
validate_certs boolean |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. If set to |
Notes
Note
- Tested on vSphere 6.5
Examples
- name: Create or update a vSphere tag-based storage policy
community.vmware.vmware_vm_storage_policy:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
name: "vSphere storage policy"
description: "vSphere storage performance policy"
tag_category: "performance_tier"
tag_name: "gold"
tag_affinity: true
state: "present"
delegate_to: localhost
- name: Remove a vSphere tag-based storage policy
community.vmware.vmware_vm_storage_policy:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
name: "vSphere storage policy"
state: "absent"
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
vmware_vm_storage_policy dictionary |
success |
dictionary of information for the storage policy
Sample: {'vmware_vm_storage_policy': {'description': 'Storage policy for gold-tier storage', 'id': 'aa6d5a82-1c88-45da-85d3-3d74b91a5bad', 'name': 'gold'}} |
Authors
- Dustin Scott (@scottd018)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/vmware/vmware_vm_storage_policy_module.html