# creating vmware snapshots playbook

**URL:** <https://forum.ansible.com/t/creating-vmware-snapshots-playbook/27832>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [June 20, 2018, 3:46pm UTC](https://forum.ansible.com/t/creating-vmware-snapshots-playbook/27832 "2018-06-20T15:46:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Izzy](https://avatars.discourse-cdn.com/v4/letter/i/c2a13f/32.png) [@Izzy](https://forum.ansible.com/u/Izzy)\
**Post date:** [June 20, 2018, 3:46pm UTC](https://forum.ansible.com/t/creating-vmware-snapshots-playbook/27832/1 "2018-06-20T15:46:46Z")

</div>

Hello everyone,

I’m currently learning more about ansible and I gotta say I am enjoying it. Anyway, so I created a playbook to create snapshots for a single vm host using the UUID, but I am curious if anyone has created or if there’s a way to create multiple snapshots at one time? The only thing I can think of, only because I’m a noob, is to add each uuid into the playbook. I have it prompt for the username and password then takes a snapshot of the single vm host. Has anyone dealt with this? Here’s my playbook currently that works for a single host snapshot

#Prompts username and passowrd for Vsphere before proceeding to take a snapshot

- hosts: Linux

vars\_prompt:

- name: “Username”

prompt: “Enter Your VMware Username”

private: no

- name: “Password”

prompt: “Enter Your VMware Password”

#Taking VM snapshot#

tasks

- name: VM Snapshot

vmware\_guest\_snapshot:

datacenter: “name of my datacenter”

hostname: “ip address”

username: “{{Username}}”

password: “{{Password}}”

name: globus0

uuid: 42035680-90c8-7033-8390-11aad4f83e13

state: present

snapshot\_name: test1

description: patch\_snapshot

validate\_certs: false

delegate\_to: localhost

Thanks,

Israel

---

<div class="post-metadata">

**Author:** ![Varun\_Chopra](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@Varun\_Chopra](https://forum.ansible.com/u/Varun_Chopra)\
**Post date:** [June 20, 2018, 5:53pm UTC](https://forum.ansible.com/t/creating-vmware-snapshots-playbook/27832/2 "2018-06-20T17:53:23Z")

</div>

You can refer to {{ ansible\_product\_uuid }} if you have facts for the hosts stored and loop through those.
