Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Windows
Neste documento, você verá como coletar informações sobre uma instância de máquina virtual (VM)
usando uma ferramenta de diagnóstico. Use as informações que as ferramentas
coletam para ajudar na solução de problemas básicos antes de entrar em contato com o
Suporte.
A ferramenta faz o seguinte:
Coleta informações somente da VM especificada.
Armazena as informações apenas no seu projeto.
Armazena as informações por 10 dias em um bucket do
Cloud Storage que, por padrão, somente você pode acessar.
Antes de compartilhar as informações coletadas com o Suporte do Google, faça o seguinte:
Revise as informações em busca de informações confidenciais ou
de identificação pessoal (PII, na sigla em inglês).
Exclua ou mascare as informações conforme necessário.
Informações de diagnóstico coletadas da VM
Com essa ferramenta de diagnóstico, é possível coletar informações sobre o seguinte:
Para informações detalhadas sobre como o Compute Engine coleta essas informações, consulte o repositório público (em inglês).
Limitações
Só é possível coletar informações de diagnóstico de VMs criadas com base no Windows
Server.
Antes de começar
O Compute Engine instala a ferramenta de diagnóstico por padrão em versões públicas
das imagens do Windows Server posteriormente a v20190714. Caso contrário, se a
versão de imagem do Windows Server for anterior a v20190714 ou se você
estiver usando uma imagem personalizada, instale a ferramenta usando o
comando googet install google-compute-engine-diagnostics.
Configure a autenticação, caso ainda não tenha feito isso.
A autenticação é
o processo de verificação da sua identidade para acesso a serviços e APIs do Google Cloud .
Para executar códigos ou amostras de um ambiente de desenvolvimento local, autentique-se no
Compute Engine selecionando uma das seguintes opções:
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
Instale a CLI do Google Cloud.
Após a instalação,
inicialize a Google Cloud CLI executando o seguinte comando:
Para mais informações, consulte
Autenticar para usar REST
na documentação de autenticação do Google Cloud .
Como coletar informações de diagnóstico de uma VM
Execute a ferramenta de diagnóstico diretamente da VM ou remotamente, usando a CLI do Google Cloud. Em VMs baseadas no Windows, localize a ferramenta de diagnóstico no diretório C:\Program Files\Google\Compute Engine\diagnostics.
Permissões exigidas para a tarefa
Para executar esta tarefa, é preciso ter a permissão a seguir:
roles/iam.serviceAccountTokenCreator no projeto
gcloud
Conceda o papel iam.serviceAccountTokenCreator no projeto:
A sinalização --collect-process-traces opcional especifica
se a ferramenta de diagnóstico coleta um trace de 10 minutos do sistema
em execução, o que inclui atividade de CPU, disco, arquivo e rede. Em
VMs baseadas em Windows, usa o Gravador de desempenho
do Windows.
Substitua:
VM_NAME: nome da VM da qual as informações de diagnóstico
serão coletadas;
Com o Compute Engine, é possível formatar o nome do bucket que contém as informações de diagnóstico como diagnostic_logs_project_PROJECT_NUMBER.
Veja ou faça o download do bucket usando a CLI gcloud ou, no
consoleGoogle Cloud , na página Cloud Storage:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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)."]]