简体   繁体   中英

How to fetch instances of instance groups for a managed instance group with multi-zone configuration

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?

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.

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