Collecting diagnostic information

Windows

This document describes how to collect information about a virtual machine (VM)instance by using a diagnostic tool. Use the information that the tools collectsto help with basic troubleshooting before contactingSupport.

The tool does the following:

  • Collects information only from the VM that you specify.

  • Stores the information only in your project.

  • Stores the information for 10 days in aCloud Storagebucket, which, by default, only you can access.

Before sharing the collected information with Google Support, do the following:

  1. Review the information for confidential or personally identifiableinformation (PII).

  2. Delete or mask the information as necessary.

Diagnostic information collected from the VM

This diagnostic tool collects information about the following:

For detailed information about how Compute Engine collects thisinformation, see thepublic repository.

Limitations

  • You can only collect diagnostic information from VMs created based on WindowsServer.

Before you begin

Collecting diagnostic information from a VM

Run the diagnostic tool either directly from the VM, or remotely, by using theGoogle Cloud CLI. On Windows-based VMs, find the diagnostic tool in theC:\Program Files\Google\Compute Engine\diagnostics directory.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • roles/iam.serviceAccountTokenCreator on the project

gcloud

  1. Grant theiam.serviceAccountTokenCreator role on the project:

    gcloud projects add-iam-policy-bindingPROJECT_ID \    --member user:EMAIL \    --role roles/iam.serviceAccountTokenCreator

    Replace the following:

    • PROJECT_ID: the project ID
    • EMAIL: the email address to grant theiam.serviceAccountTokenCreator role
  2. Export the diagnostic information as an object to a Cloud Storagebucket.

    gcloud compute diagnose export-logsVM_NAME \  [--collect-process-traces]

    The optional--collect-process-traces flag specifieswhether the diagnostic tool collects a 10 minute trace of the runningsystem, which includes CPU, disk, file, and network activity. OnWindows-based VMs, this uses theWindows PerformanceRecorder.

    Replace the following:

    • VM_NAME: name of the VM to collect diagnosticinformation from
  3. The log exporting process might take a few minutes to complete. View thestatus by using thegcloud compute instances get-serial-port-outputcommand.

  4. Compute Engine formats the name of the bucket containing thediagnostic information asdiagnostic_logs_project_PROJECT_NUMBER.View or download the bucket by using thegcloud CLI, or, in theGoogle Cloud console, from theCloud Storage page:

    Go to Storage

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.