Updating VM Manager

On Compute Engine you can manage the operating systems that are running on your virtual machines (VMs) by using VM Manager.

This page describes how to upgrade an existing setup of VM Manager to use the features available for OS inventory management (preview) and OS configuration management (preview).

Before you begin

Overview

To update your VM Manager setup, complete the following steps:

  1. Check the current version of the OS Config agent that is installed on your VMs. For more information about the OS Config agent versions, see the GoogleCloudPlatform/osconfig GitHub repository.
    • To use OS inventory management (preview), your VM must be running an OS Config agent version dated 20201110 or later.
    • To use OS configuration management (preview), your VM must be running an OS Config agent version dated 20210427 or later.
  2. If the version of your OS config agent does not support the new features, update the OS Config agent.

View OS Config agent version

If you have OS inventory management (earlier version) running on your VMs, you can check the OS Config agent version by running the following command:

gcloud compute instances os-inventory describe VM-NAME \
    --zone=ZONE

Replace the following:

  • VM-NAME: the name of your VM
  • ZONE: the zone where the VM is located

In the output, search for OSConfigAgentVersion.

OSConfigAgentVersion: 20210316.00-g1

In the preceding output snippet, the OS Config agent version is dated 20210316 (2021-03-16).

Update the OS Config agent

To update the OS Config agent, do one of the following:

Update OS packages

One method of updating the OS Config agent is to update the package for your operating system.

CentOS/RHEL

To update the agent on CentOS and RHEL operating systems, run the following command:

sudo yum update google-osconfig-agent

Debian

To update the agent on Debian operating systems, run the following commands:

sudo apt update
sudo apt install google-osconfig-agent

SLES

To update the agent on SLES, run the following command:

sudo zypper -n update google-osconfig-agent

To update the agent on SLES VMs, you can also do a reinstall of the agent using the Google-provided packages. To do an install using Google-provided packages, see Install the OS Config agent.

Ubuntu

To update the agent on Ubuntu operating systems, run the following commands:

sudo apt update
sudo apt install google-osconfig-agent

To update the agent on Ubuntu VMs, we recommend that you do a reinstall of the agent using the Google-provided packages. To do an install using Google-provided packages, see Install the OS Config agent.

Windows

To update the agent on Windows operating systems, run the following command:

googet update google-osconfig-agent

Run a patch job

Another method of updating the OS Config agent is by running a patch job and specifying the exclusive_packages flag. This patch job only updates the OS Config agent on the target VMs.

To set the target VMs, you need to specify an INSTANCE_FILTER. For more information about instance filters, see instance filters.

CentOS/RHEL

To update the agent for CentOS and RHEL VMs, run the following command:

gcloud compute os-config patch-jobs execute INSTANCE_FILTER \
    --yum-exclusive-packages=google-osconfig-agent

Debian

To update the agent for Debian VMs, run the following commands:

gcloud compute os-config patch-jobs execute INSTANCE_FILTER \
    --apt-exclusive-packages=google-osconfig-agent

SLES

To update the agent for SLES VMs, run the following command:

gcloud compute os-config patch-jobs execute INSTANCE_FILTER \
    --zypper-exclusive-packages=google-osconfig-agent

To update the agent on SLES VMs, you can also do a reinstall of the agent using the Google-provided packages. To do an install using Google-provided packages, see Install the OS Config agent.

Ubuntu

To update the agent for Ubuntu VMs, run the following commands:

gcloud compute os-config patch-jobs execute INSTANCE_FILTER \
    --apt-exclusive-packages=google-osconfig-agent

To update the agent on Ubuntu VMs, we recommend that you do a reinstall of the agent using the Google-provided packages. To do an install using Google-provided packages, see Install the OS Config agent.

Windows

To update the agent for Windows VMs, run the following command:

gcloud compute os-config patch-jobs execute INSTANCE_FILTER \
    --windows-exclusive-patches=google-packages