ASSOCIATE-CLOUD-ENGINEER · Question #61
A cloud engineer has been assigned to work on a running project. He wants to know which VMs are running in the project. How could the cloud engineer get the information of the all VMs running in the p
The correct answer is D. Execute the command gcloud compute instances list. This question asks for the correct gcloud command to list all running VM instances within a Google Cloud project.
Question
Options
- AExecute the command gcloud compute list
- BExecute the command gcloud list instances
- CExecute the command gcloud instances list
- DExecute the command gcloud compute instances list
How the community answered
(22 responses)- B5% (1)
- C9% (2)
- D86% (19)
Why each option
This question asks for the correct gcloud command to list all running VM instances within a Google Cloud project.
`gcloud compute list` is an incomplete and incorrect command syntax for listing instances.
`gcloud list instances` is an incorrect command syntax; the `compute` subcommand and `instances` resource type are missing in the correct order.
`gcloud instances list` is an incorrect command syntax as it omits the `compute` subcommand required for Compute Engine operations.
The command `gcloud compute instances list` is the correct and standard method to retrieve a list of all Compute Engine VM instances in a Google Cloud project using the gcloud CLI.
Concept tested: GCP Compute Engine Instances Listing
Source: https://cloud.google.com/sdk/gcloud/reference/compute/instances/list
Topics
Community Discussion
No community discussion yet for this question.