Skip to content

Allow updating GCE VM’s external ipv6 address without VM recreation #25324

@JamesRaynor67

Description

@JamesRaynor67

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Description

At this moment, updating GCE VM’s external ipv6 address leads to VM recreation while updating via console web UI doesn't.
Details in internal issue tracker: b/463822798

New or Affected Resource(s)

  • google_compute_instance

Potential Terraform Configuration

resource "google_compute_network" "test-vpc-net" {
 name                     = "vpc-network-dual-stack-ipv6"
 auto_create_subnetworks  = false
 enable_ula_internal_ipv6 = true
}


resource "google_compute_subnetwork" "subnet_dual_stack" {
 name             = "subnet-dual-stack"
 ip_cidr_range    = "10.0.0.0/22"
 region           = "us-central1"
 stack_type       = "IPV4_IPV6"
 ipv6_access_type = "EXTERNAL"
 network          = google_compute_network.test-vpc-net.id
}


resource "google_compute_address" "old_static_external_ipv6" {
 name   = "test-new-ipv6-address"
 region = "us-central1"
 subnetwork = google_compute_subnetwork.subnet_dual_stack.id
 ip_version = "IPV6"
 address = "2600:1900:4000:d660:0:1::"
 ipv6_endpoint_type = "VM"
}


resource "google_compute_address" "new_static_external_ipv6" {
 name   = "test-old-ipv6-address"
 region = "us-central1"
 subnetwork = google_compute_subnetwork.subnet_dual_stack.id
 ip_version = "IPV6"
 address = "2600:1900:4000:d660:0:2::"
 ipv6_endpoint_type = "VM"
}


resource "google_compute_instance" "test-vm" {
 name          = "test-vm"
 machine_type  = "n1-standard-1"
 zone          = "us-central1-a"


 boot_disk {
   initialize_params {
     image = "debian-cloud/debian-11"
     size  = 200
   }
 }


 network_interface {
   network    =  google_compute_network.test-vpc-net.id
   subnetwork =  google_compute_subnetwork.subnet_dual_stack.id
   stack_type = "IPV4_IPV6"
  
   ipv6_access_config {
     external_ipv6 = google_compute_address.old_static_external_ipv6.address
     # update to `external_ipv6 = google_compute_address.old_static_external_ipv6.address` triggers VM recreation

     external_ipv6_prefix_length = 96
     name = "test-vm-ipv6-name"
     network_tier = "PREMIUM"
   }
 }
}

While console web UI is able to update it without VM creation by call API beta.compute.instances.updateNetworkInterface.

References

Field external_ipv6 is marked as forceNew https://github.com/hashicorp/terraform-provider-google/blob/main/google/services/compute/resource_compute_instance.go#L750C11-L750C24, meaning any modification will cause a recreate. https://googlecloudplatform.github.io/magic-modules/best-practices/immutable-fields/

b/467075908

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions