简体   繁体   中英

Google Cloud Platform Add Instance To Managed Instance Group

It seems like the managed instance groups in the Google Cloud console should be a nice thing to use as an easy way to scale or add / remove instances. What I don't get is how to create a new instance and add it to that group? I can modify the number of instances in the Edit Group Settings page and it will create a new instance and add it to the group but I don't want a new instance automatically up and going in the group. I need to create an instance, bootstrap it, run chef-client, etc and validate that all is fine before I want the instance available in the group.

The only way I can seem to do this is to use unmanaged instance groups. This allows me to create an instance and then add it to a group.

Is there a way to do what I need using managed instance groups, since that's what Google recommends to use?

It sounds like you're trying to achieve two contradictory things:

  1. Have Google Cloud automatically manage your instances (via a managed instance group), and
  2. Manage your instances yourself (by manually starting instances, installing software on them, validating them etc)

You can't do both. You need to choose which of the above two things you want to achieve. If it's #1 that you're after, you need to have your instances come up without manual intervention (there are various different ways to achieve this). If it's #2 you're after, you should use unmanaged, not managed instance groups. The documentation is quite clear about this:

https://cloud.google.com/compute/docs/instance-groups/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM