Skip to content

Template update : attribute "template_vm_reference" does not coexist with "template_version_reference" #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
EdenCore opened this issue Apr 28, 2025 · 0 comments

Comments

@EdenCore
Copy link

Nutanix Cluster Information

Terraform Version

  • Terraform v1.9.1
  • Nutanix provider v2.2.0

Affected Resource(s)

  • nutanix_template_v2

Terraform Configuration Files

resource "nutanix_template_v2" "new_template_version" {
  for_each      = local.template_data  // A map containing existing templates information
  template_name = each.value.template_name

  template_version_spec {
    version_name        = each.value.template_version
    version_description = each.value.template_description
    is_active_version   = each.value.is_active_version

    version_source {
      template_version_reference {
        override_vm_config {}
        version_id = each.value.template_ext_id
      }

      template_vm_reference {
        ext_id = each.value.vm_ext_id  // This VM exists
      }
    }
  }
}

Gist

https://gist.github.com/EdenCore/fd3eb1c6d4a50318a6fc9871b09f08ed

Expected Behavior

Same behavior as in the example code in the Nutanix Terraform Provider documentation (my code looks functionally identical to the example) :

to update template and override the existing configuration, we will use template_version_reference

Actual Behavior

Terraform plan works. But Terraform apply fails. See the gist of Terraform plan.

Steps to Reproduce

  1. Create a Nutanix template. Keep the VM just in case.
  2. Use the code in the section "Terraform Configuration Files" to create a new template version referencing the previously created template and the same VM.
  3. Run terraform plan.

Important Factors

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant