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 boot disk cause destroy and recreate VM #12124

Closed
shumak80 opened this issue Jul 19, 2022 · 8 comments
Closed

Resize boot disk cause destroy and recreate VM #12124

shumak80 opened this issue Jul 19, 2022 · 8 comments
Labels

Comments

@shumak80
Copy link

shumak80 commented Jul 19, 2022

Terraform Version

Terraform v1.2.2

Affected Resource(s)

  • google_compute_instance

Terraform Configuration Files

resource "google_compute_instance" "default" {
name = "vm1"
machine_type = "e2-standard-2"
zone = "europe-west3-a"

boot_disk {
initialize_params {
image = "debian-cloud/debian-10"
size = "20"
type = "pd-standard"
}
}
network_interface {
subnetwork = "default"
}
}

Expected Behavior

GCP provider support resize of disk without destroy/recreate the instance.

Actual Behavior

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
  2. change size of the disk to 25
  3. terraform apply

Important Factoids

References

This issue was already solved in #861 , but it was for resource google_compute_disk.

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 the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.
@shumak80 shumak80 added the bug label Jul 19, 2022
@edwardmedia edwardmedia self-assigned this Jul 19, 2022
@edwardmedia
Copy link
Contributor

@shumak80 did you notice the discussion in #8597 Is that relevant?

@shumak80 shumak80 changed the title Resize boot disk destroy and recreate VM Resize boot disk cause destroy and recreate VM Jul 22, 2022
@shumak80
Copy link
Author

@edwardmedia It's not related to #8597 ... #8597 is about downsize disk. My case is about increase size of disk. It can be done without any changes to VM instance.

@edwardmedia
Copy link
Contributor

@shumak80 That is the boot_disk, right? Where did you see you can resize the boot_disk without recreation?

@shumak80
Copy link
Author

@edwardmedia It's a common thing ... you can read about this here. Even you can try it via console. If you create a boot disk as separate resource and use it as source for boot disk, then you are able to resize boot disk without re-creation.

@shuyama1
Copy link
Collaborator

shuyama1 commented Jul 27, 2022

It seems that in-place update for this field is not yet supported when the feature was implemented. Making it updatable is a feature request and marking this issue as enhancement then.

@shuyama1 shuyama1 added enhancement and removed bug labels Jul 27, 2022
@edwardmedia edwardmedia removed their assignment Jul 27, 2022
@shumak80
Copy link
Author

Ok. Then it should be mentioned in terraform documentation. To warn everybody that this feature is not ready yet.

@rileykarson
Copy link
Collaborator

See #6087 for prior discussion on the matter, mostly #6087 (comment). initialize_params indicates "I want the instance to have been created with these properties" meaning that recreating it when changed is the expected behaviour of the provider.

@github-actions
Copy link

github-actions bot commented Sep 8, 2022

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants