Refactoring community.vmware.vmware_guest in vmware.vmware

Hello vmware users!

As we migrate modules from community.vmware to vmware.vmware, we have the opportunity to improve upon them. I’d like to discuss improving the vmware_guest module, either by making it easier to maintain, use, or improving the user experience.

The module is very, very long. The code will likely be broken up and simplified, and if the code is being split we may be able to split the module functionally as well. It seems like there are a lot of other modules that already do part of the functionality (vmware_guest_disk for example). The new vmware_guest module could just manage basic state of a VM and then you’d have to use other modules to manage disks, networks, etc. I think @mariolenz mentioned playing around with this idea, and I’d like to know if anyone has already taken this approach…

If you have any thoughts, please share them!

community.vmware.vmware_guest is far too complex. It tries to manage more or less everything that you can do to with a VM. This list isn’t complete, but I would like to give some examples:

  • Creating VMs, cloning from a VM and cloning from a template
  • State: Not only if a VM should exist or not, but also the power state (on, off, suspended… triggering one-off actions like rebbooting and similar)
  • NICs / networking
  • HBAs, disks, CDROMs…
  • OS customization
  • Marking a VM as a template and vice versa

The really hard thing will be to decide what the module should do and what’s out of scope / other modules should do.

I’ve tried to come up with a solution, but this isn’t easy. Although… I’ve tried to remove things. Maybe I should start with an MVP like community.vmware.vm and then add stuff that looks really necessary :thinking: