이 문서에서는 Compute Engine 인스턴스의 단계적 종료 프로세스를 간략하게 설명합니다. 인스턴스가 수명 주기 동안 거칠 수 있는 상태에 관한 자세한 내용은 Compute Engine 인스턴스 수명 주기를 참고하세요.
인스턴스를 중지하거나 삭제할 때 Compute Engine을 사용하면 게스트 OS가 완전히 종료될 때까지 짧은 시간이 허용됩니다. 게스트 OS가 이 시간 내에 작업 실행을 완료하지 않으면 Compute Engine에서 강제로 종료되며, 이로 인해 데이터 손실 또는 파일 시스템 손상이 발생할 수 있습니다.
이러한 문제를 방지하기 위해 인스턴스에서 단계적 종료를 사용 설정할 수 있습니다. 이 설정을 사용 설정하면 게스트 OS에서 Compute Engine이 종료되기까지 최대 1시간 동안 작업 실행을 완료할 수 있습니다. 단계적 종료는 다음을 수행하려는 시나리오에 유용합니다.
고성능 컴퓨팅(HPC) 작업을 완전히 종료할 수 있도록 허용합니다.
데이터베이스가 활성 트랜잭션 제출을 완료하도록 허용합니다.
이메일 서버가 종료되기 전에 처리를 완료하도록 허용합니다.
멀티플레이어 게임 세션의 실행을 완료하도록 허용합니다.
단계적 종료 정보
다음 섹션에서는 단계적 종료가 작동하는 방식을 설명합니다.
종료 기간
컴퓨팅 인스턴스에서는 기본적으로 단계적 종료가 사용 중지됩니다. 인스턴스를 만들거나 업데이트할 때 사용 설정할 수 있습니다. 단계적 종료를 사용 설정하면 다음과 같이 종료 기간을 지정할 수 있습니다.
기본 기간: 종료 기간을 지정하지 않으면 Compute Engine은 기본 기간인 10분을 사용합니다.
커스텀 기간: 1초에서 1시간까지
애플리케이션이 실행 중인 작업을 완료할 수 있는 충분한 시간을 제공하는 종료 기간을 선택하는 것이 좋습니다. 예를 들어 애플리케이션이 작업 실행을 완료하는 데 10분이 필요하다고 예상되면 종료 기간을 15분으로 지정하는 것이 좋습니다. 이 접근 방식을 사용하면 작업이 강제로 중지되고 데이터가 손상되는 것을 방지할 수 있습니다. 게스트 OS의 모든 작업이 실행 완료되면 다음 섹션에 설명된 대로 비용을 절약하기 위해 단계적 종료를 수동으로 종료할 수 있습니다.
종료 프로세스
단계적 종료가 사용 설정된 컴퓨팅 인스턴스를 중지 또는 삭제하거나 Compute Engine에서 예약된 중지 또는 삭제를 위해 해당 인스턴스를 중지 또는 삭제하면 인스턴스 상태가 PENDING_STOP으로 변경됩니다. 단계적 종료가 시작되어 애플리케이션에서 작업 실행을 완료할 수 있습니다.
Compute Engine은 단계적 종료 기간이 만료될 때 인스턴스의 단계적 종료를 종료하거나 다음과 같이 수동으로 단계적 종료를 종료합니다.
게스트 OS 내에서. 게스트 OS의 종료 명령어(예: sudo shutdown -h now)를 사용하여 인스턴스를 중지합니다.
Google Cloud에서. 다음 메서드 중 하나를 사용하여 인스턴스를 중지하거나 삭제합니다.
Google Cloud 콘솔: 다음 단계를 완료합니다.
VM 인스턴스 페이지로 이동합니다.
인스턴스를 선택한 다음 stop중지 또는 delete삭제를 클릭합니다. 중지 또는 삭제 옵션이 없는 경우 more_vert작업 더보기 >stop중지 또는 delete삭제를 클릭합니다.
표시되는 대화상자에서 인스턴스 중지 또는 삭제를 확인하기 전에 단계적 종료 건너뛰기(해당하는 경우) 체크박스를 선택합니다.
Google Cloud CLI: 명령어에 --no-graceful-shutdown 플래그를 포함합니다.
인스턴스에서 단계적 종료를 사용 설정한 후에도 단계적 종료 프로세스를 거치지 않고 인스턴스를 중지하거나 삭제할 수 있습니다. 이 접근 방식은 예를 들어 특정 날짜에 인스턴스를 단계적으로 종료할 필요가 없거나 인스턴스에서 실행 중인 워크로드가 변경된 경우 비용을 절약하는 데 도움이 됩니다.
단계적 종료를 건너뛰려면 다음 중 하나를 실행합니다.
단일 작업의 단계적 종료 건너뛰기 단계적 종료는 사용 설정 상태로 유지하되 특정 중지 또는 삭제 작업의 경우 이를 우회합니다. 이렇게 하려면 수동 종료 프로세스를 따르세요.
인스턴스에 호스트 유지보수 정책이 TERMINATE로 설정되어 있고 Compute Engine이 호스트 이벤트에 대해 인스턴스를 중지합니다.
프로젝트 및 리전별로 한 번에 최대 8,000개의 인스턴스만 단계적으로 종료하고 삭제할 수 있습니다.
Compute Engine에서 모든 인스턴스 생성을 완료한 후에만 일괄 생성된 인스턴스에 대해 단계적 종료를 실행하거나 단계적 종료 설정을 수정할 수 있습니다.
가격 책정
컴퓨팅 인스턴스에서 단계적 종료를 사용 설정하거나 사용 중지하는 데는 비용이 들지 않습니다.
하지만 단계적 종료가 사용 설정된 인스턴스를 중지하거나 삭제하면 인스턴스가 실행 중인 것처럼 인스턴스에 대한 요금이 계속 청구됩니다. 이러한 요금은 단계적 종료 기간이 종료되고 인스턴스 상태가 STOPPING으로 변경되면 중지됩니다.
[[["이해하기 쉬움","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-26(UTC)"],[[["\u003cp\u003eGraceful shutdown allows Compute Engine instances up to one hour to complete tasks before shutting down, preventing potential data loss or file corruption.\u003c/p\u003e\n"],["\u003cp\u003eYou can enable graceful shutdown on an instance when creating or updating it, specifying a custom shutdown period from one second up to one hour, or using the default 10-minute period.\u003c/p\u003e\n"],["\u003cp\u003eDuring a graceful shutdown, the instance enters a \u003ccode\u003ePENDING_STOP\u003c/code\u003e state, and the shutdown process can be manually ended either from within the guest OS or through the Google Cloud console, CLI, or REST API.\u003c/p\u003e\n"],["\u003cp\u003eGraceful shutdown can be skipped for single operations or disabled entirely, offering flexibility in managing instance shutdowns based on workload needs.\u003c/p\u003e\n"],["\u003cp\u003eGraceful shutdown is subject to limitations, such as not being available for managed instance groups (MIGs) or instances with limited runtime, and incurs charges until the shutdown period ends.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis document gives an overview of the graceful shutdown process in\nCompute Engine instances. To learn more about the states that an instance can\ngo through during its lifecycle, see\n[Compute Engine instance lifecycle](/compute/docs/instances/instance-lifecycle).\n\nWhen stopping or deleting an instance, Compute Engine allows a\n[short time](/compute/docs/instances/suspend-stop-reset-instances-overview#stopping-instance)\nfor the guest OS to fully shut down. If the guest OS doesn't finish running\ntasks within this time, then Compute Engine forces a shutdown, which can\npotentially lead to data loss or corrupt file systems.\n\nTo prevent these issues, you can enable graceful shutdown in an instance. With\nthis setting enabled, the guest OS has up to one hour to finish running tasks\nbefore Compute Engine shuts it down. Graceful shutdown is useful for\nscenarios when you want to achieve the following:\n\n- Allowing a high performance computing (HPC) job to fully shut down.\n\n- Allowing a database to finish submitting active transactions.\n\n- Allowing an email server to finish processing before shutdown.\n\n- Allowing a multiplayer game session to finish running.\n\n| **Important:** If you use [shutdown scripts](/compute/docs/shutdownscript) with graceful shutdown, then your scripts run after the graceful shutdown process ends. To give your scripts enough time to complete, and avoid potential data loss or incomplete tasks, we recommend running your scripts during the graceful shutdown period.\n\nAbout graceful shutdown\n\nThe following sections explain how graceful shutdown works.\n\nShutdown period\n\nIn a compute instance, graceful shutdown is disabled by default. You can enable\nit when creating or updating an instance. When you enable graceful shutdown, you\ncan specify a shutdown period as follows:\n\n- **Default period**: if you don't specify a shutdown period, then\n Compute Engine uses a default period of 10 minutes.\n\n- **Custom period**: from one second up to one hour.\n\nWe recommend choosing a shutdown period that gives your applications enough time\nto finish running tasks. For example, if you estimate that your applications\nneed 10 minutes to finish running tasks, we recommend specifying a 15-minute\nshutdown period. This approach prevents tasks from being forcefully stopped and\nthe potential corruption of data. After all tasks in the guest OS have finished\nrunning, you can manually end the graceful shutdown to save costs, as described\nin the next section.\n\nShutdown process\n\nWhen you stop or delete a compute instance that has graceful shutdown enabled,\nor if Compute Engine stops or deletes it for a scheduled stop or\ndeletion, the instance state changes to `PENDING_STOP`. The graceful shutdown\nbegins, allowing your applications to finish running their tasks.\n\nCompute Engine ends the graceful shutdown of an instance when the\ngraceful shutdown period times out, or you manually end the graceful shutdown as\nfollows:\n\n- **From within the guest OS** . You stop the instance using the shutdown\n command of the guest OS; for example, `sudo shutdown -h now`.\n\n- **From Google Cloud**. You stop or delete the instance using one of the\n following methods:\n\n - **Google Cloud console**: complete the following steps:\n\n 1. Go to the **VM instances** page.\n\n 2. Select the instance, and then click\n stop **Stop** or\n delete **Delete** . If there is\n no **Stop** or **Delete** option, click\n more_vert **More actions \\\u003e**\n stop **Stop** or\n delete **Delete**.\n\n 3. In the dialog that appears, select the\n **Skip graceful shutdown (if applicable)** checkbox before\n confirming to stop or delete the instance.\n\n - **Google Cloud CLI** : include the `--no-graceful-shutdown` flag in the\n command.\n\n - **REST API** : include the `noGracefulShutdown=true` query\n parameter in the request URL.\n\n| **Caution:** Ensure that all tasks in the guest OS have finished running before the graceful shutdown period times out, or you manually end the graceful shutdown. Otherwise, Compute Engine forcefully stops any running tasks, which can potentially lead to data loss or corrupt file systems.\n\nWhen the graceful shutdown process ends, Compute Engine sends the\n[Advanced Configuration and Power Interface (ACPI) G2 Soft Off signal](https://en.wikipedia.org/wiki/ACPI#Global_states)\nto the guest OS, sets the instance state to `STOPPING`, and then continues with\nthe stop or delete operation.\n\nStopping or deleting without graceful shutdown\n\nAfter you've enabled graceful shutdown in an instance, you can still stop or\ndelete it without going through the graceful shutdown process. This approach\nhelps you save costs when, for example, you don't need to gracefully shut down\nyour instance on a specific day, or if the workload running on the instance has\nchanged.\n\nTo skip graceful shutdown, do one of the following:\n\n- **Skip graceful shutdown for single operations** . Keep graceful shutdown\n enabled, but bypass it for specific stop or delete operations. To do this,\n follow the [manual shutdown process](#process).\n\n- **Disable graceful shutdown entirely** . If you no longer need to gracefully\n shut down an instance, then you can disable this feature. For more\n information, see\n [Disable graceful shutdown in a Compute Engine instance](/compute/docs/instances/disable-graceful-shutdown).\n\nLimitations\n\nGraceful shutdown has the following limitations:\n\n- You can't enable graceful shutdown in the following compute instances:\n\n - Instances that are part of a managed instance group (MIG).\n\n - Instances that specify a\n [limited runtime](/compute/docs/instances/limit-vm-runtime).\n\n- After you enable graceful shutdown in an instance, you can't do the\n following:\n\n - You can't update instance properties that\n [require a restart](/compute/docs/instances/update-instance-properties#updatable-properties).\n\n - If the instance is a TPU VM, then you can't simulate host maintenance\n events.\n\n- If a graceful shutdown is in progress (`PENDING_STOP`), then you can't do\n the following:\n\n - You can't update instance properties.\n\n - If the instance is being deleted, then you can't enable or disable\n [deletion protection](/compute/docs/instances/preventing-accidental-vm-deletion).\n\n- Your instance doesn't gracefully shut down, or a graceful shutdown is\n interrupted, if the following occurs:\n\n - Your Spot VM or preemptible instance is\n [preempted](/compute/docs/instances/preemptible#preemption-process).\n\n - Your instance has a\n [host maintenance policy](/compute/docs/instances/setting-vm-host-options#available_host_maintenance_properties)\n set to `TERMINATE`, and Compute Engine stops the instance for a\n host event.\n\n- You can only gracefully shut down and delete up to 8,000 instances at a time\n per project and per region.\n\n- You can gracefully shut down or modify graceful shutdown settings for\n instances created in bulk only after Compute Engine finishes\n creating all instances.\n\nPricing\n\nThere is no cost to enable or disable graceful shutdown in a compute instance.\nHowever, when you stop or delete an instance that has graceful shutdown enabled,\nyou continue to incur charges for the instance as if it was running. These\ncharges stop when the graceful shutdown period ends and the instance state\nchanges to `STOPPING`.\n\nFor more detailed pricing information, see\n[VM instance pricing](/compute/vm-instance-pricing).\n\nWhat's next\n\n- [Enable graceful shutdown in a Compute Engine instance](/compute/docs/instances/enable-graceful-shutdown)\n\n- [View graceful shutdown in a Compute Engine instance](/compute/docs/instances/view-graceful-shutdown)"]]