Google Cloud Professional Cloud Developer — Question 343

You are developing a custom job scheduler that must have a persistent cache containing entries of all Compute Engine VMs that are in a running state (not deleted, stopped, or suspended). The job scheduler checks this cache and only sends jobs to the available Compute Engine VMs in the cache. You need to ensure that the available Compute Engine instance cache is not stale. What should you do?

Answer options

Correct answer: B

Explanation

The correct answer is B because setting up a real-time feed in Cloud Asset Inventory allows for immediate insert and delete event notifications for Compute Engine instances, ensuring that the cache reflects the current state of the instances. The other options either involve querying logs that may not provide real-time updates (A, C, D) or are less efficient for maintaining an accurate cache for running instances.