Compute Engine에서 코어 덤프를 수집하려면 마스크 불가능 인터럽트(NMI) 신호를 수신하도록 VM을 구성한 후 SendDiagnosticInterrupt 명령어를 실행하여 운영체제에 커널 패닉 또는 블루 스크린을 표시합니다. 커널 패닉 또는 블루 스크린에서 게스트 운영체제에 의한 코어 덤프 수집을 시작합니다. 그런 다음 특히 커널 고정과 같이 재현하기 어려운 시나리오에서 이 코어 덤프를 디버깅에 사용할 수 있습니다.
시작하기 전에
NMI 신호 전송은 기본 쿼리 API 할당량으로 계산됩니다. 자세한 내용은 API 비율 제한을 참조하세요.
아직 인증을 설정하지 않았다면 설정합니다.
인증은 Google Cloud 서비스 및 API에 액세스하기 위해 ID를 확인하는 프로세스입니다.
로컬 개발 환경에서 코드 또는 샘플을 실행하려면 다음 옵션 중 하나를 선택하여 Compute Engine에 인증하면 됩니다.
Select the tab for how you plan to use the samples on this page:
gcloud
After installing the Google Cloud CLI,
initialize it by running the following command:
사용자 또는 서비스 계정에 NMI 신호를 VM으로 전송하는 데 필요한 권한이 있는지 확인하려면 관리자에게 프로젝트에 대한 Compute 인스턴스 관리자(v1)(roles/compute.instanceAdmin.v1) IAM 역할을 사용자 또는 서비스 계정에 부여해 달라고 요청하세요.
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.
이 사전 정의된 역할에는 NMI 신호를 VM에 전송하는 데 필요한 compute.instances.sendDiagnosticInterrupt 권한이 포함되어 있습니다.
관리자는 커스텀 역할이나 다른 사전 정의된 역할을 사용하여 사용자 또는 서비스 계정에 이 권한을 부여할 수도 있습니다.
개요
코어 덤프를 사용하여 응답하지 않는 VM 또는 보안 이슈를 디버깅하려면 다음 단계를 완료해야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-30(UTC)"],[[["\u003cp\u003eCore dumps from unresponsive virtual machines (VMs) can be collected by configuring the VMs to receive a Non-Maskable Interrupt (NMI) signal and then sending a \u003ccode\u003eSendDiagnosticInterrupt\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eCollecting core dumps requires specific permissions, namely the \u003ccode\u003ecompute.instances.sendDiagnosticInterrupt\u003c/code\u003e permission, typically granted through the Compute Instance Admin (v1) IAM role.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves configuring the VM's operating system to generate core dumps, which varies by OS, and then sending the NMI signal via either the Google Cloud CLI or REST API.\u003c/p\u003e\n"],["\u003cp\u003eThe success of the NMI signal delivery is indicated by an empty response, but the actual collection of the core dump depends on the VM's OS configuration, and the VM will likely be unreachable after.\u003c/p\u003e\n"],["\u003cp\u003eIf an NMI signal fails, it may be due to reasons such as the VM undergoing live migration, improper OS configuration, or a lack of required permissions, with troubleshooting steps provided.\u003c/p\u003e\n"]]],[],null,["# Collecting core dumps\n\nLinux Windows\n\n*** ** * ** ***\n\nUse core dumps to analyze the causes of an unresponsive virtual machine (VM)\ninstance.\n\nTo collect core dumps on Compute Engine, you must configure your\nVMs to receive a [Non-Maskable Interrupt (NMI)](https://en.wikipedia.org/wiki/Non-maskable_interrupt) signal, and then run a\n`SendDiagnosticInterrupt` command to prompt a kernel panic or blue screen in\nyour operating system. A kernel panic or blue screen starts a core dump\ncollection by the guest operating system. These core dumps can then be used for\ndebugging purposes especially in scenarios that are hard to reproduce, such as\na kernel freeze.\n\nBefore you begin\n----------------\n\n- Sending NMI signals are counted in the default **Queries** API quota. For more information, see [API rate limits](/compute/docs/api-rate-limits).\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 ### 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\n### Required roles\n\n\nTo ensure that your user or service account has the necessary\npermission to send NMI signals to a VM,\n\nask your administrator to grant your user or service account the\n\n\n[Compute Instance Admin (v1)](/iam/docs/roles-permissions/compute#compute.instanceAdmin.v1) (`roles/compute.instanceAdmin.v1`)\nIAM role on your project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains the\n` compute.instances.sendDiagnosticInterrupt`\npermission,\nwhich is required to\nsend NMI signals to a VM.\n\n\nYour administrator might also be able to give your user or service account\nthis permission\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nOverview\n--------\n\nTo use core dumps to help debug an unresponsive VM or a security issue,\nyou need to complete the following steps:\n\n1. [Configure your VM](#configure-os) to generate core dumps\n2. [Send an NMI signal](#send-nmi) to generate core dumps\n3. [Review](#review-core-dumps) the core dumps\n\nLimitations\n-----------\n\nFor VMs that have Secure Boot enabled, you must disable Secure boot before you send\nan NMI interrupt signal. For instructions, see\n[Modifying Shielded VM options on a VM instance](/compute/docs/instances/modifying-shielded-vm#modify-shielded-vm-instance).\n\nConfigure VM\n------------\n\nA VM's response to receiving an NMI interrupt signal depends on the VM's\noperating system configuration.\n\nEach operating system writes its core dump logs in a different location. For\nexample in Ubuntu operating systems the crash dump file is saved to\n`/var/crash/` by default.\n\nTo configure your guest OS to generate a crash dump when an NMI signal is\nreceived, review the documentation for the supported operating system.\n\nSend NMI to generate core dumps\n-------------------------------\n\nAfter you configure the VM, you can then send the NMI signal to the VM by using\neither the [Google Cloud CLI](/compute/docs/gcloud-compute), or\n[REST](/compute/docs/reference/rest/v1).\n**Note:** When you configure your VM to trigger kernel panic and generate crash dumps, the VM becomes unreachable after the NMI signal is sent. If you want to connect to the VM after the signal is sent, you need to restart the VM. \n\n### gcloud\n\nTo send the NMI signal, use the\n[`instances send-diagnostic-interrupt` command](/sdk/gcloud/reference/compute/instances/send-diagnostic-interrupt). \n\n```\ngcloud compute instances send-diagnostic-interrupt VM_NAME \\\n --zone=ZONE\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: instance ID or name of the VM that you want to collect core dumps from\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone where your VM is located\n\nThe output is similar to the following: \n\n```\n\u003cEmpty Response\u003e\n```\n\nFor a complete list of outputs, see the next section in this document about\n\"NMI command responses\".\n\n### REST\n\n1. Optional. If not already available, create an API key.\n For more information about creating API keys, see\n [Creating an API key](/docs/authentication/api-keys#creating_an_api_key).\n\n2. To send the NMI signal, make a `POST` request to the [`sendDiagnosticInterrupt` method](/compute/docs/reference/rest/v1/instances/sendDiagnosticInterrupt).\n\n ```\n POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/sendDiagnosticInterrupt?key=API_KEY\n ```\n\n For, example, you can use the `curl` command to make the request as follows: \n\n ```\n curl --request POST 'https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/sendDiagnosticInterrupt?key=API_KEY' \\\n --header 'Authorization: Bearer $(gcloud auth print-access-token)' \\\n --header 'Accept: application/json' \\\n --compressed\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: ID of the project to create the VM in\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone where your VM is located\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: instance ID or name of the VM that you want to collect core dumps from\n - \u003cvar translate=\"no\"\u003eAPI_KEY\u003c/var\u003e: your API key\n\n The output is similar to the following: \n\n ```\n \u003cEmpty Response\u003e\n ```\n\n For a complete list of outputs, see the next section in this document\n about \"NMI command responses\".\n\n### NMI command responses\n\nOne of the following responses are returned when you attempt to send an\nNMI signal.\n\nReview core dumps\n-----------------\n\nReview the crash dump file in the configured or default location for your\noperating system.\n\nFor example in Ubuntu operating systems, by default, the crash dump file is\nsaved to `/var/crash/`."]]