It is pretty common these days to see a vendor distribute their applications as a virtual appliance which pre-bundles both an operating system and their application instead of a stand alone installer and provides that as an OVF/OVA download. This makes it extremely easy for customers to deploy a vendors application with very minimal effort.
One potential challenge with providing a virtual appliance is that the virtual hardware configuration such as CPU and Memory is pre-configured during deployment and usually optimized for the lowest common denominator such as a small environment or even home lab for that matter. Of course, it is trivial to increase these resources after deployment but would it not be nice if the vendor could provide a "sizing recommendation" option during the deployment of their virtual appliance?
It turns out the OVF format actually supports such a functionality called Deployment Options and this is probably something that is not very well known. I personally have only seen this feature get used in one of VMware's virtual appliances which is vCenter Operations. When going through the deployment wizard of vCenter Operations appliance, you will notice one of the steps is to select your deployment configuration which in this case is based on the number of virtual machines you have in your vCenter Server environment.
The deployment option in this example translates to the number of vCPU and vMemory that the virtual appliances will be deployed with. Of course this information can also be used within the guestOS as part of the initial boot to configure the application based on the resources allocated to the virtual appliance. If you are interested in learning more about Deployment Options and its capabilities, you can find more details on the DMFT website for the OVF standards document starting on page 35.
I recently became interested in this as there was an internal thread asking how to leverage this feature and I initially thought this would be a capability provided by VMware Studio which is a product that helps you build virtual appliances. After deploying VMware Studio, I was unable to find a way to enable this feature as part of the build. Currently it looks like you would need to manually edit the OVF file which is XML based (not ideal) to add in this extra capability. You can also take an existing virtual machine and export using the vSphere Web/C# Client to an OVF/OVA and then add in the Deployment Option as a quick and dirty way of leveraging this feature within your organization.
I took a look at vCenter Operations OVA file to see how Deployment Options work and it actually looks pretty straight forward and requires the following three sections:
- Deployment Option Definitions
- Virtual Hardware Configurations
- Deployment Option Text
I have also provided a sample OVF called MyApp.ovf that you can download to see how these options work.
Deployment Option Definitions
The first section describes your Deployment Options, in the example below we use the words small, medium and large. You can change this text to be anything such as bronze, silver and gold. The only thing to note is the id and msgid which will need to be maped to section #2 and #3
<DeploymentOptionSection> <Info>The list of deployment options</Info> <Configuration ovf:id="small"> <Label ovf:msgid="config.small.label"/> <Description ovf:msgid="config.small.description"/> </Configuration> <Configuration ovf:id="medium"> <Label ovf:msgid="config.medium.label"/> <Description ovf:msgid="config.medium.description"/> </Configuration> <Configuration ovf:id="large"> <Label ovf:msgid="config.large.label"/> <Description ovf:msgid="config.large.description"/> </Configuration> </DeploymentOptionSection>
Virtual Hardware Configurations
The second section describes the virtual hardware configuration and uses a configuration parameter id that maps back to the original definition. In the example here, we are looking at the number of vCPU's the virtual appliance can be assigned with. For the initial default, you do not need to specify an entry, but for the others you will need to. Here I have a definition for medium and large and their respective vCPU configuration.
<Item> <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits> <rasd:Description>Number of Virtual CPUs</rasd:Description> <rasd:ElementName>1 virtual CPU(s)</rasd:ElementName> <rasd:InstanceID>1</rasd:InstanceID> <rasd:ResourceType>3</rasd:ResourceType> <rasd:VirtualQuantity>1</rasd:VirtualQuantity> </Item> <Item ovf:configuration="medium"> <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits> <rasd:Description>Number of Virtual CPUs</rasd:Description> <rasd:ElementName>2 virtual CPU(s)</rasd:ElementName> <rasd:InstanceID>1</rasd:InstanceID> <rasd:ResourceType>3</rasd:ResourceType> <rasd:VirtualQuantity>2</rasd:VirtualQuantity> </Item> <Item ovf:configuration="large"> <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits> <rasd:Description>Number of Virtual CPUs</rasd:Description> <rasd:ElementName>4 virtual CPU(s)</rasd:ElementName> <rasd:InstanceID>1</rasd:InstanceID> <rasd:ResourceType>3</rasd:ResourceType> <rasd:VirtualQuantity>4</rasd:VirtualQuantity> </Item>
Deployment Option Text
The final section contains the actual text you wish to display for each of your Deployment Configurations. You will see the msgid maps back to your definitions, so if you choose to change the wording, make sure these match up.
<Strings> <Msg ovf:msgid="config.small.label">Small</Msg> <Msg ovf:msgid="config.small.description">Use this configuration for small deployments. This deployment will need 1 vCPUs and 1024 Memory for the vApp.</Msg> <Msg ovf:msgid="config.medium.label">Medium</Msg> <Msg ovf:msgid="config.medium.description">Use this configuration for small deployments. This deployment will need 2 vCPUs and 2048 Memory for the vApp.</Msg> <Msg ovf:msgid="config.large.label">Large</Msg> <Msg ovf:msgid="config.large.description">Use this configuration for small deployments. This deployment will need 4 vCPUs and 4096 Memory for the vApp.</Msg> </Strings>
Though I have experienced Deployment Options while deploying vCenter Operations in the past, thinking about it more now, it is definitely something that can be useful for folks building virtual appliances. The really nice thing about this feature is it works when deploying to both a vCenter Server as well as a standalone ESXi host. Hopefully we will see more virtual appliances leveraging this neat feature of the OVF standard.
Just from curiousity... have you tried deploying to Fusion or Workstation to see if they support OVF Deployment Options? I'm pretty sure Fusion doesn't support OVF Properties, but Deployment Options are more basic, as they only affect hardware choices and don't interact with the software inside a VM, so it might be 'in there'.
Nice post William (as usual) ! 🙂
I think that you are missing some XML in the section "Virtual Hardware Configurations", between " < Item ; " and " < rasd : AllocationUnits > hertz * 10^6 < / rasd : AllocationUnits > ".
Thanks for the catch! I've fixed the XML by adding ">"
It's a really good reference to create flexible OVAs. But, I how one can add custom disk configuration i-e different disk size with differently sized OVA(small, medium, large)?
Thanks.
Still in IT? *protected email*
Hi William,
great post!
Please note that some of the basic links for ovf/ova, virtual appliance etc are dead.
Which links?
Hi William,
What tags do we use to support multiple IP protocols i.e IPv4 and IPv6, i want to dynamically change property names and validations depending upon user selection ?
Just trying to leverage some of the features VMware already provides.
Nice Blog !
Thanks
Hi
I am looking to deploy the OVF that you have provided here (MyApp.OVF), tried using vSphere web client, Right click Datacenter > Deploy OVF Template but it is giving me an error.
How can i deploy this template?
Thanks
Devi
The error is that it is not able to find the VMDK file MyApp-disk1.vmd
Do you need VMDF files using OVF template? Is there an option to deploy OVF file without a VMDK file?
-Devi
Hi Lam
How were you able to achieve such a small size VMDK files. I am getting VMDK files which are about 1. 5 GB
Thanks
Devi
Hi Lam,
Thanks for the great post.
I have created an ova with flexible deployment using "DeploymentOptionSection". It is working with ESXi 6.0.0.
But the ova is not working with my upgraded ESXi 6.5.0 host managed by vCenter 6.5 web client. version.
I am getting "Unable to process template" error when I try with vCenter web client.
Any idea on this ?
Thanks
It seems that DeploymentOptionSection is not working on ESXi 6.5 host.
Regarding "DeploymentOptionSection is not working on ESXi 6.5" is that your self conclusion or you get this info from official vmWare?
Gury, I have an ovf that contains a DeploymentOptionSection. I use that to allow a user to deploy one of several "sizes" of VMs. Each size has a different combination of vCPUs and memory. This works on vCenter deployments. And it works on standalone ESXi hosts, but only if I use the ovftool or thick client. For 6.5 hosts, the thick client is not supported, so I have to use the webclient. When I use the webclient to deploy on the standalone 6.5 host, the DeploymentOptionSection is ignored and the VM is deployed with the smallest size (1 vCPU, 1 GB memory). When I use ovftool on this same host, I can choose the DeploymentOption and it works fine. It's only the webclient that doesn't work. I think that this part of the webclient hasn't worked in quite a while, but my users only noticed when the thick client was no longer available.
Thank you for your detail response. we are also use the DeploymentOptionSection for the same purpose, and it's worked OK until i try it on the webclient for 6.5. good to know that this is a known problem.
i will try also to connect this host to a vCenter and hope it will work. Did you got the opportunity to test it via a vCenter? doe's it worked OK?
Updating the webclient to version 1.24.0 fixes the problem. DeploymentOptions now work on a standalone 6.5 host.
Hi Walter ,
we have similar problem in our environment where post VCSA 6.5 upgrade when we deploy OVF template using vsphere web client with larger size like 4 GB / 4CPU it throws "unable to process template" and we could not move further after this screen . Need to cancle the wizard and select smaller sizes like 2 GB /2 CPU and deploy .
In previous message you said "Updating the webclient to version 1.24.0 fixes the problem" what is this version for ?
can we have more than one deployment option in ovf template. Need to one more user configuration to deploy VM
after upgrading to webui 1.31 DeploymentOptions are available but does not work as expected. I get {"msgid":"config.Standard.description"} instead of the message itself. while it worked ok in 5.x . anybody else have this issue?
BTW, Same happen with the example in this post.
Is it possible to have multiple DeploymentOptionSection in the same ovf file and depending upon combination of those we can decide what to do. Or can if hierarchy is supported?
For example, something like this.
Option 1.
The list of deployment options
The list of deployment options
Option 2.
The list of deployment options
The list of deployment options
The list of deployment options
It won't let me post my xml example here. because of the tags. So can't provide it. but basically want to know if hierarchy is allowed or multiple DeploymentOptionSection in same file is allowed.