Google Associate Cloud Engineer Question 179
Select 3Google Cloud PlatformYou are a Google Cloud Associate Cloud Engineer tasked with viewing the current running VM instances in your project. Which of the following methods can you use to achieve this?
- A
Use the Google Cloud Console and navigate to the Compute Engine section under 'VM instances'.
- B
Execute the command 'gcloud compute instances list' in the Cloud Shell.
- C
Use the Google Cloud Console to navigate to the IAM & Admin section and filter for VM instances.
- D
Write a Python script that uses the Google Cloud Client Libraries to list VM instances using the compute.instances.list API method.
- E
Run the command 'gcloud projects list' to view the current running VM instances.
Show answer and explanation
Correct answers: A, B, D
Explanation
To view current running VM instances in Google Cloud, you can use the Google Cloud Console's Compute Engine section, the 'gcloud compute instances list' command in Cloud Shell, or programmatically access the Compute Engine API using client libraries. These methods allow you to efficiently manage and monitor your virtual machines.
- A. Correct.
This is a valid method as the Google Cloud Console provides a graphical interface to view all VM instances in the Compute Engine section.
- B. Correct.
This is a correct method. The 'gcloud compute instances list' command shows all VM instances in the project.
- C. Incorrect.
This is incorrect. The IAM & Admin section is used for managing identities and permissions, not for listing VM instances.
- D. Correct.
This is a valid method. The Google Cloud Client Libraries can be used to interact with the Compute Engine API programmatically.
- E. Incorrect.
This is incorrect. The 'gcloud projects list' command lists projects, not VM instances.