Snapshots let you store the state of a vm to roll back to later. It’s different from cloning. I searched the module for “clone” and “template” and neither is there.
The examples don’t cover all the config options, nor do the docs.
vm_hardware:
|
|
memory_mb: 2048
|
|
num_cpus: 2
|
|
osid: centos64Guest
|
|
scsi: paravirtual
|
but when I played with vsphere_guest my conclusion was that the only support for selecting the base for the vm was
def add_cdrom(module, s, config_target, config, devices, default_devs, type="client", vm_cd_iso_path=None):
In vmware, there are two very different paths for creating a vm. One, you select the cd_rom which is like a bootable iso. The other (more common) is to build up a template (i believe it is backed by a vmdk) and then clone from the template. The latter is the functionality i need, and the former is all that is supported. I could be wrong, but would need an example to show cloning with the given api.
Tony, I am talking about adding a volume after boot, for logs or data drives, although creating partitions on boot would be nice too.
Vsphere is capable of sooo much, I think the idea of adding hooks that expose the functionality in an ‘extra-params’ like way is the way to go, otherwise you end up with a dozen vsphere-x modules. If vsphere_guest has that capability and it just needs exposing, great. If it is fundamentally not extend then perhaps other options should be explored.
I think apt and synchronize already offer this type of “deeper through extra-args” functionality. Perhaps the best option would be a master module capable of pretty much everything (with good documentation) and then a few facades modules for the most common usages. The code should be factored out into a handful of modules plus some helper classes that are used by all modules, like authentication and connection.
The trouble with the current vsphere_guest is it offers insufficient capabilities to satisfy any real-world usage pattern, and there doesn’t seem to be much activity in extending it to do so. Tony’s module with the built in power via spec can do orders of magnitude more but would need lots of examples for the various use cases.
I will try to play with the spec today to see if it meets my needs.