Google Associate Cloud Engineer Question 175
Select 3Google Cloud PlatformAs a Google Cloud Engineer, you need to generate a list of all currently running virtual machines in your Google Cloud Platform project. Which of the following methods can be used to achieve this task?
- A
Use the Google Cloud Console to view the VM instances page and filter by status 'Running'.
- B
Execute the command 'gcloud compute instances list --filter='status=RUNNING'' in the Cloud Shell.
- C
Query the Compute Engine API with a request to list instances and filter by the 'RUNNING' status.
- D
Use Google Cloud Deployment Manager to create a deployment template that lists running instances.
- E
Utilize Google Cloud Functions to automatically detect and log running VMs.
Show answer and explanation
Correct answers: A, B, C
Explanation
To view the current running VM inventory in a Google Cloud Platform project, you can use the Google Cloud Console, the gcloud command-line tool, or the Compute Engine API. Each of these methods provides a way to filter and identify instances with the 'Running' status, which is essential for monitoring and managing cloud resources effectively.
- A. Correct.
The Google Cloud Console provides an interface to view all VM instances, and you can filter the list to show only those with a 'Running' status.
- B. Correct.
The 'gcloud compute instances list --filter='status=RUNNING'' command lists all instances currently in the running state in the specified project.
- C. Correct.
The Compute Engine API can be used to programmatically request the list of instances and apply filters to identify those that are running.
- D. Incorrect.
Google Cloud Deployment Manager is used for deploying resources in a declarative manner, not for listing running instances.
- E. Incorrect.
Google Cloud Functions are event-driven serverless functions and are not used for listing or managing VM instances directly.