I recently started using managed instance group with multi zone configuration. When i use GCE api to fetch instances for this instance groups zone is a required parameter. For a managed instance group with instances in multiple zone instance group does not belong to one zone. how do i fetch instances in this case?
How to fetch instances of instance groups for a managed instance group with multi-zone configuration
Asked
Active
Viewed 697 times
2
-
Can you show what you have tried already or what code is currently working for you? – ooXei1sh Aug 06 '16 at 01:13
1 Answers
2
What API or gcloud command are you using to list the instances? I guess you are using the instanceGroups.listInstances API, but for regional instance group, you need to use regionInstanceGroupManagers.listManagedInstances, or the corresponding gcloud command:
$ gcloud beta compute instance-groups managed list-instances instance-group-1 --region us-central1
NAME ZONE STATUS ACTION LAST_ERROR
instance-group-1-mk4j us-central1-b RUNNING NONE
instance-group-1-xnyk us-central1-c RUNNING NONE
instance-group-1-g23r us-central1-f RUNNING NONE
Note that this feature is still in beta.

Dagang
- 24,586
- 26
- 88
- 133
-
um, it seems like you are basically saying "you can not get a list of regional instance groups". as you are instead showing how to list instances in that group. – JasonS Sep 29 '16 at 21:20