某些 Google Cloud 服务具有 Google 管理的服务账号,可允许服务访问您的资源。这些服务账号有时称为“服务代理”。如需详细了解服务代理,请参阅服务代理。
虚拟机管理器使用服务代理(用于收集有关虚拟机的信息)来管理虚拟机。此 Google 管理的服务代理的电子邮件地址为 service-PROJECT_NUMBER@gcp-sa-osconfig.iam.gserviceaccount.com。该账号使用 Cloud OS Config Service Agent 角色 (roles/osconfig.serviceAgent)。
您可以在 Google Cloud 控制台的 IAM 页面上查看项目的服务代理以及授予服务代理的角色。但是,如果您撤消了服务代理的 Cloud OS Config Service Agent 角色,就无法在 IAM 页面上查看服务代理。
操作系统软件包和更新来源
对于 Patch 和操作系统政策,您的虚拟机必须能够访问软件包源和代码库。对于专用网络中的虚拟机,您可以设置专用 Google 访问通道。
虚拟机管理器和 Terraform
您可以使用 Terraform 将虚拟机管理器的范围扩展到 Google Cloud 组织中的多个项目。如需了解如何使用 Terraform 和虚拟机管理器创建修补作业和操作系统政策分配,请参阅 OS Config GitHub 代码库中的 Terraform 示例和教程。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eVM Manager is a suite of tools designed to efficiently manage operating systems for large virtual machine (VM) fleets on Compute Engine, supporting both Windows and Linux.\u003c/p\u003e\n"],["\u003cp\u003eThe VM Manager suite includes Patch for applying updates and managing compliance, OS inventory management for collecting and reviewing OS information, and OS policies for software package management.\u003c/p\u003e\n"],["\u003cp\u003eEnabling VM Manager, either automatically or manually, activates the OS Config service API and the OS Config agent on selected VMs through instance metadata.\u003c/p\u003e\n"],["\u003cp\u003eThe OS Config agent utilizes OS system utilities to manage patching, maintain OS policy states, and gather inventory data, which is then stored in instance metadata and log streams.\u003c/p\u003e\n"],["\u003cp\u003eVM Manager's functionality can be expanded across multiple projects in a Google Cloud organization using Terraform, allowing for the creation of patch jobs and OS policy assignments.\u003c/p\u003e\n"]]],[],null,["VM Manager is a suite of tools that can be used to manage operating\nsystems for large virtual machine (VM) fleets running Windows and Linux\non Compute Engine.\n\nVM Manager helps drive efficiency through\nautomation and reduces the operational burden of maintaining these VM fleets.\n\nVM Manager supports projects in\n[VPC Service Controls](/vpc-service-controls/docs/supported-products#table_vm_manager)\nservice perimeters.\n\nOverview\n\nThe following services are available as part of the VM Manager suite:\n\n- [Patch](/compute/vm-manager/docs/patch): Use this service to apply on-demand and scheduled patches. You can also use Patch for patch compliance reporting in your environment.\n- [OS inventory management](/compute/vm-manager/docs/os-inventory/os-inventory-management): Use this service to collect and review operating system information.\n- [OS policies](/compute/vm-manager/docs/os-policies): Use this service to install, remove, and auto-update software packages.\n\n[](/static/compute/images/manage-os/vm-manager-arch.png) Figure 1. VM Manager architecture overview\n\nWhen you set up or enable VM Manager in your Google Cloud project,\nyou can access the full suite of VM Manager tools: Patch,\nOS policies, and OS inventory management.\n\nEnable VM Manager\n\nYou can set VM Manager to be automatically enabled or manually\nenabled. Automatic enablement applies to your entire project. Manual enablement\ncan be done per VM or for the entire project.\n\nIn summary, when you enable VM Manager, whether automatically\nor manually, the following setup takes place:\n\n- OS Config service API is enabled on the Google Cloud project.\n- The OS Config agent, running on each selected VM, is activated by setting\n the required [instance metadata](/compute/docs/manage-os#enable-metadata)\n values.\n\n | **Note:** OS Config is [preinstalled](/compute/docs/manage-os#check-install) on most VMs but is not activated until instance metadata is set.\n\nFor more information about manually enabling VM Manager,\nsee [Setup overview](/compute/docs/manage-os#overview).\n\nAutomatic enablement is done from the Google Cloud console.\n\nOS Config agent\n\nWhen VM Manager is enabled, the OS Config agent functions as follows\nfor each of the services:\n\n- For *Patch* , the OS Config agent uses OS system utilities (such as `yum`, `apt`, `rpm` or the Windows Update Agent) to retrieve patches or updates from the OS package or update source and apply them to the VM. For more information, see [How Patch works](/compute/vm-manager/docs/patch#how_os_patch_management_works).\n- For *OS policies* , the OS Config agent uses OS system utilities (such as `yum`, `apt`, `rpm` or the Windows Update Agent) to maintain the state for the VM that is specified in the OS policy. For more information, see [How OS policies work](/compute/vm-manager/docs/os-policies#how_os_configuration_management_works).\n- For *OS inventory management* , the OS Config agent collects [inventory data](/compute/vm-manager/docs/os-inventory/os-inventory-management#data-collected). This inventory data is then stored in the [instance metadata](/compute/docs/storing-retrieving-metadata) and in various log streams. This data can then be queried using the Google Cloud CLI. For more information, see [How OS inventory management works](/compute/vm-manager/docs/os-inventory/os-inventory-management#how_os_inventory_management_works).\n\nGoogle Cloud OS Config Service Agent\n\nSome Google Cloud services have\n[Google-managed service accounts](/iam/docs/service-account-types#google-managed)\nthat allow services to access your resources. These service accounts are\nsometimes known as *service agents* . For more information about service agents,\nsee [Service agents](/iam/docs/service-agents).\n\nVM Manager manages your VMs using a service agent that collects\ninformation about your VMs on your behalf. The email for this Google-managed\nservice agent is\n`service-`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`@gcp-sa-osconfig.iam.gserviceaccount.com`.\nThis account uses the Cloud OS Config Service Agent role (`roles/osconfig.serviceAgent`).\n| **Note:** Google creates the service agent for VM Manager only when Patch uses its service to start a patch job and to filter out the VM data. OS policies does not use this service agent.\n\nYou can view your project's service agents and the roles granted to the service\nagents on the [IAM page of the Google Cloud console](https://console.cloud.google.com/iam-admin).\nHowever, if you've revoked the Cloud OS Config Service Agent role for the service agent,\nyou cannot view the service agent on the IAM page.\n\nOS packages and update source\n\nFor both Patch and OS policies, your VMs must be\nable to access package sources and repositories. For VMs in private networks,\nyou can set up [Private Google Access](/vpc/docs/configure-private-google-access).\n\nVM Manager and Terraform\n\nYou can use Terraform to extend the scope of VM Manager to multiple projects in\na Google Cloud organization. To learn how to create patch jobs and OS policy\nassignments by using Terraform and VM Manager, see the Terraform\nexamples and tutorials in the\n[OS Config GitHub repository](https://github.com/GoogleCloudPlatform/osconfig/tree/master/examples/Terraform).\n\nFor more information about Terraform configurations and its usage,\nreview the documentation for the following resources:\n\n- [OS patch deployment](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/os_config_patch_deployment)\n- [OS policy assignment](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/os_config_os_policy_assignment)\n\nFor a list of available resources to get started with using Terraform,\nsee [Using Terraform with Google Cloud](/docs/terraform).\n\nPricing\n\nFor pricing information, see [VM Manager pricing](/compute/vm-manager/pricing).\n\nWhat's next?\n\n- Learn about [OS inventory management](/compute/vm-manager/docs/os-inventory/os-inventory-management).\n- Learn about [Patch](/compute/vm-manager/docs/patch).\n- Learn about [OS policies](/compute/vm-manager/docs/os-policies)."]]