{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3875","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3875/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3875/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3875/events","html_url":"https://github.com/hashicorp/terraform/issues/3875","id":116505094,"number":3875,"title":"Google Cloud: Update instances on instance group when instance_template is changed","user":{"login":"premist","id":291078,"avatar_url":"https://avatars.githubusercontent.com/u/291078?v=3","gravatar_id":"","url":"https://api.github.com/users/premist","html_url":"https://github.com/premist","followers_url":"https://api.github.com/users/premist/followers","following_url":"https://api.github.com/users/premist/following{/other_user}","gists_url":"https://api.github.com/users/premist/gists{/gist_id}","starred_url":"https://api.github.com/users/premist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/premist/subscriptions","organizations_url":"https://api.github.com/users/premist/orgs","repos_url":"https://api.github.com/users/premist/repos","events_url":"https://api.github.com/users/premist/events{/privacy}","received_events_url":"https://api.github.com/users/premist/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/enhancement","name":"enhancement","color":"d4c5f9"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/google-cloud","name":"provider/google-cloud","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-12T08:55:47Z","updated_at":"2015-11-13T06:54:27Z","closed_at":null,"body":"On resource **google_compute_instance_group_manager**, you can specify `instance_template` resource for the instance group. When I modify **google_compute_instance_template** resource, associated **google_compute_instance_group_manager** is updated but its instances are not updated. I had to manually delete VM instances so Instance Group can recreate instances with new instance template. I can think two possible approach to this: \r\n\r\n#### 1. Recreate instances after updating instance-groups \r\n\r\nBy using [gcloud compute instance-groups managed recreate-instances](https://cloud.google.com/sdk/gcloud/reference/compute/instance-groups/managed/recreate-instances) after updating an instance group, you can trigger recreation of the instances. This is probably the easiest way to solve a problem, but instance group will have no active instances for a while, which is not ideal on production environment.\r\n\r\n#### 2. Use rolling update\r\n\r\nBy using [gcloud alpha compute rolling-updates start](https://cloud.google.com/sdk/gcloud/reference/alpha/compute/rolling-updates/start), you can gracefully retire old instances and create new instances. It has several flags that can be used to control the instance count and interval between each batch updates. We've used this command before we investigate Terraform, and it worked pretty well even though it's still in alpha state."},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/156343509","html_url":"https://github.com/hashicorp/terraform/issues/3875#issuecomment-156343509","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3875","id":156343509,"user":{"login":"premist","id":291078,"avatar_url":"https://avatars.githubusercontent.com/u/291078?v=3","gravatar_id":"","url":"https://api.github.com/users/premist","html_url":"https://github.com/premist","followers_url":"https://api.github.com/users/premist/followers","following_url":"https://api.github.com/users/premist/following{/other_user}","gists_url":"https://api.github.com/users/premist/gists{/gist_id}","starred_url":"https://api.github.com/users/premist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/premist/subscriptions","organizations_url":"https://api.github.com/users/premist/orgs","repos_url":"https://api.github.com/users/premist/repos","events_url":"https://api.github.com/users/premist/events{/privacy}","received_events_url":"https://api.github.com/users/premist/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T06:54:27Z","updated_at":"2015-11-13T06:54:27Z","body":"Thank you @lwander, it sounds like a good idea! Since we're testing Terraform on our new staging environment, I'll try out your PR locally to see if it works well."}}