01 Run projects list command (Windows/macOS/Linux) using custom query filters to list the IDs of all the Google Cloud Platform (GCP) projects available in your Google Cloud account:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
gcloud projects list
--format="table(projectId)"
02 The command output should return the requested GCP project identifiers (IDs):
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
PROJECT_ID
cc-project5-stack-123123
cc-bigdata-project-112233
03 Run compute instance-groups list command (Windows/macOS/Linux) using the ID of the GCP project that you want to examine as the identifier parameter and custom query filters to describe the name of each Managed Instance Group (MIG) created for the selected project:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
gcloud compute instance-groups list
--project cc-project5-stack-123123
--only-managed
--format="table(name)"
04 The command output should return the name(s) of the existing instance group(s):
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
cc-web-instance-group
cc-dev-instance-group
05 Run compute instance-groups managed describe command (Windows/macOS/Linux) using custom query filters to list the name of each zone included in the distribution policy configured for the selected instance group:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
gcloud compute instance-groups managed describe cc-web-instance-group
--format="json(distributionPolicy.zones)"
06 The command output should return the requested zone names (full names/URLs):
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
null
If the
compute instance-groups managed describe command output returns
null, as shown in the example above, there is no distribution policy configured for the instance group, therefore the selected Managed Instance Group (MIG) is not configured to run instances across multiple zones.
07 Repeat steps no. 5 and 6 for each Managed Instance Group available in the selected project.
08 Repeat steps no. 3 – 7 for each GCP project deployed in your Google Cloud Platform (GCP) account.