このドキュメントでは、既存の Compute Engine インスタンスで正常なシャットダウンを無効にする方法について説明します。個々の停止オペレーションまたは削除オペレーションで正常なシャットダウンをスキップする方法など、正常なシャットダウンの詳細については、正常なシャットダウンの概要をご覧ください。
インスタンスで正常なシャットダウンを有効にしている場合は、無効にして次のことができます。
停止オペレーションや削除オペレーションを高速化して、不要な費用を回避します。
再起動が必要なインスタンス プロパティを更新します。
始める前に
-
まだ設定していない場合は、認証を設定します。認証とは、 Trusted Cloud by S3NS サービスと API にアクセスするために ID を確認するプロセスです。ローカル開発環境からコードまたはサンプルを実行するには、次のいずれかのオプションを選択して Compute Engine に対する認証を行います。
Select the tab for how you plan to use the samples on this page:
Console
When you use the Trusted Cloud console to access Trusted Cloud by S3NS services and APIs, you don't need to set up authentication.
gcloud
-
After installing the Google Cloud CLI, sign in to the gcloud CLI with your federated identity and then initialize it by running the following command:
gcloud init
- Set a default region and zone.
Trusted Cloud コンソールで、[VM インスタンス] ページに移動します。
[名前] 列でインスタンス名をクリックして詳細を表示します。
インスタンスの詳細ページが開き、[詳細] タブが選択されています。
[
編集] をクリックします。[管理] セクションで、[VM を正常にシャットダウンする] チェックボックスをオフにします。
[保存] をクリックします。
INSTANCE_NAME
: インスタンスの名前。ZONE
: インスタンスが配置されているゾーン。空の JSON ファイルを作成します。
既存のインスタンスのプロパティを表示するには、ベータ版
instances.get
メソッドにGET
リクエストを送信します。GET https://compute.s3nsapis.fr/compute/beta/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME
次のように置き換えます。
PROJECT_ID
: インスタンスが配置されているプロジェクトの ID。ZONE
: インスタンスが配置されているゾーン。INSTANCE_NAME
: 既存のインスタンスの名前。
前の手順で作成した空の JSON ファイルで、次の操作を行います。
GET
リクエストの出力からインスタンス プロパティを入力します。gracefulShutdown.enabled
フィールドを見つけ、その値をfalse
に変更します。{ ... "scheduling": { ... "gracefulShutdown": { "enabled": false } }, ... }
インスタンスを更新するには、ベータ版
instances.update
メソッドにPUT
リクエストを送信します。次にその内容を示します。リクエスト URL に
mostDisruptiveAllowedAction
クエリ パラメータを含めます。リクエスト本文には、前の手順で作成して更新した JSON ファイルのインスタンス プロパティを含めます。
インスタンスを更新する
PUT
リクエストは次のようになります。PUT https://compute.s3nsapis.fr/compute/beta/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME?mostDisruptiveAllowedAction=ALLOWED_ACTION { ... "scheduling": { ... "gracefulShutdown": { "enabled": false } }, ... }
ALLOWED_ACTION
は次のいずれかの値に置き換えます。NO_EFFECT
: リクエストは、更新リクエストが有効であるかどうか、リソースが使用可能かどうかを確認しますが、インスタンスは更新しません。REFRESH
: 変更したインスタンス プロパティでインスタンスの再起動が不要な場合、Compute Engine はインスタンスを更新します。
REST
このページの REST API サンプルをローカル開発環境で使用するには、gcloud CLI に指定した認証情報を使用します。
After installing the Google Cloud CLI, sign in to the gcloud CLI with your federated identity and then initialize it by running the following command:
gcloud init
詳細については、 Trusted Cloud 認証ドキュメントの REST を使用して認証するをご覧ください。
必要なロール
コンピューティング インスタンスで正常なシャットダウンを無効にするために必要な権限を取得するには、プロジェクトに対する Compute インスタンス管理者(v1)(
roles/compute.instanceAdmin.v1
)IAM ロールを付与するよう管理者に依頼します。ロールの付与については、プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。この事前定義ロールには、コンピューティング インスタンスで正常なシャットダウンを無効にするために必要な
compute.instances.update
on the instanceカスタムロールや他の事前定義ロールを使用して、この権限を取得することもできます。
インスタンスで正常なシャットダウンを無効にする
インスタンスを再起動せずに、コンピューティング インスタンスで正常なシャットダウンを無効にできます。ただし、インスタンスが正常にシャットダウン中(
PENDING_STOP
)の間は、正常なシャットダウンを無効にすることはできません。インスタンスで正常なシャットダウンを無効にするには、次のいずれかのオプションを選択します。
コンソール
gcloud
インスタンスで正常なシャットダウンを無効にするには、
--no-graceful-shutdown
フラグを指定してgcloud beta compute instances update
コマンドを使用します。gcloud beta compute instances update INSTANCE_NAME \ --no-graceful-shutdown \ --zone=ZONE
次のように置き換えます。
REST
インスタンスのプロパティの更新の詳細については、インスタンス プロパティを更新するをご覧ください。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-21 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-21 UTC。"],[[["\u003cp\u003eThis document provides instructions on how to disable graceful shutdown for Compute Engine instances, which is a feature that delays the stop or delete process.\u003c/p\u003e\n"],["\u003cp\u003eDisabling graceful shutdown can speed up stop or delete operations and is required before updating certain instance properties that require a restart.\u003c/p\u003e\n"],["\u003cp\u003eThe process of disabling graceful shutdown can be done without needing to restart the instance, and can be accomplished through the Google Cloud console, \u003ccode\u003egcloud\u003c/code\u003e command-line tool, or REST API.\u003c/p\u003e\n"],["\u003cp\u003eTo disable graceful shutdown, users need the \u003ccode\u003ecompute.instances.update\u003c/code\u003e permission, which is typically granted through the Compute Instance Admin (v1) IAM role.\u003c/p\u003e\n"],["\u003cp\u003ePre-GA products or features, like the ones discussed within, are "as is" and may feature limited support, along with terms specified within the "Pre-GA Offerings Terms".\u003c/p\u003e\n"]]],[],null,[]] -