vmware.vmware_rest icon indicating copy to clipboard operation
vmware.vmware_rest copied to clipboard

Can we manage snapshots using this collection?

Open dragon299 opened this issue 2 years ago • 6 comments

Is there a possibility to create/revert snapshots using this collection?

Thanks

dragon299 avatar Oct 18 '22 13:10 dragon299

I'm not sure if this cover your problem, but we recently pushed an article on the Ansible blog that explain how to snapshot and clone instances.

goneri avatar Oct 18 '22 19:10 goneri

a link to the blog article would be helpful

djdanielsson avatar Mar 14 '23 16:03 djdanielsson

@djdanielsson I guess this is the blogpost https://www.ansible.com/blog/managing-a-vmware-template-lifecycle-with-ansible @goneri has mentioned.

alinabuzachis avatar Mar 14 '23 21:03 alinabuzachis

I read the blog, but for me it does not answer the question. The blog details how to make a template from an existing VM. That's created via a snapshot I'm sure. But I have the same question, I would like to be able to make snapshots from an existing VM which I can use to revert to if changes go awry or something else.

The 'old' module that did this with the VMOMI SDK is community.vmware.vmware_guest_snapshot.

I've tried looking up how the REST API works, but from what I was able to find, it's not supported, which I'd consider a major oversight in setting up the REST API. But I hope I'm wrong and that it's either still in the works somewhere or I'm blind ;-)

Thulium-Drake avatar May 31 '23 14:05 Thulium-Drake

The new(er) REST API lacks a lot of functionality that the old(er) SOAP API has. As far as I can see, it's not a 1:1 replacement... for a lot of things, you still have to talk SOAP.

I've tried looking up how the REST API works, but from what I was able to find, it's not supported, which I'd consider a major oversight in setting up the REST API. But I hope I'm wrong and that it's either still in the works somewhere or I'm blind ;-)

I'd have expected VM snapshot functionality in vCenter VM APIs but it's not there. Actually, I don't find anything about snapshots there at all. If you want to know it is planned to implement this, you'll have to reach out to VMware.

Out of curiosity, why don't you just use community.vmware.vmware_guest_snapshot? (DISCLAIMER: I'm the maintainer of community.vmware... well, for a given value of "maintaining"; new issues and PRs come in faster than I can work on them. But I'm trying to do my best.)

mariolenz avatar May 31 '23 15:05 mariolenz

Well, I did in the past (a lot), but I recently started working at a new client and saw that VMWare (finally) had a REST API and I had hoped to make the 'interface' simpler. As in the past I had to do some juggling to get it working on RHEL (7) as it required a version of python from SCL, which was a bit of a pain to get right.

But it's a new world with RHEL 8 and 9, so I'll need to take some time to get my code back up to par.

Thulium-Drake avatar May 31 '23 15:05 Thulium-Drake