github.com/ratanraj/packer@v1.3.2/website/source/docs/post-processors/vsphere-template.html.md (about)

     1  ---
     2  description: |
     3      The Packer vSphere Template post-processor takes an artifact from the VMware-iso builder, built on ESXi (i.e. remote)
     4      or an artifact from the vSphere post-processor and allows to mark a VM as a template and leaving it in a path of choice.
     5  layout: docs
     6  page_title: 'vSphere Template - Post-Processors'
     7  sidebar_current: 'docs-post-processors-vSphere-template'
     8  ---
     9  
    10  # vSphere Template Post-Processor
    11  
    12  Type: `vsphere-template`
    13  
    14  The Packer vSphere Template post-processor takes an artifact from the VMware-iso builder, built on ESXi (i.e. remote)
    15  or an artifact from the [vSphere](/docs/post-processors/vsphere.html) post-processor and allows to mark a VM as a
    16  template and leaving it in a path of choice.
    17  
    18  ## Example
    19  
    20  An example is shown below, showing only the post-processor configuration:
    21  
    22  ``` json
    23  {
    24     "type": "vsphere-template",
    25     "host": "vcenter.local",
    26     "insecure": true,
    27     "username": "root",
    28     "password": "secret",
    29     "datacenter": "mydatacenter",
    30     "folder": "/packer-templates/os/distro-7"
    31  }
    32  ```
    33  
    34  ## Configuration
    35  
    36  There are many configuration options available for the post-processor. They are
    37  segmented below into two categories: required and optional parameters. Within
    38  each category, the available configuration keys are alphabetized.
    39  
    40  Required:
    41  
    42  -   `host` (string) - The vSphere host that contains the VM built by the vmware-iso.
    43  
    44  -   `password` (string) - Password to use to authenticate to the vSphere endpoint.
    45  
    46  -   `username` (string) - The username to use to authenticate to the vSphere endpoint.
    47  
    48  Optional:
    49  
    50  -   `datacenter` (string) - If you have more than one, you will need to specify which one the ESXi used.
    51  
    52  -   `folder` (string) - Target path where the template will be created.
    53  
    54  -   `insecure` (boolean) - If it's true skip verification of server certificate. Default is false  
    55  
    56  ## Using the vSphere Template with local builders
    57  
    58  Once the [vSphere](/docs/post-processors/vsphere.html) takes an artifact from the VMware builder and uploads it
    59  to a vSphere endpoint, you will likely want to mark that VM as template. Packer can do this for you automatically
    60  using a sequence definition (a collection of post-processors that are treated as as single pipeline, see
    61  [Post-Processors](/docs/templates/post-processors.html) for more information):
    62  
    63  ``` json
    64  {
    65    "post-processors": [
    66      [
    67        {
    68          "type": "vsphere",
    69           ...
    70        },
    71        {
    72          "type": "vsphere-template",
    73           ...
    74        }
    75      ]
    76    ]
    77  }
    78  ```
    79  
    80  In the example above, the result of each builder is passed through the defined sequence of post-processors starting
    81  with the `vsphere` post-processor which will upload the artifact to a vSphere endpoint. The resulting artifact is then
    82  passed on to the `vsphere-template` post-processor which handles marking a VM as a template.