Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Windows
In diesem Dokument wird beschrieben, wie Sie mithilfe eines Diagnosetools Informationen zu einer VM-Instanz erfassen. Verwenden Sie die von den Tool erfassten Informationen, um Sie bei der grundlegenden Fehlerbehebung zu unterstützen, bevor Sie sich an den Support wenden.
Das Tool führt folgende Schritte aus:
Erfasst nur Informationen von der von Ihnen angegebenen VM.
Speichert die Informationen nur in Ihrem Projekt.
Speichert die Informationen 10 Tage in einem Cloud Storage-Bucket, der standardmäßig nur für Sie zugänglich ist.
Führen Sie die folgenden Schritte aus, bevor Sie die erfassten Informationen an den Google-Support weitergeben:
Prüfen Sie die Informationen auf vertrauliche oder personenidentifizierbare Informationen.
Löschen oder maskieren Sie die Informationen nach Bedarf.
Von der VM erfasste Diagnoseinformationen
Das Diagnosetool erfasst Informationen zu folgenden Themen:
Ausführliche Informationen zur Erfassung dieser Informationen durch Compute Engine finden Sie im öffentlichen Repository.
Beschränkungen
Sie können Diagnoseinformationen nur von VMs erfassen, die basierend auf Windows Server erstellt wurden.
Hinweise
Compute Engine installiert das Diagnosetool standardmäßig auf öffentlichen Versionen von Windows Server-Images, die neuer als v20190714 sind. Andernfalls, wenn Ihre Windows Server-Image-Version älter als v20190714 ist oder Sie ein benutzerdefiniertes Image verwenden, installieren Sie das Tool mit dem Befehl googet install google-compute-engine-diagnostics.
Richten Sie die Authentifizierung ein, falls Sie dies noch nicht getan haben.
Bei der Authentifizierung wird Ihre Identität für den Zugriff auf Google Cloud -Dienste und APIs überprüft. Zum Ausführen von Code oder Beispielen aus einer lokalen Entwicklungsumgebung können Sie sich so bei Compute Engine authentifizieren:
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
Installieren Sie die Google Cloud CLI.
Initialisieren Sie die Google Cloud CLI nach der Installation mit dem folgenden Befehl:
Wenn Sie die REST API-Beispiele auf dieser Seite in einer lokalen Entwicklungsumgebung verwenden möchten, nutzen Sie die Anmeldedaten, die Sie der gcloud CLI bereitstellen.
Installieren Sie die Google Cloud CLI.
Initialisieren Sie die Google Cloud CLI nach der Installation mit dem folgenden Befehl:
Führen Sie das Diagnosetool entweder direkt über die VM oder per Remote-Zugriff mit der Google Cloud CLI aus. Auf Windows-basierten VMs finden Sie das Diagnosetool im Verzeichnis C:\Program Files\Google\Compute Engine\diagnostics.
Erforderliche Berechtigungen für diese Aufgabe
Zum Ausführen dieser Aufgabe benötigen Sie die folgende Berechtigung:
roles/iam.serviceAccountTokenCreator für das Projekt
gcloud
Weisen Sie dem Projekt die Rolle iam.serviceAccountTokenCreator zu:
Das optionale Flag --collect-process-traces gibt an, ob das Diagnosetool einen 10-Minuten-Trace des laufenden Systems erfasst, einschließlich CPU-, Laufwerks-, Datei- und Netzwerkaktivität. Auf Windows-basierten VMs wird dabei der Windows Performance Recorder verwendet.
Dabei gilt:
VM_NAME: Name der VM, von der die Diagnoseinformationen erfasst werden sollen
Compute Engine formatiert den Namen des Buckets mit den Diagnoseinformationen als diagnostic_logs_project_PROJECT_NUMBER.
Sie können den Bucket mit dem gcloud CLI oder in derGoogle Cloud Console über die Seite Cloud Storage ansehen oder herunterladen:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-03 (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)."]]