Problem
You host your virtual machines on Compute Engine, and you need a method for patching all the operating systems at once.
Solution
Using OS patch management with VM Manager, create a patch job to patch your fleet of Linux virtual machines.
- You will need at least one Linux virtual machine running on Compute Engine to continue with this recipe.
- Sign in to Google Cloud Console and launch Cloud Shell.
- To have Compute Engine manage your operating systems, you will need to install and configure VM Manager and run the following commands to enable operating system management for all your virtual machines, replacing the PROJECT_ID with your Google Cloud project ID:
gcloud compute project-info add-metadata \
--project PROJECT_ID \
--metadata=enable-osconfig=TRUE
gcloud compute project-info add-metadata \
--project PROJECT_ID \
--metadata=enable-guest-attributes=TRUE,enable-osconfig=TRUE
- Using the Cloud Shell SSH browser, connect to one of your instances to validate that the OS Config Agent is installed, and run the following command:
sudo systemctl status google-osconfig-agent
- If the agent is running, you should see an output with the following statement:
active (running)
- In the Google Cloud Console, navigate to Compute Engine > VM Manager > OS Patch Management.
OS patch management also supports Windows virtual machines.