Packer: Packer enhancement request: Better Vmware support for vSphere, support for vCenter and templates

Created on 22 Apr 2014  路  6Comments  路  Source: hashicorp/packer

Please consider making Packer work with vSphere and/or vCenter for all VMware builds. Also, please consider either adding a "vmware-template" build or adding a post-processor to convert a VMware build artifact to a vCenter template.

We are using Packer in an "enterprise" which means I need to find a way to run on any machine against the vSphere / vCenter server and that I need to be able to store hosts as templates, not VMXs or VMDKs. It would really help us out if Packer could handle these.

Thanks,
Adam

Most helpful comment

Hi!
There was nothing heard from here for a while, so I dare to share here a piece of my work (hoping to open a PR in a couple of weeks). I have developed a builder which creates a VM based on an existing one directly in vSphere (you can take a look here). It uses the vSphere API directly, without any external tools. In the next two weeks I will finish the minimal necessary functionality to be able to open a PR. Creating templates (as was asked in the request) is also considered in the future.

All 6 comments

I'd love to do this. Our development is primarily powered by community or sponsors. If you'd lke to give this a shot, we welcome that. If you'd like to pay someone (including HashiCorp) to build this, we're open to that too. At the moment, however, this isn't on the short term roadmap.

Mitchell,

If you'd like to pay someone (including HashiCorp) to build this, we're
open to that too.

Can you please give me even a _very_ rough estimate of how much it would
cost for these features? Would it likely be $1,000 or $5,000 or $10,000?
Or more? I'm not asking you to commit to a price, I just need to have
some idea so I can discuss it with my manager.

Thanks,
Adam

I guess the price was too high. :)

Hello, I'm currently work on a PR for beginning of that (a clone of vmware builder refactored to use "drivers" that address the VSphere API as advised by @rickard-von-essen on #4526 and trying to includes refactoring ideas from #4591). I've nearly finished the refactoring to remove all parts specific to local virtualization softwares and beginning to define a first driver that will use govc tool from VMware github.
In a second phases another driver could be written to replace govc usage by direct usage of govmomi.

I hope to have something to show in the next weeks.
Since I'm mainly an ops guy with a little dev background, this will be surely far from being "industrial solution" and will need at this time to be reviewed by more seasoned devs.

Hi!
There was nothing heard from here for a while, so I dare to share here a piece of my work (hoping to open a PR in a couple of weeks). I have developed a builder which creates a VM based on an existing one directly in vSphere (you can take a look here). It uses the vSphere API directly, without any external tools. In the next two weeks I will finish the minimal necessary functionality to be able to open a PR. Creating templates (as was asked in the request) is also considered in the future.

Hello Liza,
I had no comments on my current PR to provide a skeleton to use the Vsphere API ( #4882). I was very busy lately and had made no progress on it.

But it provides nearly all the functionnalities you are looking for. Since I'm learning golang, I was not sure to achieve it with dealing directly with vsphere API and use govc in a first place, but I had leave room to change that in a second step. All the govc calls are place in a driver builder/vsphere/common/driver_govc.go that is called derivated from builder/vsphere/common/driver.go. A driver_api.go can be added in the same way.

The only things that was missing to complete the cloning step was the content of the driver function CloneVirtualMachine and verify the call of it from the builder/vsphere/vm/step_clone_vm.go.

If you want to have a look, feel free to ping me.

Was this page helpful?
0 / 5 - 0 ratings