How to configure vApp properties in Terraform where ovf:userConfigurable="false"

786 views Asked by At

The vapp properties which are set as ovf:userConfigurable="false" are unable to be configured when deploying to vSphere through Terraform.

Ovftool has an option -X EnableHiddenProperties which allows such properties to be edited, when deploying through PowerShell etc. Is there be a way to do the same with Terraform?

Configuration in .tf file:

terraform {
  required_providers {
    vsphere = {
      source  = "hashicorp/vsphere"
      version = ">= 2.0.2"
    }
  }
  required_version = ">= 1.0.10"
}

provider "vsphere" {
  ...
}

## Local OVF/OVA Source
data "vsphere_ovf_vm_template" "ovfLocal" {
  name              = "uagterraformdeploy"
   ...
}

## Deployment of VM from Local OVF
resource "vsphere_virtual_machine" "vmFromLocalOvf" {
  name = "uagterraformdeploy"
  ...
  vapp {
    properties = {
      "prop1" = "value1",
      "prop2" = "value2",
    }
  }
}

Corresponding configuration in .ovf file:


      <Property ovf:key="prop1" ovf:type="string" ovf:userConfigurable="false">
        <Label>Prop 1</Label>
        <Description> ... </Description>
      </Property>
      <Property ovf:key="prop2" ovf:type="string" ovf:userConfigurable="false">
        <Label>Prop 2</Label>
        <Description> ... </Description>
      </Property>

The following error is seen:

Error: error while creating vapp properties config vApp property with userConfigurable=false specified in vapp.properties: [prop1]

0

There are 0 answers