How do i deploy an OVA file on vCenter using Vagrant

834 views
Skip to first unread message

varun umesh

unread,
Jul 28, 2014, 11:00:07 PM7/28/14
to vagra...@googlegroups.com
Hi,

I am planning to use vagrant and vagrant-vcenter plugin to deploy an OVA file in vCenter. I am unable to figure out a method to convert the .ova file to .box format [once i get the .box format file, i would be using it as an input to the vmware-vagrant plugin and deploy it on vCenter]. Could anybody let me know how i could convert the .OVA file to .box file format? Are there any tools available to do this? Please suggest me any other alternative methods that are available.


Thanks!


-varun

Alvaro Miranda Aguilera

unread,
Jul 28, 2014, 11:28:18 PM7/28/14
to vagra...@googlegroups.com
Hello,

One potential idea will be decompress the ova and have the files, and work from there with packer.

http://www.packer.io/docs/builders/vmware-vmx.html

you may use packer to take that VM and create a new one

you can use packer with an ISO or with other VM, so in this case you will feeding the VM, doing nothing, and use it to push it and make it vagrant-aware

you may use the same process in case you want

- update the kernel
- update the os
- create vagrant user and vagrant keys
- create the box file

Other way will be open the ova in vmware on your desktop, and then using vagrant package to create a new box from there


From memory, and theory, you may use other methods like decompress the ova and do manual stuff, but I will avoid manual hacks until the proper paths have been exhausted, in this way you will end with a proven and tested method.. rather than something that just works.

Let me know if you need any help on this,
Alvaro.



--
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.

varun umesh

unread,
Jul 28, 2014, 11:47:53 PM7/28/14
to vagra...@googlegroups.com
Hi,

Thanks for the reply!

I am pretty new to tools like Packer and Vagrant and please correct me if i am wrong. This is what i have understood from your first comment:

Step 1: I would have to decompress the existing ova file that i have.
Step 2: Then use packer to create a VM [is this VM going to be in the .box file format, which would be compatible with Vagrant ] 
Step 3: Use vagrant to deploy the VM that was just created.

It would be very helpful if you could point me to documents related to creating a .box file using packer.

I could not really understand the second solution clearly, could you please explain it one again?

Thanks!


-varun

Alvaro Miranda Aguilera

unread,
Jul 29, 2014, 12:03:01 AM7/29/14
to vagra...@googlegroups.com
Hello,

Packer and vagrant are both software made by hashicorp, so they work very well.

For packer,

the webpage is:
http://www.packer.io/

vmware section is this:
http://www.packer.io/docs/builders/vmware.html

the vm to vm section goes here:
http://www.packer.io/docs/builders/vmware-vmx.html

the google groups group for packer is:
https://groups.google.com/forum/#!forum/packer-tool

To read about packer and vcentre/vcenter check this query (sort by date)
this will be a nice reading as they share some json templates for packer-vcenter


if you use packer, packer may connect to the vcentre and create the vm there

Packer resolve the the problem of creating the VM for you.. you can create a vm, or many vms as you want, is a pretty nice tool.


As you have already have a template, perhaps in this case the vagrant option is the best :)

in order to convert that template to a box, you basically need this

1. Create a VM
2. Do all the steps to make that box suitable for vagrant
http://docs.vagrantup.com/v2/boxes/base.html

start on the 2nd suggestion, that is package the vm as box, just remeber go to all the steps in step 2






varun umesh

unread,
Jul 29, 2014, 12:30:31 AM7/29/14
to vagra...@googlegroups.com
Hi,

Thanks for all the documents!

I just have one other question, when i decompress the OVA file, i do not see the .vmx file, this is expected as an input to the packer. I see only the following files:

.cert
.mf
.ovf
.vmdk


Could you please comment on this?

Thanks!

-varun

Alvaro Miranda Aguilera

unread,
Jul 29, 2014, 6:11:40 PM7/29/14
to vagra...@googlegroups.com
hello

can you import the vm in vmware and then take the vmdk y vmx file from there?

varun umesh

unread,
Jul 30, 2014, 11:44:44 AM7/30/14
to vagra...@googlegroups.com
Hi,

Sorry for the delay in my reply. I do not see the vmx file when i import the ova into vmware. I only have the vmdk file [along with the .mf and .ovf files ]. Is it mandatory for me to have the vmx file? I am still not able to package the ova file that i have to a box file format.


Thanks!

-varun

Alvaro Miranda Aguilera

unread,
Aug 1, 2014, 6:04:35 AM8/1/14
to vagra...@googlegroups.com
hello

i am sorry that i can't help you further, i am not a vmware user..

vmx is a text file, not sure where you could get a sample one to get you started.


Reply all
Reply to author
Forward
0 new messages