Answers: <p>I'm using vagrant with vsphere plugin, starting from a 'base' image already present on vsphere.</p>
  
  <p>The new machine is then fully configured (inlcluding middleware) by chef after vsphere customization. </p>
  
  <p>That's one in many possibilities, unsure this question lead to actionnable answers out of everyone 'workaround'.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-10-11T21:56:32.563Z
Answers: 2017-10-11T21:56:32.563Z
Answers: Tensibai
Body: <p><strong>Scenario</strong>: </p>
  
  <p>Creating multiple VMs and deploying them to VSphere. Current development uses Packer and Ansible to provision a Fusion VM, with the aim of using Terraform to deploy to VSphere.</p>
  
  <p><strong>Issue</strong>:</p>
  
  <p>I've been having loads of issues with uploading Fusion VMs to VSphere and having to use work arounds such as <a href="https://apple.stackexchange.com/questions/99433/moving-fusion-vms-to-esxi">this</a>, and been wondering if there is a better of doing this.</p>
  
  <p><strong>Question</strong>: </p>
  
  <p>I'm questioning the use of Packer in this scenario (which deploys to Fusion), and doesn't seem to currently support a Packer->ESXi (VSphere) builder unless it's an ISO.</p>
  
  <p>Would it be possible to remove Packer entirely from this scenario, so instead of building a Fusion image, provisioning the image, and uploading it to VSphere, use Terraform to deploy an ESXi image (template), and provision that image in-place using Ansible as a provisioner? (such that everything is done in VSphere rather than Fusion then VSphere).</p>
  
  <p>What are the advantages and disadvantages of doing this?</p>
  
Tags: <ansible><deployment><terraform><packer><provisioning>
Title: Deploying to VSphere with Packer and/or Terraform?
UserDisplayName: Rekovni
ThreadText: # Deploying to VSphere with Packer and/or Terraform?
  
  (Asked by: username_0 on 2017-10-11)
  
  **Scenario**:
  
  Creating multiple VMs and deploying them to VSphere. Current development uses Packer and Ansible to provision a Fusion VM, with the aim of using Terraform to deploy to VSphere.
  
  **Issue**:
  
  I've been having loads of issues with uploading Fusion VMs to VSphere and having to use work arounds such as [this](https://apple.stackexchange.com/questions/99433/moving-fusion-vms-to-esxi), and been wondering if there is a better of doing this.
  
  **Question**:
  
  I'm questioning the use of Packer in this scenario (which deploys to Fusion), and doesn't seem to currently support a Packer->ESXi (VSphere) builder unless it's an ISO.
  
  Would it be possible to remove Packer entirely from this scenario, so instead of building a Fusion image, provisioning the image, and uploading it to VSphere, use Terraform to deploy an ESXi image (template), and provision that image in-place using Ansible as a provisioner? (such that everything is done in VSphere rather than Fusion then VSphere).
  
  What are the advantages and disadvantages of doing this?
  
  **Tags:** ansible, deployment, terraform, packer, provisioning
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-10-11. Score: 1
  
  I'm using vagrant with vsphere plugin, starting from a 'base' image already present on vsphere.
  
  The new machine is then fully configured (inlcluding middleware) by chef after vsphere customization.
  
  That's one in many possibilities, unsure this question lead to actionnable answers out of everyone 'workaround'.
  
  
  ---
  
  