-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Non-destructive update for machine-type change in google_compute_instance #728
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
Comments
It looks like the console requests that you manually stop the instance before resizing, I don't see it happening automatically. Regardless, https://cloud.google.com/compute/docs/reference/latest/instances/setMachineType should easy enough for us to add support for, but I'm wary about stopping the instance to do so (at least in the beginning) since that could be unexpected behavior for the user. |
One idea to handle this: We could add an extra boolean field called something like There is other properties I believe that we can update only if the instance is stopped. We could support update in the same fashion. |
@danawillow you are right and I lied, I've applied a resource resize tip on the console instead (via the yellow lightbulb that appear saying that you can save money changing machine-type), I supposed the standard resize behaviour was the same. @rosbo it would be great. FYI, manual resize didn't break anything in terraform, since at the next state refresh it will find the updated machine-types, so as workaround is fine. Thanks! |
Does that duplicate #380 ? |
I think we could take a similar approach to hashicorp/terraform#11998 to make this work. |
The same applies to changes to the assigned service account and the API scopes (e.g. https://github.com/terraform-providers/terraform-provider-google/blob/2a6974451838133bd89ac8e40d09285f91d6da61/google/resource_compute_instance.go#L483). |
Signed-off-by: Modular Magician <[email protected]>
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 👉 [email protected]. Thanks! |
Hi, it would be great if changing the machine-type will trigger a workflow where the instance is stopped, resized and started instead of recreating the VM.
This behaviour is what GCP do via console when a resize is requested.
The text was updated successfully, but these errors were encountered: