Skip to content

subnets_v2 update with is_external set to true fails #1063

@GrayScorpion82

Description

@GrayScorpion82

Issue

Nutanix Cluster Information

Prism Central Version: pc.7.3.0.5
AOS Version: 7.3.0.5

Terraform Version

Terraform: v1.14.2
Provider: registry.terraform.io/nutanix/nutanix v2.3.4

Affected Resources

  • nutanix_subnet_v2

Terraform Configuration Files

Create:

variable "cluster_ext_id" {
  description = "ext id of the cluster"
  type        = string
}

resource "nutanix_subnet_v2" "subnet" {
  name              = "tf_my_subnet"
  description       = "subnet VLAN managed by Terraform with IP pool"
  cluster_reference = var.cluster_ext_id
  subnet_type       = "VLAN"
  network_id        = 122
  is_external       = true
  ip_config {

    ipv4 {
      ip_subnet {
        ip {
          value = "192.168.0.0"
        }
        prefix_length = 24
      }
      default_gateway_ip {
        value = "192.168.0.1"
      }
      pool_list {
        start_ip {
          value = "192.168.0.20"
        }
        end_ip {
          value = "192.168.0.30"
        }
      }
    }
  }
}

output "subnet" {
  value = nutanix_subnet_v2.subnet
}

Update:

variable "subnet_ext_id" {
  description = "The ext id of a subnet"
  type        = string
}

resource "nutanix_subnet_v2" "subnet" {
  name        = "tf_my_updated_subnet"
  subnet_type = "VLAN"

  lifecycle {
    ignore_changes = [
      description,
      subnet_type,
      network_id,
      ip_config
    ]
  }
}

import {
  id = var.subnet_ext_id
  to = nutanix_subnet_v2.subnet
}

output "subnet" {
  value = nutanix_subnet_v2.subnet
}

Debug Output

2026-01-13T11:28:50.066+0100 [ERROR] vertex "nutanix_subnet_v2.subnet" error: error waiting for subnet (ZXJnb24=:8dc0dd09-f9da-4173-a1c1-856d2a02b76f) to update: error_detail: Failed to Update Subnet due to an invalid input parameter - Missing required field: network_address, progress_message: 100
╷
│ Error: error waiting for subnet (ZXJnb24=:8dc0dd09-f9da-4173-a1c1-856d2a02b76f) to update: error_detail: Failed to Update Subnet due to an invalid input parameter - Missing required field: network_address, progress_message: 100
│
│   with nutanix_subnet_v2.subnet,
│   on main.tf line 16, in resource "nutanix_subnet_v2" "subnet":
│   16: resource "nutanix_subnet_v2" "subnet" {
│
╵

Panic Output

Expected Behaviour

  • The name of the cluster should be updated

Actual Behaviour

  • Fails with the error above

CRUDI Operations

Create

✔️

Read

✔️

Update

Delete

✔️

Import

✔️

Steps To Reproduce

  1. Create separate main.tf files with the tf configs above.
  2. Issue terraform apply on the Create tf file
  3. Issue terraform apply on the Update tf file

Important Factors

Note that updates work when is_external is set to false.

Metadata

Metadata

Labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions