Vagrant deploy box image to vsphere

2,191 views
Skip to first unread message

Lee Cuevas

unread,
Jan 20, 2015, 9:15:31 PM1/20/15
to vagra...@googlegroups.com
I would like to create a Vagrant .box image and then use it to deploy from my laptop using vsphere. Is this doable? If so, can someone post a link with instructions please?

Thanks in advance

Lee

Alvaro Miranda Aguilera

unread,
Jan 20, 2015, 9:40:43 PM1/20/15
to vagra...@googlegroups.com
Hello, 

have a look at packer.io you can create the box using vmware-iso builder and vagrant post-processor.





Here is a blogpost about the vagrant part...


the creation of the VM can be automated with packer




then there is vsphere plugin, however what I understand it use a template/vm that already exist on vmware space


so for the vagrantfile, it use a dummy box







--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stan Dorsett

unread,
Jan 21, 2015, 12:10:16 PM1/21/15
to vagra...@googlegroups.com
There is also the vagrant-vcenter provider


This provider doesn't require a template on vcenter.

Lee Cuevas

unread,
Jan 21, 2015, 9:10:34 PM1/21/15
to vagra...@googlegroups.com
Thanks for the information!

Lee

Anthony Manzo

unread,
Jul 29, 2015, 7:20:22 PM7/29/15
to Vagrant, leec...@gmail.com
Hi,
I wondered what technique you ended up using.  I'm experimenting with the vsphere (not vcenter) esxi provider and it's working well off of templates but I would like to know if you've found a way to package your vsphere images as boxes with one of these other options.
Cheers ,
Tony

Alvaro Miranda Aguilera

unread,
Jul 29, 2015, 7:35:26 PM7/29/15
to vagra...@googlegroups.com, leec...@gmail.com
Hello Anthony

What plugin are you using?

I think the way the plugin works, require the VM or Template to exist
on Vmware first.

On my particular case, I use VCSA (sorry, i am lost with
vcenter/vsphere) and I create the box with packer (packer.io) and I
have all wrapped with one script

so my script call packer to build the VM and then call OVFTool to
create an OVA file

then, you can use GOVC to upload these OVA files to VMware:
https://github.com/vmware/govmomi/releases

Let me know if you need assistance to get this working, happy to share.

Alvaro.
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/154ced65-ee55-47d4-8988-3c290194ce83%40googlegroups.com.

Anthony Manzo

unread,
Jul 29, 2015, 11:49:15 PM7/29/15
to Vagrant, leec...@gmail.com, kik...@gmail.com
I'm using https://github.com/nsidc/vagrant-vsphere and I'm actually using it on a vcenter host (contrary to what I said).
It's working well, but it's not as fast a using a prebuilt box because it starts with the template as you said ( and then clones it to a vm).
Thanks for the info on Packer, it looks like I can create a box with that.

Alvaro Miranda Aguilera

unread,
Jul 30, 2015, 12:15:12 AM7/30/15
to Anthony Manzo, Vagrant, leec...@gmail.com
Hello Anthony

this is how I create the boxes.

https://gist.github.com/kikitux/ee20aa07d9534841e103


You can create from template or linked clone

in my case, since I am testing the ideal provisioning (according to myself)
what I do is

packer -> ova -> template

then I create 4 boxes

Template -> box1
box1 - > box2 (linked clone)
box1 - > box3 (linked clone)
box1 - > box4 (linked clone)

So have a look at my Vagrantfile and maybe you can reuse some ideas
Reply all
Reply to author
Forward
0 new messages