What is the appropriate action to ensure that all existing and future Compute Engine instances collect system logs?

Study for the Google Cloud DevOps Certification Test. Prepare with interactive quizzes and detailed explanations. Enhance your skills and boost your confidence!

Creating an Agent Policy using the gcloud CLI is the most effective way to ensure that all existing and future Compute Engine instances collect system logs. This method allows you to define a policy that automatically manages the installation of the Ops Agent across multiple instances, including those that are created in the future. It centralizes the management of agent installation, eliminating the need for manual installation or scripting for each instance.

Utilizing the gcloud CLI for this purpose also ensures consistency across your environment, as the agent is applied uniformly based on the policy you establish. This approach minimizes the risk of human error and oversight that can occur with manual processes, and it enables scalability, especially in dynamic environments where instances may be frequently created or destroyed.

In contrast, manually installing the Ops Agent on each VM or directly installing agents on VMs with specific statuses can become cumbersome and fail to ensure new instances are properly configured. Installing the Ops Agent through a startup script on the Compute Engine image may work for instances created from that specific image, but it does not provide a comprehensive solution for existing instances that were created prior to the script being added. The Agent Policy method leverages automation and centrally enforces standards, making it the optimal choice.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy