Your organization wants to collect system logs that will be used to generate dashboards in Cloud Operations for their Google Cloud project. You need to configure all current and future Compute Engine instances to collect the system logs, and you must ensure that the Ops Agent remains up to date. What should you do?
A. Use the gcloud CLI to install the Ops Agent on each VM listed in the Cloud Asset Inventory,
B. Select all VMs with an Agent status of Not detected on the Cloud Operations VMs dashboard. Then select Install agents.
C. Use the gcloud CLI to create an Agent Policy.
D. Install the Ops Agent on the Compute Engine image by using a startup script
Disclaimer
This is a practice question. There is no guarantee of coming this question in the certification exam.
Answer
C
Explanation
A. Use the gcloud CLI to install the Ops Agent on each VM listed in the Cloud Asset Inventory.
(It suggests using the gcloud CLI to install the Ops Agent on each VM manually, which can be time-consuming and error-prone, especially when dealing with a large number of instances.)
B. Select all VMs with an Agent status of Not detected on the Cloud Operations VMs dashboard. Then select Install agents.
(It cannot cover future instances.)
C. Use the gcloud CLI to create an Agent Policy.
(https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/managing-agent-policies
It will ensure the installation will be done in the future as well.)
D. Install the Ops Agent on the Compute Engine image by using a startup script.
(It cannot cover future instances. As, it’s not using Compute Engine templates.)