Skip to content
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

Resize disk destroy and recreate vm #861

Closed
amarlot opened this issue Dec 14, 2017 · 2 comments · Fixed by #884
Closed

Resize disk destroy and recreate vm #861

amarlot opened this issue Dec 14, 2017 · 2 comments · Fixed by #884
Assignees

Comments

@amarlot
Copy link

amarlot commented Dec 14, 2017

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

v0.10.7

Affected Resource(s)

Please list the resources as a list, for example:

  • google_compute_disk
  • google_compute_instance

Terraform Configuration Files

resource "google_compute_disk" "disk" {
name = "disk"
type = "pd-standard"
zone = "europe-west1-b"
size = "50"
image = "debian-cloud/debian-8"
}

resource "google_compute_instance" "vm" {
name = "vm"
machine_type = "n1-standard-1"
zone = "europe-west1-b"

boot_disk {
source ="${google_compute_disk.disk.self_link}"
}

network_interface {
subnetwork = "default"

}

service_account {
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
}
min_cpu_platform="Intel Skylake"

}

Expected Behavior

From what I saw there : hashicorp/terraform#15077, GCP provider support resize of disk without delete/recreate the instance.

Actual Behavior

When i re-run the script with size = "70". The VM is deleted and recreated.
GCP is able to resize the disk on the fly even boot disk so I expect to have the size increased but without deleting re-creating the VM.

Steps to Reproduce

  1. terraform apply on the script above
  2. change size of the disk to 70
  3. terraform apply

References

hashicorp/terraform#15077

@rosbo
Copy link
Contributor

rosbo commented Dec 20, 2017

Hi,

Resizing disk while the instance is running is already supported. The problem came from a diff in the image field causing a ForceNew.

image:                      "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20171213" => "debian-cloud/debian-8" (forces new resource)

I opened a PR to fix this.

modular-magician pushed a commit to modular-magician/terraform-provider-google that referenced this issue Sep 27, 2019
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants