Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
No Compute Engine, é possível gerenciar os sistemas operacionais em execução nas
máquinas virtuais (VMs) usando o
VM Manager.
Nesta página, você verá como fazer
upgrade de uma configuração atual do VM Manager.
O Google recomenda que você use a versão mais recente do agente.
Antes de começar
Configure a autenticação, caso ainda não tenha feito isso.
A autenticação verifica sua identidade para acesso a serviços e APIs do Google Cloud . Para executar
códigos ou amostras de um ambiente de desenvolvimento local, autentique-se no
Compute Engine selecionando uma das seguintes opções:
Instale a CLI do Google Cloud.
Após a instalação,
inicialize a CLI do Google Cloud executando o seguinte comando:
Para atualizar a configuração do VM Manager, siga estas etapas:
Verifique a versão atual do agente de configuração do SO instalada
nas suas VMs. Para mais informações sobre as versões do agente de configuração do SO,
consulte o repositório
GoogleCloudPlatform/osconfig
do GitHub.
Para usar o gerenciamento de inventário do SO (visualização), sua VM precisa executar uma
versão do agente de configuração do SO datada de 20201110 ou posterior
Para usar as políticas do SO, sua VM precisa executar uma
versão do agente de configuração do SO datada de 20210427 ou posterior.
Para atualizar o agente no SLES, execute o seguinte comando:
sudo zypper -n update google-osconfig-agent
.
Para atualizar o agente em VMs SLES, também é possível reinstalar o
agente usando os pacotes fornecidos pelo Google. Para fazer uma instalação
usando os pacotes fornecidos pelo Google, consulte
Instalar o agente de configuração do SO.
Ubuntu
Para atualizar o agente em sistemas operacionais Ubuntu, execute os
seguintes comandos:
Para atualizar o agente nas VMs do Ubuntu, recomendamos que você o
reinstale com os pacotes fornecidos pelo Google. Para fazer uma instalação
usando os pacotes fornecidos pelo Google, consulte
Instalar o agente de configuração do SO.
Windows
Para atualizar o agente em sistemas operacionais Windows, execute
o seguinte comando:
googet install google-osconfig-agent
Execute um job de patch
Outro método de atualização do agente de configuração do SO é executar um job de patch e
especificar a sinalização exclusive_packages. Esse job de patch só atualiza o agente
de configuração do SO nas VMs de destino.
Para definir as VMs de destino, você precisa especificar um INSTANCE_FILTER.
Para mais informações sobre filtros de instância,
consulte filtros de instância.
CentOS/RHEL/Rocky
Para atualizar o agente das VMs do CentOS, Rocky Linux e RHEL, execute o
seguinte comando:
Para atualizar o agente em VMs SLES, também é possível reinstalar o
agente usando os pacotes fornecidos pelo Google. Para fazer uma instalação
usando os pacotes fornecidos pelo Google, consulte
Instalar o agente de configuração do SO.
Ubuntu
Para atualizar o agente em VMs do Ubuntu, execute os
seguintes comandos:
Para atualizar o agente nas VMs do Ubuntu, recomendamos que você o
reinstale com os pacotes fornecidos pelo Google. Para fazer uma instalação
usando os pacotes fornecidos pelo Google, consulte
Instalar o agente de configuração do SO.
Windows
Para atualizar o agente das VMs do Windows, execute o
seguinte comando:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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```"]]