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

Non-destructive update for machine-type change in google_compute_instance #728

Closed
gionn opened this issue Nov 13, 2017 · 8 comments · Fixed by #1005
Closed

Non-destructive update for machine-type change in google_compute_instance #728

gionn opened this issue Nov 13, 2017 · 8 comments · Fixed by #1005
Assignees

Comments

@gionn
Copy link

gionn commented Nov 13, 2017

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.

@danawillow
Copy link
Contributor

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.

@rosbo
Copy link
Contributor

rosbo commented Nov 13, 2017

One idea to handle this:

We could add an extra boolean field called something like allow_stopping_for_update. Defaults would be false. If the machine_type field is updated, the instance is running and allow_stopping_for_update is false, it would fail with an error message saying that allow_stopping_for_update should be enabled or something like that.

There is other properties I believe that we can update only if the instance is stopped. We could support update in the same fashion.

@gionn
Copy link
Author

gionn commented Nov 14, 2017

@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!

@fisabelle
Copy link

Does that duplicate #380 ?

@paddycarver
Copy link
Contributor

I think we could take a similar approach to hashicorp/terraform#11998 to make this work.

@ubschmidt2
Copy link
Contributor

@ubschmidt2
Copy link
Contributor

@danawillow

@ghost
Copy link

ghost commented Mar 29, 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 👉 [email protected]. Thanks!

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