Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Windows
Dokumen ini menjelaskan cara mengumpulkan informasi tentang instance virtual machine (VM) menggunakan alat diagnostik. Gunakan informasi yang dikumpulkan alat tersebut untuk membantu pemecahan masalah dasar sebelum menghubungi Dukungan.
Alat ini akan melakukan hal berikut:
Mengumpulkan informasi hanya dari VM yang Anda tentukan.
Menyimpan informasi hanya di project Anda.
Menyimpan informasi selama 10 hari di bucket Cloud Storage, yang secara default hanya dapat diakses oleh Anda.
Sebelum membagikan informasi yang dikumpulkan kepada Dukungan Google, lakukan hal berikut:
Tinjau informasi tersebut untuk menemukan informasi rahasia atau identitas pribadi (PII).
Hapus atau samarkan informasi tersebut jika diperlukan.
Informasi diagnostik yang dikumpulkan dari VM
Alat diagnostik ini mengumpulkan informasi tentang hal berikut:
Untuk informasi mendetail tentang cara Compute Engine mengumpulkan informasi ini, lihat repositori publik.
Batasan
Anda hanya dapat mengumpulkan informasi diagnostik dari VM yang dibuat berdasarkan Windows Server.
Sebelum memulai
Compute Engine secara default menginstal alat diagnostik pada image Windows Server versi publik yang lebih baru daripada v20190714. Atau, jika versi image Windows Server Anda lebih lama daripada v20190714, atau Anda menggunakan image kustom, instal alat tersebut menggunakan perintah googet install google-compute-engine-diagnostics.
Jika Anda belum melakukannya, siapkan autentikasi.
Autentikasi adalah
proses yang digunakan untuk memverifikasi identitas Anda untuk mengakses Google Cloud layanan dan API.
Untuk menjalankan kode atau sampel dari lingkungan pengembangan lokal, Anda dapat melakukan autentikasi ke
Compute Engine dengan memilih salah satu opsi berikut:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Menginstal Google Cloud CLI.
Setelah penginstalan,
lakukan inisialisasi Google Cloud CLI dengan menjalankan perintah berikut:
Jalankan alat diagnostik secara langsung dari VM, atau secara jarak jauh menggunakan Google Cloud CLI. Pada VM berbasis Windows, temukan alat diagnostik ini di direktori C:\Program Files\Google\Compute Engine\diagnostics.
Izin yang diperlukan untuk tugas ini
Untuk melakukan tugas ini, Anda harus memiliki izin berikut:
roles/iam.serviceAccountTokenCreator pada project
gcloud
Berikan peran iam.serviceAccountTokenCreator pada project:
Flag --collect-process-traces (opsional) menentukan apakah alat diagnostik mengumpulkan trace 10 menit untuk sistem yang sedang berjalan, yang mencakup CPU, disk, file, dan aktivitas jaringan. Pada VM berbasis Windows, tindakan ini menggunakan Windows Performance Recorder.
Ganti kode berikut:
VM_NAME: nama VM dari mana informasi diagnostik akan dikumpulkan
Compute Engine memformat nama bucket yang berisi informasi diagnostik sebagai diagnostic_logs_project_PROJECT_NUMBER.
Lihat atau download bucket menggunakan
gcloud CLI, atau, di
Google Cloud konsol, dari halaman Cloud Storage:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 UTC."],[[["\u003cp\u003eThis document describes a diagnostic tool for collecting information from Windows virtual machine (VM) instances to aid in troubleshooting before contacting support.\u003c/p\u003e\n"],["\u003cp\u003eThe diagnostic tool collects data related to disks, events, networks, programs, and system configurations, storing the information within the user's project for 10 days in a Cloud Storage bucket that defaults to private access.\u003c/p\u003e\n"],["\u003cp\u003eBefore sharing any collected diagnostic data with Google Support, users should review the information for any confidential or personally identifiable data and remove or mask it as necessary.\u003c/p\u003e\n"],["\u003cp\u003eThe tool is installed by default on Windows Server images later than \u003ccode\u003ev20190714\u003c/code\u003e; otherwise, it can be installed using the \u003ccode\u003egooget\u003c/code\u003e command, and diagnostic data can be exported remotely using the Google Cloud CLI.\u003c/p\u003e\n"],["\u003cp\u003eCollecting diagnostic data requires the \u003ccode\u003eiam.serviceAccountTokenCreator\u003c/code\u003e role, which can be granted to specific email addresses within a project using a provided gcloud command.\u003c/p\u003e\n"]]],[],null,["# Collecting diagnostic information\n\nWindows\n\n*** ** * ** ***\n\nThis document describes how to collect information about a virtual machine (VM)\ninstance by using a diagnostic tool. Use the information that the tools collects\nto help with basic troubleshooting before contacting\n[Support](/compute/docs/support).\n\nThe tool does the following:\n\n- Collects information only from the VM that you specify.\n\n- Stores the information only in your project.\n\n- Stores the information for 10 days in a [Cloud Storage\n bucket](/storage/docs/creating-buckets), which, by default, only you can access.\n\nBefore sharing the collected information with Google Support, do the following:\n\n1. Review the information for confidential or personally identifiable\n information (PII).\n\n2. Delete or mask the information as necessary.\n\nDiagnostic information collected from the VM\n--------------------------------------------\n\nThis diagnostic tool collects information about the following:\n\n- **Disks**:\n\n - [Windows Management Instrumentation\n (WMI)](https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page) object information about [disks](https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-disk), [partitions](https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-partition), and [volumes](https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-volume)\n- **Events**:\n\n - [Windows Events](https://docs.microsoft.com/en-us/windows/win32/events/windows-events?redirectedfrom=MSDN), including application events and system events\n- **Networks**:\n\n - WMI object information about [firewall rules](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/jj676843(v%3Dvs.85)), and output from [ipconfig](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig), [netstat](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat), [nslookup](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/nslookup), [ping](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ping), [route](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/route_ws2008), and [tracert](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/tracert)\n- **Programs**:\n\n - WMI object information about [processes](https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-process), [scheduled tasks](https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/get-scheduledtask?view=win10-ps), [services](https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-service), and [Google Kubernetes Engine (GKE)](https://cloud.google.com/kubernetes-engine/docs/concepts/windows-server-gke)\n- **System**:\n\n - WMI object information about [users](https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-useraccount), Remote Desktop Protocol (RDP) settings by using [this script](https://github.com/GoogleCloudPlatform/compute-image-tools/blob/master/cli_tools/diagnostics/rdp_status.ps1), and output from [bcdedit](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/bcdedit), [driverquery](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/driverquery), [msinfo32](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/msinfo32), [pnputil](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/pnputil), and [systeminfo](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/systeminfo), and [memory dump](https://docs.microsoft.com/en-us/troubleshoot/windows-server/performance/memory-dump-file-options) logs\n\nFor detailed information about how Compute Engine collects this\ninformation, see the [public repository](https://github.com/GoogleCloudPlatform/compute-image-tools/tree/master/cli_tools/diagnostics).\n\nLimitations\n-----------\n\n- You can only collect diagnostic information from VMs created based on Windows Server.\n\nBefore you begin\n----------------\n\n- Compute Engine installs the diagnostic tool by default on public versions of Windows Server images later than `v20190714`. Otherwise, if your Windows Server image version is earlier than `v20190714`, or you are using a custom image, install the tool by using the `googet install google-compute-engine-diagnostics` command.\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\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\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\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nCollecting diagnostic information from a VM\n-------------------------------------------\n\nRun the diagnostic tool either directly from the VM, or remotely, by using the\nGoogle Cloud CLI. On Windows-based VMs, find the diagnostic tool in the\n`C:\\Program Files\\Google\\Compute Engine\\diagnostics` directory.\n\n#### Permissions required for this task\n\nTo perform this task, you must have the following [permissions](/iam/docs/overview#permissions):\n\n- `roles/iam.serviceAccountTokenCreator` on the project\n\n### gcloud\n\n1. Grant the `iam.serviceAccountTokenCreator` role on the project:\n\n ```\n gcloud projects add-iam-policy-binding PROJECT_ID \\\n --member user:EMAIL \\\n --role roles/iam.serviceAccountTokenCreator\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID\n - \u003cvar translate=\"no\"\u003eEMAIL\u003c/var\u003e: the email address to grant the `iam.serviceAccountTokenCreator` role\n2. Export the diagnostic information as an object to a Cloud Storage\n bucket.\n\n ```\n gcloud compute diagnose export-logs VM_NAME \\\n [--collect-process-traces]\n ```\n\n The optional `--collect-process-traces` flag specifies\n whether the diagnostic tool collects a 10 minute trace of the running\n system, which includes CPU, disk, file, and network activity. On\n Windows-based VMs, this uses the [Windows Performance\n Recorder](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-recorder).\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: name of the VM to collect diagnostic information from\n3. The log exporting process might take a few minutes to complete. View the\n status by using the [`gcloud compute instances get-serial-port-output`\n command](/sdk/gcloud/reference/compute/instances/get-serial-port-output).\n\n4. Compute Engine formats the name of the bucket containing the\n diagnostic information as\n `diagnostic_logs_project_`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e.\n View or download the bucket by using the\n [gcloud CLI](/sdk/gcloud/reference/storage), or, in the\n Google Cloud console, from the **Cloud Storage** page:\n\n [Go to Storage](https://console.cloud.google.com/storage)\n\nWhat's next\n-----------\n\n- Learn how to [capture screenshots from VMs](/compute/docs/instances/capturing-vm-screenshots).\n\n- Learn how to [Troubleshoot Windows\n instances](/compute/docs/troubleshooting/troubleshooting-windows).\n\n- Learn how to [Troubleshoot RDP](/compute/docs/troubleshooting/troubleshooting-rdp)."]]