Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Sur Compute Engine, vous pouvez gérer les systèmes d'exploitation qui s'exécutent sur vos machines virtuelles (VM) à l'aide de VM Manager.
Cette page explique comment mettre à niveau une configuration existante de VM Manager.
Google vous recommande d'utiliser la dernière version de l'agent.
Avant de commencer
Si ce n'est pas déjà fait, configurez l'authentification.
L'authentification valide votre identité pour accéder aux services et aux API Google Cloud . Pour exécuter du code ou des exemples depuis un environnement de développement local, vous pouvez vous authentifier auprès de Compute Engine en sélectionnant l'une des options suivantes :
Installez la Google Cloud CLI.
Une fois que la Google Cloud CLI est installée, initialisez-la en exécutant la commande suivante :
Pour mettre à jour l'agent sur SLES, exécutez la commande suivante :
sudo zypper -n update google-osconfig-agent
Pour mettre à jour l'agent sur les VM SLES, vous pouvez également réinstaller l'agent à l'aide des packages fournis par Google. Pour effectuer une installation à l'aide de packages fournis par Google, consultez la section Installer l'agent de configuration du système d'exploitation.
Ubuntu
Pour mettre à jour l'agent sur les systèmes d'exploitation Ubuntu, exécutez les commandes suivantes:
Pour mettre à jour l'agent sur les VM Ubuntu, nous vous recommandons de réinstaller l'agent à l'aide des packages fournis par Google. Pour effectuer une installation à l'aide de packages fournis par Google, consultez la section Installer l'agent de configuration du système d'exploitation.
Windows
Pour mettre à jour l'agent sur les systèmes d'exploitation Windows, exécutez la commande suivante :
googet install google-osconfig-agent
Exécuter un job d'application de correctifs
Une autre méthode de mise à jour de l'agent OS Config consiste à exécuter une tâche d'application de correctifs et à spécifier l'option exclusive_packages. Cette tâche d'application de correctifs ne met à jour que l'agent OS Config sur les VM cibles.
Pour définir les VM cibles, vous devez spécifier un INSTANCE_FILTER.
Pour en savoir plus sur les filtres d'instances, consultez la section Filtres d'instances.
CentOS/RHEL/Rocky
Pour mettre à jour l'agent pour les VM CentOS, Rocky Linux et RHEL, exécutez la commande suivante :
Pour mettre à jour l'agent sur les VM SLES, vous pouvez également réinstaller l'agent à l'aide des packages fournis par Google. Pour effectuer une installation à l'aide de packages fournis par Google, consultez la section Installer l'agent de configuration du système d'exploitation.
Ubuntu
Pour mettre à jour l'agent pour les VM Ubuntu, exécutez les commandes suivantes:
Pour mettre à jour l'agent sur les VM Ubuntu, nous vous recommandons de réinstaller l'agent à l'aide des packages fournis par Google. Pour effectuer une installation à l'aide de packages fournis par Google, consultez la section Installer l'agent de configuration du système d'exploitation.
Windows
Pour mettre à jour l'agent pour les VM Windows, exécutez la commande suivante :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eThis page details how to upgrade an existing VM Manager setup, which Google recommends keeping up-to-date for optimal performance.\u003c/p\u003e\n"],["\u003cp\u003eTo update the VM Manager, users must first check the current OS Config agent version installed on their VMs.\u003c/p\u003e\n"],["\u003cp\u003eThe OS Config agent can be updated either by updating the operating system's package directly or by running a patch job.\u003c/p\u003e\n"],["\u003cp\u003eSpecific commands for updating the OS Config agent are provided for CentOS, RHEL, Rocky Linux, Debian, SLES, Ubuntu, and Windows operating systems.\u003c/p\u003e\n"],["\u003cp\u003eCertain OS systems such as SLES and Ubuntu may require a reinstall of the agent using the Google provided packages to have the latest version.\u003c/p\u003e\n"]]],[],null,["# Update VM Manager\n\nOn Compute Engine you can manage the operating systems that are running on\nyour virtual machines (VMs) by using\n[VM Manager](/compute/vm-manager/docs).\n\nThis page describes how to upgrade\n[an existing setup of VM Manager](/compute/vm-manager/docs/setup).\nGoogle recommends that you use the latest version of the agent.\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\nOverview\n--------\n\nTo update your VM Manager setup, complete the following steps:\n\n1. [Check the current version](#view-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](https://github.com/GoogleCloudPlatform/osconfig/tags) GitHub repository.\n - To use OS inventory management, your VM must be running an OS Config agent version dated `20201110` or later\n - To use OS policies, your VM must be running an OS Config agent version dated `20210427` or later.\n2. If the version of your OS config agent does not support the new features, [update the OS Config agent](#update-agent).\n\nView OS Config agent version\n----------------------------\n\nIf you have [OS inventory management (earlier version)](/compute/vm-manager/docs/os-inventory/view-os-details#version-one)\nrunning on your VMs, you can check the OS Config agent version by running\nthe following command: \n\n```\ngcloud compute instances os-inventory describe VM-NAME \\\n --zone=ZONE\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eVM-NAME\u003c/var\u003e: the name of your VM\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone where the VM is located\n\nIn the output, search for `OSConfigAgentVersion`. \n\n```\nOSConfigAgentVersion: 20210316.00-g1\n```\n\nIn the preceding output snippet, the OS Config agent version is dated `20210316`\n(2021-03-16).\n\nUpdate the OS Config agent\n--------------------------\n\nTo update the OS Config agent, do one of the following:\n\n- [Update the package](#os-package) for your operating system\n- [Run a patch job](#patch-job)\n\n### Update OS packages\n\nOne method of updating the OS Config agent is to update the package for your\noperating system. \n\n### CentOS/RHEL/Rocky\n\nTo update the agent on CentOS, Rocky Linux, and RHEL operating systems, run\nthe following command: \n\n```\nsudo yum update google-osconfig-agent\n```\n\n### Debian\n\nTo update the agent on Debian operating systems, run the\nfollowing commands: \n\n```\nsudo apt update\nsudo apt install google-osconfig-agent\n```\n\n### SLES\n\nTo update the agent on SLES, run the following command: \n\n```\nsudo zypper -n update google-osconfig-agent\n```\n\n\n| **Note:** The package repository available from SUSE Linux Enterprise Server (SLES) might not have the latest OS Config agent available.\n\n\u003cbr /\u003e\n\nTo update the agent on SLES VMs, you can also do a reinstall of the\nagent using the Google-provided packages. To do an install\nusing Google-provided packages, see\n[Install the OS Config agent](/compute/docs/manage-os#agent-install).\n\n### Ubuntu\n\nTo update the agent on Ubuntu operating systems, run the\nfollowing commands: \n\n```\nsudo apt update\nsudo apt install google-osconfig-agent\n```\n\n\n| **Note:** The package repository available from Ubuntu might not have the latest OS Config agent available.\n\n\u003cbr /\u003e\n\nTo update the agent on Ubuntu VMs, we recommend that you do a\nreinstall of the agent using the Google-provided packages. To do an install\nusing Google-provided packages, see\n[Install the OS Config agent](/compute/docs/manage-os#agent-install).\n\n### Windows\n\nTo update the agent on Windows operating systems, run the\nfollowing command: \n\n```\ngooget install google-osconfig-agent\n```\n\n### Run a patch job\n\nAnother method of updating the OS Config agent is by running a patch job and\nspecifying the `exclusive_packages` flag. This patch job only updates the OS\nConfig agent on the target VMs.\n\nTo set the target VMs, you need to specify an \u003cvar translate=\"no\"\u003eINSTANCE_FILTER\u003c/var\u003e.\nFor more information about instance filters,\nsee [instance filters](/compute/docs/os-patch-management/create-patch-job#instance-filters). \n\n### CentOS/RHEL/Rocky\n\nTo update the agent for CentOS, Rocky Linux and RHEL VMs, run the\nfollowing command: \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --yum-exclusive-packages=google-osconfig-agent\n```\n\n### Debian\n\nTo update the agent for Debian VMs, run the\nfollowing commands: \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --apt-exclusive-packages=google-osconfig-agent\n```\n\n### SLES\n\nTo update the agent for SLES VMs, run the following command: \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --zypper-exclusive-patches=google-osconfig-agent\n```\n\n\n| **Note:** The package repository available from SUSE Linux Enterprise Server (SLES) might not have the latest OS Config agent available.\n\n\u003cbr /\u003e\n\nTo update the agent on SLES VMs, you can also do a reinstall of the\nagent using the Google-provided packages. To do an install\nusing Google-provided packages, see\n[Install the OS Config agent](/compute/docs/manage-os#agent-install).\n\n### Ubuntu\n\nTo update the agent for Ubuntu VMs, run the\nfollowing commands: \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --apt-exclusive-packages=google-osconfig-agent\n```\n\n\n| **Note:** The package repository available from Ubuntu might not have the latest OS Config agent available.\n\n\u003cbr /\u003e\n\nTo update the agent on Ubuntu VMs, we recommend that you do a\nreinstall of the agent using the Google-provided packages. To do an install\nusing Google-provided packages, see\n[Install the OS Config agent](/compute/docs/manage-os#agent-install).\n\n### Windows\n\nTo update the agent for Windows VMs, run the\nfollowing command:\n**Note:** This command also updates all the Google-provided software on the VM. \n\n```\ngcloud compute os-config patch-jobs execute INSTANCE_FILTER \\\n --windows-exclusive-patches=google-packages\n```"]]