This document describes how to collect information about a virtual machine (VM) instance by using a diagnostic tool. Use the information that the tools collects to help with basic troubleshooting before contacting Support.
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 a Cloud Storage bucket, which, by default, only you can access.
Before sharing the collected information with Google Support, do the following:
Review the information for confidential or personally identifiable information (PII).
Delete or mask the information as necessary.
Diagnostic information collected from the VM
This diagnostic tool collects information about the following:
- Windows Events, including application events and system events
For detailed information about how Compute Engine collects this information, see the public repository.
- You can only collect diagnostic information from VMs created based on Windows Server.
Before you begin
- If you want to use the command-line examples in this guide, do the following:
- If you want to use the API examples in this guide, set up API access.
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-diagnosticscommand.
Collecting diagnostic information from a VM
Run the diagnostic tool either directly from the VM, or remotely, by using the
Google Cloud CLI. On Windows-based VMs, find the diagnostic tool in the
C:\Program Files\Google\Compute Engine\diagnostics directory.
Permissions required for this task
To perform this task, you must have the following permissions:
roles/iam.serviceAccountTokenCreatoron the project
iam.serviceAccountTokenCreatorrole on the project:
gcloud projects add-iam-policy-binding PROJECT_ID \ --member user:EMAIL \ --role roles/iam.serviceAccountTokenCreator
Replace the following:
PROJECT_ID: the project ID
Export the diagnostic information as an object to a Cloud Storage bucket.
gcloud compute diagnose export-logs VM_NAME \ [--collect-process-traces]
--collect-process-tracesflag specifies whether the diagnostic tool collects a 10 minute trace of the running system, which includes CPU, disk, file, and network activity. On Windows-based VMs, this uses the Windows Performance Recorder.
Replace the following:
VM_NAME: name of the VM to collect diagnostic information from
The log exporting process might take a few minutes to complete. View the status by using the
gcloud compute instances get-serial-port-outputcommand.
Compute Engine formats the name of the bucket containing the diagnostic information as
diagnostic_logs_project_PROJECT_NUMBER. View or download the bucket by using the
gsutil tool, or, in the Google Cloud console, from the Cloud Storage page:
Learn how to capture screenshots from VMs.
Learn how to Troubleshoot Windows instances.
Learn how to Troubleshoot RDP.