nsidc / vagrant-vsphere

VMware vSphere provider for Vagrant
Other
609 stars 166 forks source link

Ability to convert newly created VM into a template #267

Open morganatkins24 opened 6 years ago

morganatkins24 commented 6 years ago

Background

As part of my workflow it would be ideal for Vagrant to clone a Template, provision it, and then produce a new vSphere Template. Currently 'vagrant-vsphere' only allows the creation of a new VirtualMachine on vSphere.

Proposal

'vagrant-vsphere' should have an option to convert the VirtualMachine to a vSphere Template after the provisioning is finished.

Proposed Workflow

A new configuration parameter is added: vsphere.convert_to_template = true / false Option should default to false

DamonStamper commented 5 years ago

You might want to look into using Packer for this as Packer is designed to make templates. Vagrant is supposed to provision instances of templates.

Specifically take a look at https://github.com/jetbrains-infra/packer-builder-vsphere to build a VM (from another VM/Template even) then use https://github.com/hashicorp/packer/blob/master/website/source/docs/post-processors/vsphere-template.html.md to convert the output to a template.