The Power of OVF Properties

The Open Virtualization Format (OVF) is very powerful and something I would encourage everyone interested in creating virtual appliances to really read up on. Through OVF properties you can configure a variety of virtual machine settings including:

  • Networking
  • Resources
  • Password
  • and really anything!

I would like to provide some examples on how to create some of these specifications.

ovftool

NOTE: The examples provided below are only subsets of an actual OVF XML file. My examples are coming from the Log Insight OVF XML file. For a complete example check out the Log Insight 2.0 OVF file. Also note that all examples are from a VMware Studio built OVF.

Networking

First, you need to specify the network interfaces:

Next, you need to specify what parameters can / need to be set for networking:

Finally, you need to define the virtual hardware to be used for networking:

Resources

First, you need to specify deployment options:

Then you need to specify sizing per deployment options:

Password

It turns out you can define whatever properties you want in the OVF XML file and pass them to the VM. A great use-case of this functionality is to set the root password on the VM. To do this, you could define the password as follows:

The great part about this is that the OVF specifications allows for passwords and hides this on the screen. Some limitations to this approach are that the password is saved in plain-text within the VM and you cannot enforce password complexity, but still pretty cool if you ask me.

With the password set, you can access the property by running ovfenv within the VM. To get just the password you could run: ovfenv -k vm.rootpw. How cool is that?!?

NOTE: ovfenv requires VMware Studio (thanks Andrew!)

Advanced Settings

One thing that is VMware specific and not part of the OVF specification is the ability to add VMware specific markup. This markup is not officially documented, but a Google search pulls up a variety of examples. A great example of the VMware markup is the vmw:ExtraConfig markup, which allows you to pass advanced settings to a VM. This can be used to set things such as the keyboard delay of the console:

NOTE: With the above setting, you will need to select a checkbox during VM deployment to confirm you want a non-standard option to be passed.

Want more?

For more cool things you can do with OVF check out all the awesome posts William Lam has:

UPDATE1: Added more posts from William about OVF properties.

UPDATE2: Added information about VMware Studio and ovfenv based on feedback from Andrew Sharpe.

© 2014 – 2015, Steve Flanders. All rights reserved.

4 thoughts on “The Power of OVF Properties

  1. Atif says:

    Can you please tell me that how i can create OVA/OVF template which have deployment option feature so that user can create the VM by selecting the option from deployment options available for HarDisk Size and number of CPU

  2. Jeff Silberman says:

    Editing the OVF (XML) file directly is not the right way to do this at all.
    The correct approach is via the ‘ovftool’ command line, such as :
    ‘ovftool –allowExtraConfig \
    –extraConfig:keyboard.typematicMinDelay=”2000000″ …

    • Hey Jeff — thanks for the comment! Using ovftool to specify the advanced parameter is great if you are comfortable with ovftool and only deploy with ovftool. Log Insight is made available to customers who deploy via all sorts of methods including the vSphere client. Instead of offloading the responsibility to the user to provide the parameter through a limited set of tools today, why not build it into the XML file so all users can have it without having to worry about adding it and without having to use specific tools? One of the big advantages of Log Insight is that it make the entire process quick and easy. This means handling as much for the user as possible.

Leave a Reply