Say I want to update the server for a running instance group, I have to create a new image from another instance and then create an instance template from that image and then run a rolling update on the instance group. That's an a lot of steps to do minor changes to my managed instances. Is there a less tedious/slow way to do updates to running managed instance groups?
1 Answers
Please note managed instances are based on instance template so you can not skip the step of updating it.
If you need configuration changes on all instances or a limited number of instances under the managed instance group, a rolling update is the best automated solution. With the rolling update, you can choose various options like how many instances can be taken offline for the update, whether the update affects all or just a segment of instances, and so on. You can find the detailed description in this article.
Without rollout update, a new configuration must be deployed either by creating a new managed instance group with a new version, requiring additional set up each time or through a manual, user-initiated, instance-by-instance recreate. Both of these approaches require significant manual steps. But for a minor configuration on the limited number of instances, you can still opt for manual, user-initiated configuration if that is really time-saving than the rolling update. However, if something fails in the instance it gets recreated with the original template configuration.

- 187
- 7
-
Maybe the best workaround would be just scripting the process up to make it automated & so you don't have to use the browser to do it. – spracketchip Dec 06 '17 at 21:22
-
Instead of browser, you can use gcloud command to [create template](https://cloud.google.com/compute/docs/instance-templates/create-instance-templates) and [managed instance group](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances#create_managed_group). – D Saini Dec 08 '17 at 14:44
-
yes, perhaps better than that would be to just have a startup script pull the latest code so I can simply restart an instance in the group to have it load the newest code from git – spracketchip Dec 08 '17 at 19:49
-
You can use startup scripts for your configuration and that will required system restart every time to implement. Nevertheless, it is up to user to choose the best option available as per their requirements. – D Saini Dec 11 '17 at 15:20