community.vmware.vmware_all_snapshots_info module – Gathers information about all snapshots across virtual machines in a specified vmware datacenter
Note
This module is part of the community.vmware collection (version 5.1.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_all_snapshots_info
.
Synopsis
This module collects detailed information of all the snapshots of the datacenter, can be used with filter options
Parameters
Parameter |
Comments |
---|---|
The name of the datacenter to gather snapshot information from. You can get it in the vmware UI. |
|
Optional filters to apply to the snapshot data being gathered, you can apply one or more. Filters are applied based on the variable match_type specified. If match_type exact, filters require exact matches. On the other hand when match_type includes it gets the values that contain that value. Available filter options creation_time, description, folder, id, name, quiesced, state, vm_name. Multiple filters can be applied the snapshot must meet all filter criteria to be included in the results. Default: |
|
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 |
|
Indicates whether the filter match should be exact or includes. For example when you want to get all the snapshots that contain in their name the word test you place the filter name test and the match_type includes. For example when you want to get all snapshots that are in state poweredOn you skip the match_type default is exact or you write match_type exact. Choices:
|
|
The password of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable |
|
The port number of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Default: |
|
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 |
|
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 |
|
The username of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Choices:
|
Notes
Note
All modules requires API write access and hence is not supported on a free ESXi license.
All variables and VMware object names are case sensitive.
Examples
- name: Gather information about all snapshots in VMware vCenter
vmware_snapshot_info_all:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
validate_certs: no
datacenter: '{{ datacenter_name }}'
delegate_to: localhost
- name: Gather information of a snapshot with filters applied and match_type in exacts.
vmware_snapshot_info_all:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
validate_certs: yes
datacenter: '{{ datacenter_name }}'
filters:
state: "poweredOn"
vm_name: "you_marchine_name"
delegate_to: localhost
- name: Gather information of snapshots that in their name contain the "test" in their name.
vmware_snapshot_info_all:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
validate_certs: yes
datacenter: '{{ datacenter_name }}'
match_type: "includes"
filters:
name: "test"
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A list of all snapshots information across all virtual machines in the specified datacenter Returned: always |
|
The time the snapshot was created Returned: always |
|
The description of the snapshot. Returned: when it exists because depends if it has or not |
|
The folder path of the virtual machine in the datacenter, normally is vm Returned: always |
|
The unique identifier of the snapshot Returned: always |
|
The name of the snapshot Returned: always |
|
Indicates if the snapshot was created with the virtual machines file system quiesced Returned: always |
|
The state of the virtual machine at the snapshot (powered on/off) Returned: always |
|
The name of the virtual machine that appears in the iu. Returned: always |