vmware / vmware/pyvmomi

Parsing OVFs with ovf:value="0" results in invalid property values

Open
#832 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs verification
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

pyvmomni version: v6.7.1.2018-12
python version: v3.6.6

After running ParseDescriptor on an OVF and print out the result I get the following error.

DEBUG:virtutils.vmware:(vim.OvfManager.ParseDescriptorResult) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   eula = (str) [],
   network = (vim.OvfManager.NetworkInfo) [],
   ipAllocationScheme = (str) [],
   ipProtocols = (str) [],
   property = (vim.vApp.PropertyInfo) [],
   productInfo = <unset>,
   annotation = '',
   approximateDownloadSize = <unset>,
   approximateFlatDeploymentSize = <unset>,
   approximateSparseDeploymentSize = <unset>,
   defaultEntityName = '',
   virtualApp = false,
   deploymentOption = (vim.OvfManager.DeploymentOption) [],
   defaultDeploymentOption = '',
   entityName = (vim.KeyValue) [],
   annotatedOst = <unset>,
   error = (vmodl.MethodFault) [
      (vim.fault.OvfPropertyValue) {
         dynamicType = <unset>,
         dynamicProperty = (vmodl.DynamicProperty) [],
         msg = "Line 42: Invalid property value '0'.",
         faultCause = <unset>,
         faultMessage = (vmodl.LocalizableMessage) [],
         lineNumber = 42,
         type = 'int(0..2147483647)',
         value = '0'
      }
   ],
   warning = (vmodl.MethodFault) []
}

Line 42 of the OVF looks as follow

      <Property ovf:key="elasticsearch.disk.size" ovf:qualifiers="MinValue(0)" ovf:type="int"  ovf:userConfigurable="true" ovf:value="0">

In this case, 0 is a valid value (and deploying to the same rig through the UI doesn't show any errors).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing ParseDescriptor handling of OVF property values and validation of the MinValue(0) qualifier, using the line 42 example to reproduce the failure. Done means an ovf:type="int" property with ovf:value="0" and MinValue(0) is accepted without an invalid property error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.