Customized OVF property values upon provision

67 views
Skip to first unread message

Gaston

unread,
Dec 6, 2015, 10:09:29 AM12/6/15
to Vagrant
Hi all;
I am building an automation framework which will deploy customized boxes using vcloud plugin.
I wonder whether Vagrant allows me to supply a VM property which is defined in my OVF file upon provision and not setting it as default value for this property upon box creation.

For example, in my ovf file I have the following currency property:
<Property ovf:key="currency" ovf:type="string" ovf:userConfigurable="true" ovf:value="USD - US Dollar".....>

Until now I used to override this 'currency' value 'USD' with an alternative supported currency (i.e. EUR) in the ovf file and then packing this ovf into a Vagrant box.
This was a manageable solution until multiple variables appear in my box (multiple boxes with small ovf file differences).
Now I need to create a single box and supply all this variables upon VM provisioning (the values can be supplied in Vagrantfile).

Ideas?

Gaston

unread,
Dec 6, 2015, 10:35:01 AM12/6/15
to Vagrant
I would say, instead of at 'provisioning' stage, upon VM creation.
Those properties cannot be injected after VM has been created.
In manual deployment, the properties are supplied in a VM deployment wizard, based on the OVF file.

Alvaro Miranda Aguilera

unread,
Dec 6, 2015, 7:10:55 PM12/6/15
to vagra...@googlegroups.com
Hello,

When you import a box, it goes to

~/.vagrant.d/boxes/<user>/<box>

Can you check there?

You may want to update around that directory.

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/55f7bbc2-4664-4e14-9c35-74706a89eb71%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Gaston

unread,
Dec 7, 2015, 2:53:04 AM12/7/15
to Vagrant
Hi Alvaro;
My boxes are stored locally under ~/.vagrant.d/boxes/<box name>/<version>/<provider?>/
Anyway, what should I update there?

Alvaro Miranda Aguilera

unread,
Dec 7, 2015, 4:57:13 AM12/7/15
to vagra...@googlegroups.com
Hello gaston

Think in that location as your base template.

so if you want to update the source of the box, you can update that one.

After that, you can run vagrant repackage to create a new box so you
can have one for each currency/settings.

Alvaro.
> https://groups.google.com/d/msgid/vagrant-up/5088c366-5111-4688-afc8-fbd9e1083285%40googlegroups.com.

Gaston

unread,
Dec 7, 2015, 8:17:24 AM12/7/15
to Vagrant
This is the way I actually work.
My question is, how to do give those properties values on-the-fly, with no need no re-upload the whole box to vCloud Director.
Ovftool is able to do that (i.e. ovftool --prop:currency="EUR - Euro".....).
I wonder if this is possible using Vagrant too.

i saw some examples in the internet, adding some code to a configuration file:
But its for virtualbox provider for already defined parameters (natdnshostresolver1).
config.vm.provider :virtualbox do |vb|
  vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end

I wold like to see somethig lke
config.vm.customize ["modifyvm", :id, "itfm_currency", "EUR - Euro"]
   

Alvaro Miranda Aguilera

unread,
Dec 7, 2015, 4:41:20 PM12/7/15
to vagra...@googlegroups.com
On Tue, Dec 8, 2015 at 2:17 AM, Gaston <gast...@gmail.com> wrote:
> y ovf


Hello,

I see now, sorry for going in circles here.

Those are implemented by the provider plugin, so you can ask to the
people behind the vCloud plugin if they did implement customization,
and what's the proper format. (list vs array, etc)

Thanks
Alvaro.
Reply all
Reply to author
Forward
0 new messages