
Explanation:
The correct approach involves either changing the default compute/zone property to europe-west2-b before creating the second instance or specifying the zone directly in the create command for the second instance. The first option (A) would create both instances in europe-west2-a because it doesn't change the default zone or specify a different zone for the second instance. Option D and E attempt to change the default zone but use incorrect syntax (zone instead of compute/zone in D and configuration set instead of config set in E). Options B and C correctly address the requirement by either updating the default zone to europe-west2-b before creating the second instance (B) or specifying europe-west2-b as the zone for the second instance directly in the create command (C).
Ultimate access to all questions.
No comments yet.
You are working in Cloud Shell with the following active gcloud configuration:
$ gcloud config list
[component_manager]
disable_update_check = True
[compute]
gce_metadata_read_timeout_sec = 5
zone = europe-west2-a
[core]
account = gcp-ace-lab-user@gmail.com
disable_usage_reporting = False
project = gcp-ace-lab-266520
[metrics]
environment = devshell
$ gcloud config list
[component_manager]
disable_update_check = True
[compute]
gce_metadata_read_timeout_sec = 5
zone = europe-west2-a
[core]
account = gcp-ace-lab-user@gmail.com
disable_usage_reporting = False
project = gcp-ace-lab-266520
[metrics]
environment = devshell
Your task is to create two compute instances – one in europe-west2-a and another in europe-west2-b. Which two commands should you use?
A
gcloud compute instances create instance1
gcloud compute instances create instance2
gcloud compute instances create instance1
gcloud compute instances create instance2
B
gcloud compute instances create instance1
gcloud config set compute/zone europe-west2-b
gcloud compute instances create instance2
gcloud compute instances create instance1
gcloud config set compute/zone europe-west2-b
gcloud compute instances create instance2
C
gcloud compute instances create instance1
gcloud compute instances create instance2 --zone=europe-west2-b
gcloud compute instances create instance1
gcloud compute instances create instance2 --zone=europe-west2-b
D
gcloud compute instances create instance1
gcloud config set zone europe-west2-b
gcloud compute instances create instance2
gcloud compute instances create instance1
gcloud config set zone europe-west2-b
gcloud compute instances create instance2
E
gcloud compute instances create instance1
gcloud configuration set compute/zone europe-west2-b
gcloud compute instances create instance2
gcloud compute instances create instance1
gcloud configuration set compute/zone europe-west2-b
gcloud compute instances create instance2