Creating Snapshots automatically in vSphere

Hello all,
I am trying to automate some processes, I want to be able to sync, create snapshot of VMs, and then update the VMs. I am able to easily set up sync plans and reoccurring jobs to update the VMs but I am having trouble finding any info on automating the snapshot process of the VM or any snapshot support for foreman at all. There is an old plug-in someone has made
GitHub - ATIX-AG/foreman_snapshot_management: A plugin to manage vmware vSphere snapshots from foreman UI
but I am unaware of how to install it(link to how to install it goes to an old 404’d foreman page) or if it still is functional or have what I want.

How do you guys manage this process with your hosts?

Hi drift_ai,

the plugin will add a snapshot tab in the host details, where you can manage the snapshots. You can also trigger those snapshots via API-calls. However, if you want to trigger the snapshot from a remote-job you probably need a workaround.
So from my point of view you have different options:

  1. Have a look at the webhooks plugin, where you can trigger scripts on certain actions.
  2. In your recurring job you could make an API-call to your foreman to use the snapshot-plugin to create a snapshot (via curl or via foreman-ansible-modules).
  3. In your recurring job you could make an API-call to your vcenter (via curl/ansible) - but that means that each host must be able to reach the vcenter.

I would probably create a remotejob with ansible, where it runs an local tasks with the foreman-ansible-modules to create that snapshot.

Thank you for your reply! I will try to look into these things. Last question is there anywhere that can help me with the installation of this custom plugin? I am unsure how to download it.

Found what I needed here
Foreman :: Plugin Manuals (theforeman.org)

Thank you for your help