An infrastructure team manages a workload running on Compute Engine virtual machines that requires autoscaling based on system memory utilization. Currently, Cloud Monitoring only displays default hypervisor-level metrics, which do not include internal RAM usage. Which action should the team take to collect guest memory metrics and enable autoscaling for the instance group?
- Install the Google Cloud Ops Agent on the virtual machines, and configure the autoscaling policy using the memory metrics exported to Cloud Monitoring.Answer
- BInstall the legacy Stackdriver Monitoring Agent on the virtual machines to enable hypervisor-level memory reporting without configuring custom metrics.
- CGrant the Compute Admin primitive role to the VM default service account so Cloud Monitoring can inspect guest memory directly.
- DConvert the instances to Spot VMs, which natively expose guest memory metrics to hypervisor monitoring without additional agent software.
Answer
Install the Google Cloud Ops Agent on the virtual machines, and configure the autoscaling policy using the memory metrics exported to Cloud Monitoring.
Hypervisor metrics natively collected by Compute Engine do not include internal operating system details like memory usage. To collect RAM utilization, the Google Cloud Ops Agent must be installed inside the guest OS. This agent streams telemetry to Cloud Monitoring, allowing the Managed Instance Group (MIG) autoscaler to scale based on memory utilization.
Step-by-Step Solution
Key Concept
Managing Compute Engine Resources with Telemetry and Autoscaling