Hi
I am very new to vmware / esxi.
I've been reading and looking up information but there are things that I am not fully grasping so I am going to request assistance.
In summary, I need to use ansible to automate the creation of snapshots for a specific VM by the name of 'pkgs-mirror'.
I thought of two ways to do this:
#1 - the vmware_guest_module for ansible
or
#2 - Use ansible to call a shell script on the esxi server to create a snapshot.
I ran into snags on both methods however:
For #1:
I am confused on certain aspects of the syntax and what is required:
-name:Create a snapshot vmware_guest_snapshot: hostname:"{{vcenter_hostname}}" username:"{{vcenter_username}}" password:"{{vcenter_password}}" datacenter:"{{datacenter_name}}" folder:"/{{datacenter_name}}/vm/" name:"{{guest_name}}" state:present snapshot_name:snap1 description:snap1_description delegate_to:localhost |
I am unsure what needs to go in place of 'hostname' and 'datacenter'
Would hostname be the IP address of the specific host (VM) of which I am taking a snapshot of?
Would datacenter be the IP address of the ESXI of which my VM's are hosted on?
Would folder be the location of the VM in my datastore?
For #2
It's looking as though I cannot use vmware-cmd - so I have to use vCLI, but when I attempt to run it, I receive a 'not found' error. It looks as though I have to install vCLI but Im confused as to where... Does it get installed on my server or my client I'm connecting to the server from? (I.E. my laptop) If it gets installed on the server, how do I install it? Most of the linux commands do not work in the vsphere environment so I'm unsure how I download and install it onto the server.
I know this sounds like newbie questions but any help I would greatly appreciate.