
Answer-first summary for fast verification
Answer: Delete the instance, set the correct project in the core configuration, then recreate the instance.
The correct sequence involves deleting the instance from the current project, setting the correct project in the core configuration (not the compute section, as attempted in option C), and then recreating the instance. Option A fails to change the project setting, resulting in the instance being recreated in the same wrong project. Option B attempts to use a 'recreate' command that does not exist. Option C incorrectly tries to set the project in the compute section, which is not where the project property is defined. The correct approach is outlined in option D, ensuring the instance is created in the intended project.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You created a compute instance named 'instance1' using the command gcloud compute instances create instance1. However, instead of creating it in the intended project 'gcp-ace-proj-266520', it was created in a different project. Your current gcloud configuration in cloud shell is as follows:
$ 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
What steps should you take to delete the instance from the wrong project and recreate it in the correct project 'gcp-ace-proj-266520'?
A
Delete the instance and recreate it without changing the project setting.
B
Change the project setting to the correct one and use a non-existent 'recreate' command.
C
Delete the instance, attempt to set a non-existent compute/project property, then recreate the instance.
D
Delete the instance, set the correct project in the core configuration, then recreate the instance.