# How to create snapshot of vm using ansible

**URL:** <https://forum.ansible.com/t/how-to-create-snapshot-of-vm-using-ansible/37335>\
**Category:** Ansible Project\
**Created:** [November 11, 2022, 11:25am UTC](https://forum.ansible.com/t/how-to-create-snapshot-of-vm-using-ansible/37335 "2022-11-11T11:25:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinayak\_sawant](https://avatars.discourse-cdn.com/v4/letter/v/4da419/32.png) [@vinayak\_sawant](https://forum.ansible.com/u/vinayak_sawant)\
**Post date:** [November 11, 2022, 11:25am UTC](https://forum.ansible.com/t/how-to-create-snapshot-of-vm-using-ansible/37335/1 "2022-11-11T11:25:16Z")

</div>

Hello Team

i want to create snapshot of vm using ansible playbook

does it require any ports to be open to get this done??

if yes then which are the ports required to be open from ansible server to vcentre

is there any sample playbook to understand??

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [November 11, 2022, 11:34am UTC](https://forum.ansible.com/t/how-to-create-snapshot-of-vm-using-ansible/37335/2 "2022-11-11T11:34:39Z")

</div>

[https://github.com/ansible-collections/community.vmware/blob/b5eb08db178ead605a0f233f8a88ef6435b5c709/plugins/modules/vmware\_guest\_snapshot.py#L131](https://github.com/ansible-collections/community.vmware/blob/b5eb08db178ead605a0f233f8a88ef6435b5c709/plugins/modules/vmware_guest_snapshot.py#L131)

---

<div class="post-metadata">

**Author:** ![vinayak\_sawant](https://avatars.discourse-cdn.com/v4/letter/v/4da419/32.png) [@vinayak\_sawant](https://forum.ansible.com/u/vinayak_sawant)\
**Post date:** [November 11, 2022, 12:40pm UTC](https://forum.ansible.com/t/how-to-create-snapshot-of-vm-using-ansible/37335/3 "2022-11-11T12:40:00Z")

</div>

Thanks Abhijit

do i need to open any ports for this ansible to run safely also i need to take more machine snapshot in single playbook so in that case what will be the folder parameter??

Is there any working ansible playbook for this??

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [November 11, 2022, 12:58pm UTC](https://forum.ansible.com/t/how-to-create-snapshot-of-vm-using-ansible/37335/4 "2022-11-11T12:58:41Z")

</div>

No additional port is required, the existing 443 or https port works.

The folder is the path to your VM for example `/<YOUR_DC>/vm/`

This is the best I can find - [https://github.com/Akasurde/VMworld\_2018\_demo/blob/5302dec58fd126fbfc1c577b7b9d8d77b9a8c37c/demo\_2.yml#L34](https://github.com/Akasurde/VMworld_2018_demo/blob/5302dec58fd126fbfc1c577b7b9d8d77b9a8c37c/demo_2.yml#L34)
