[[["易于理解","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-08-19。"],[[["\u003cp\u003eOS inventory management collects and displays detailed information about your VM instances, including hostname, operating system, kernel version, installed packages, available updates, Windows applications, and OS vulnerabilities.\u003c/p\u003e\n"],["\u003cp\u003eThis tool can help identify VMs running specific OS versions, list installed packages, generate available update lists, spot missing updates, and view vulnerability reports for each VM.\u003c/p\u003e\n"],["\u003cp\u003eThe OS Config agent conducts an inventory scan every 10 minutes, sending data to the metadata server, OS Config API, and logs, and this agent gathers data by parsing OS files and using package managers or system APIs.\u003c/p\u003e\n"],["\u003cp\u003eVulnerability reports are generated by the OS Config API service, which continuously scans the operating system's vulnerability sources against available inventory data and displays the results, often within hours of a change.\u003c/p\u003e\n"],["\u003cp\u003eThe data is stored in the OS Config API, and is retained until the VM is deleted, or the agent stops reporting for a few days.\u003c/p\u003e\n"]]],[],null,["# OS inventory management\n\nThis page provides an overview of OS inventory management.\nFor information on setting up and using OS inventory management, see\n[Viewing operating system details](/compute/docs/instances/view-os-details).\n\nUse OS inventory management to collect and view operating system details for\nyour virtual machine (VM) instances. These operating system details include\ninformation such as hostname, operating system, and kernel version. You can also\nget information about installed OS packages, available OS package updates,\nWindows applications and OS vulnerabilities.\n\nWhen to use OS inventory management\n-----------------------------------\n\nOS inventory management can be used to complete the following tasks:\n\n- Identify VMs that are running a specific version of an operating system\n- View operating system packages that are installed on a VM\n- Generate a list of operating system package updates that are available for each VM\n- Identify missing operating system packages, updates, or patches for a VM\n- View vulnerability reports for a VM\n\nHow OS inventory management works\n---------------------------------\n\nWhen OS inventory management is enabled, the OS Config agent runs an\ninventory scan to collect data, and then sends this information to the\nmetadata server, OS Config API, and various log streams. This scan runs\nevery 10 minutes on the VM.\n\nTo enable OS inventory management, VM Manager must be set up on the VM.\nSee [Set up VM Manager](/compute/vm-manager/docs/setup).\n\nAfter you set up VM Manager, you can then query either the guest\nattributes or the OS Config API to retrieve information about the operating\nsystem that is running on a VM. See\n[View operating system details](/compute/docs/instances/view-os-details#overview).\n\n### How the operating system data is collected\n\nFor Linux VMs, the OS Config agent runs on the VM and parses\nthe `/etc/os-release`, or the equivalent file for the Linux distribution to\ngather operating system details. The OS Config agent also uses package\nmanagers such as `apt`, `yum`, or\n[GooGet](https://github.com/google/googet) to collect information\nabout the installed packages and available updates for the instance.\n\nFor Windows VMs, the OS Config agent uses the Windows system APIs to\ncollect the OS information details. The Windows Update agent is also used to\nfind the installed and available updates.\n\n### Where the operating system data is stored\n\nInventory data is stored in the OS Config API. The contents\nfor the installed packages and package updates are compressed using gzip to save\nspace and then base64 encoded.\n\n### Logging\n\nDuring the collection and storage of data, the OS Config agent writes\nactivity logs to the various log streams on Compute Engine. These include:\n\n- [The serial port](/compute/docs/instances/viewing-serial-port-output)\n- System logs - Windows event log and Linux syslog\n- Standard streams - stdout\n- [Cloud Logging logs](/logging/docs) - These logs are only available if Cloud Logging is enabled on the VM instance.\n\nInformation provided by OS inventory management\n-----------------------------------------------\n\nOS inventory management can provide the following information about the\noperating system that is running on your VM instance:\n\n- Hostname\n- LongName - The detailed operating system name. For example, `Microsoft Windows Server 2016 Datacenter`.\n- ShortName - The short form of the operating system name. For example, `Windows`.\n- Kernel version\n- OS architecture\n- OS version\n- OS Config agent version\n- Last updated - A timestamp of the last time the agent successfully scanned the system and updated the guest attributes with OS Inventory data.\n\n### Installed operating system package and application information\n\nThe following table summarizes the information that OS inventory management\nprovides for installed operating system packages on Linux and Windows VMs.\nIt also outlines the information that is available for applications that\nare running on Windows.\n\n\n^1^This field is hidden in the default\n`gcloud compute instances os-inventory describe` command-line output.\nTo view this field you must view the output in the JSON format. To view the\noutput in JSON format, append the `--format=JSON` to the `gcloud` command. For more\ninformation about output formatting, review\n[`gcloud topic formats`](/sdk/gcloud/reference/topic/formats).\n\n^2^To view installer properties for your Windows applications, you\nneed OS Config agent version `20210811` or later. To view agent version, see\n[View OS Config agent version](/compute/docs/manage-os/upgrade-vm-manager#view-version).\n\n\u003cbr /\u003e\n\n### Available operating system package update information\n\nThe following table summarises the update information that\nOS inventory management provides for installed operating system packages.\n\n\n^1^This field is hidden in the default\n`gcloud compute instances os-inventory describe` command-line output.\nTo view this field you must view the output in the JSON format. To view the\noutput in JSON format, append the `--format=JSON` to the `gcloud` command. For more\ninformation about output formatting, review\n[`gcloud topic formats`](/sdk/gcloud/reference/topic/formats).\n\n\u003cbr /\u003e\n\n### Vulnerability reports\n\nSoftware vulnerabilities are weaknesses that can either cause an accidental\nsystem failure or result in malicious activity. For VMs, a vulnerability can be\nan issue in the code or the logic of operation for either operating system\npackages or software applications.\n\nVulnerabilities associated with the installed operating system packages\nare normally stored in a vulnerability source repository. For more information\nabout these vulnerability sources, see\n[Vulnerability sources](#vulnerability-sources).\nYou can use OS inventory management to view vulnerability reports for\nissues with installed OS packages.\n\nTo get vulnerability data for a VM, VM Manager must be set up, and\nOS Config agent version dated `20201110` or later must be running on the VM. See\n[Setting up VM Manager](/compute/docs/manage-os).\n\nAfter the OS Config agent is set up and reporting inventory, the OS Config API\nservice continuously scans and checks the vulnerability source of the operating\nsystem against the available inventory data.\nWhen a vulnerability is detected in the operating system packages, the service\ngenerates a vulnerability report. These reports are generated as follows:\n\n- When a package is installed or updated in a VM's operating system, you can expect to see [Common Vulnerabilities and Exposures (CVEs)](https://wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures) information for the VM in VM Manager, Security Command Center, and Cloud Asset Inventory within two hours after the change.\n- When new security advisories are published for an operating system, updated CVEs are normally available within 24 hours after the operating system vendor publishes the advisory.\n\nTo view these vulnerability reports, see\n[View vulnerability reports](/compute/vm-manager/docs/os-inventory/vulnerability-reports).\n\n#### How vulnerability reports are generated\n\nVM Manager periodically completes the following tasks:\n\n1. Reads the reports that are collected from [OS inventory data](/compute/vm-manager/docs/os-inventory/os-inventory-management#data-collected) on a VM.\n2. Scans for classification data from the vulnerability source for each operating system, and orders this data based on severity (from highest to lowest), at least once daily.\n3. Displays the CVE data for a VM on the Google Cloud console. You can also [view\n the vulnerability reports](/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details) using Security Command Center or Cloud Asset Inventory.\n\n#### Vulnerability sources\n\nThe following table summarizes vulnerability source that is used for each\noperating system.\nFor a complete list of supported operating systems and their versions, see\n[Operating system details](/compute/docs/images/os-details#vm-manager).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nData retention\n--------------\n\nOS inventory and vulnerability report data is stored until the VM is deleted.\nHowever, if for any reason the OS Config agent stops reporting to the OS Config\nAPI service for a few days, then VM Manager deletes the available OS\ninventory and vulnerability report data collected until that point. No data\nwill be available for that VM until the OS Config agent starts running again.\n\nPricing\n-------\n\nFor information about pricing, see\n[VM Manager pricing](/compute/vm-manager/docs/pricing).\n\nWhat's next\n-----------\n\n- Use the OS inventory management tool to [view operating system details](/compute/docs/instances/view-os-details)."]]