This module allows you to manage your VM snapshots; for example, the following creates a snapshot:
- name: Create a snapshot vmware_guest_snapshot: hostname: "{{ vsphere_host }}" username: "{{ vsphere_username }}" password: "{{ vsphere_password }}" validate_certs: "no" datacenter: "my-datacenter" folder: "/vms" name: "yet_another_example_vm" snapshot_name: "pre-patching" description: "snapshot made before patching" state: "present" delegate_to: localhost
As you can see from the previous example, this snapshot is being taken because we are about to patch the VM. If the patching goes as expected, then we can run the following task:
- name: Remove a snapshot vmware_guest_snapshot: hostname: "{{ vsphere_host }}" ...