WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Quick Tip - Dynamic OVF input properties using DeploymentOptions

07.23.2021 by William Lam // Leave a Comment

I first talked about OVF DeploymentOptions back in 2013, which enables an OVF/OVA author to define a set of deployment profiles (e.g. small, medium, large) which then automatically translate to a pre-defined set of compute, network and storage configurations when deploying an OVF/OVA. There are a number VMware Appliances that takes advantage of this OVF capability, the most well known is the vCenter Server Appliance (VCSA) when it prompts you to select the size of the VCSA that you wish to deploy.


Now although the primary driver for DeploymentOptions is for having out of the box resource configurations when deploying an OVF/OVA, it can also be used to control which OVF properties are shown to end users for input based on the selected deployment option.

I recently had a need for this capability and it was only after taking another look at the OVF specification, did I realize this was possible through the use of DeploymentOptions. Below is a quick example on how you can control specific OVF properties. Imagine, we have three deployment options: Development, Stage and Production which maps to the following DeploymentOption IDs: dev, stage and prod

[Read more...]

Categories // Automation, OVFTool Tags // DeploymentOptionSection, ova, ovf

Deploy a truly dynamic OVF using Deployment Option based on the 4 Computes (CPU, Memory, Storage & Network)

12.04.2013 by William Lam // 4 Comments

After learning about the Dynamic Disks feature in OVF, I decided to revisit OVF Deployment Options again and investigate whether it was possible to include all four computes (CPU, Memory, Storage and Network) as part of the deployment option. What would be really nice is to have a flexible deployment option which allows a user to select a specific "size" or "configuration" based on their environment and the appropriate recommended compute (CPU, Memory, Storage and Network) will automatically be selected as part of the Virtual Appliance deployment.

Below is an example of what the three "Sizes" (Small, Medium and Big) could look like:

We could have easily changed "Size" to "Deployment Type" (Dev, Test, Prod) or any other definition for that matter since as this is just a string text and configuration mapping. To demonstrate the above configuration using OVF Deployment Options I have created a sample OVF called Dynamic-vGhetto-vApp.ovf that can be downloaded here.

To use the Dynamic-vGhetto-vApp.ovf example OVF, you will need to have access to a vCenter Server since the OVF Deployment Options feature is only available there. As part of the OVF deployment wizard, you should now see a new section for Deployment Options providing a drop down menu for a Small, Medium or Large deployment and can include a description for each configuration as seen in the screenshot below.

For the CPU/Memory section it is pretty straight forward on how it works and you can get more details by taking a look at this blog article here. For the Storage section we are leveraging the recetnly discovered feature of Dynamic Disks and you can refer to this article here for further details. The last compute that we have not taken a look at before is the Network section which will allows a user to assign a certain number of virtual network adapters based on the selected deployment option.

There are two parts to the Networking section, the first is the OVF network labels which are defined in the NetworkSection of the OVF descriptor as seen in the example below:

    <Network ovf:name="ManagementNetwork1">
      <Description>Management Network 1</Description>
    </Network>
    <Network ovf:name="DataNetwork">
      <Description>Data Network</Description>
    </Network>
    <Network ovf:name="ReplicationNetwork">
      <Description>Replication Network</Description>
    </Network>
    <Network ovf:name="ManagementNetwork2">
      <Description>Management Network 2</Description>
    </Network>

Each OVF network label is defined using the ovf:name property and that is then mapped to the appropriate virtual network adapter Item. To control the number of virtual network adapters for each deployment option, you will use the ovf:configuration property and specify the deployment type that are applicable for each virtual network adapter.

      <Item ovf:configuration="small medium large">
        <rasd:AddressOnParent>7</rasd:AddressOnParent>
        <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
        <rasd:Connection>ManagementNetwork1</rasd:Connection>
        <rasd:Description>VmxNet3 ethernet adapter on "Management Network 1"</rasd:Description>
        <rasd:ElementName>Network adapter 1</rasd:ElementName>
        <rasd:InstanceID>12</rasd:InstanceID>
        <rasd:ResourceSubType>VmxNet3</rasd:ResourceSubType>
        <rasd:ResourceType>10</rasd:ResourceType>
        <vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/>
      </Item>

You can refer to Dynamic-vGhetto-vApp.ovf for a complete working example of the Networking section.

One thing to note for the Networking section when selecting your Deployment Option is that ALL virtual network adapters will be shown in the UI, but you only need to specify the destination portgroup mapping for the OVF labels that will be provisioned for your particular configuration. I know this can be a little bit confusing but you can ignore the others. To give you a concrete example, the "Small" configuration only deploys the VM with a single virtual network adapter which maps to the "ManagementNetwork1" OVF label and this is the only destination portgroup mapping you need to specify, you can ignore the rest.

Here is a screenshot of the Virtual Machine configurations using a "Small" deployment:

Here is a screenshot of the Virtual Machine configurations using a "Medium" deployment:

Here is a screenshot of the Virtual Machine configurations using a "Large" deployment:

I think this is probably by far the coolest feature of OVF and I really hope to see more Virtual Appliances leverage this feature including appliances built from VMware. I would like to give a big thanks to Anders Madsen for helping me put the final two pieces of the puzzle together for Deployment Options leveraging all four computes.

Categories // Uncategorized Tags // deployment options, DeploymentOptionSection, dynamic disks, ova, ovf

Flexible OVF deployments using Deployment Options (e.g. small, medium, large)

08.19.2013 by William Lam // 28 Comments

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:

  1. Deployment Option Definitions
  2. Virtual Hardware Configurations
  3. 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.

Categories // Uncategorized Tags // deployment options, DeploymentOptionSection, ESXi, ovf, vSphere

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...