このドキュメントでは、予約を削除する方法について説明します。将来の予約リクエストを削除する方法については、将来の予約リクエストをキャンセルまたは削除するをご覧ください。
不要になった予約済みリソースに対する課金を停止するには、予約を削除します。
制限事項
予約を削除する前に、次の点を考慮してください。
共有予約を削除できるのは、作成したプロジェクト内のみです。
特定のターゲットの予約を削除できるのは、Compute Engine インスタンスがその予約を使用していない場合のみです。インスタンスが予約を使用している場合は、削除する前に次のいずれかを行います。
将来の予約に対して自動作成された予約は、予約期間が終了した後にのみ削除できます。
コミットメントに関連付けられている予約を削除するには、まず予約を置き換えることで関連付けを解除する必要があります。
始める前に
-
まだ設定していない場合は、認証を設定します。認証では、 Google Cloud サービスと API にアクセスするための ID が確認されます。ローカル開発環境からコードまたはサンプルを実行するには、次のいずれかのオプションを選択して Compute Engine に対する認証を行います。
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
-
Google Cloud CLI をインストールします。 インストール後、次のコマンドを実行して Google Cloud CLI を初期化します。
gcloud init
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
- Set a default region and zone.
Go
ローカル開発環境でこのページの Go サンプルを使用するには、gcloud CLI をインストールして初期化し、ユーザー認証情報を使用してアプリケーションのデフォルト認証情報を設定します。
Google Cloud CLI をインストールします。
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
詳細については Set up authentication for a local development environment をご覧ください。
Java
ローカル開発環境でこのページの Java サンプルを使用するには、gcloud CLI をインストールして初期化し、ユーザー認証情報を使用してアプリケーションのデフォルト認証情報を設定します。
Google Cloud CLI をインストールします。
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
詳細については Set up authentication for a local development environment をご覧ください。
Node.js
ローカル開発環境でこのページの Node.js サンプルを使用するには、gcloud CLI をインストールして初期化し、ユーザー認証情報を使用してアプリケーションのデフォルト認証情報を設定します。
Google Cloud CLI をインストールします。
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
詳細については Set up authentication for a local development environment をご覧ください。
Python
ローカル開発環境でこのページの Python サンプルを使用するには、gcloud CLI をインストールして初期化し、ユーザー認証情報を使用してアプリケーションのデフォルト認証情報を設定します。
Google Cloud CLI をインストールします。
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
詳細については Set up authentication for a local development environment をご覧ください。
REST
このページの REST API サンプルをローカル開発環境で使用するには、gcloud CLI に指定した認証情報を使用します。
Google Cloud CLI をインストールします。
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
詳細については、 Google Cloud 認証ドキュメントの REST を使用して認証するをご覧ください。
必要なロール
予約の削除に必要な権限を取得するには、プロジェクトに対する Compute 管理者(
roles/compute.admin
)IAM ロールを付与するよう管理者に依頼してください。ロールの付与については、プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。この事前定義ロールには、予約の削除に必要な
compute.reservations.delete
権限が含まれています。カスタムロールや他の事前定義ロールを使用して、この権限を取得することもできます。
予約の削除
一致するコンピューティング インスタンスによって自動的に使用できる予約を削除しても、削除された予約を使用するインスタンスは引き続き実行されます。これらのインスタンスに対しては引き続き料金が発生します。
予約は 1 つずつ削除することも、複数まとめて削除することもできます。複数の予約の場合は、 Google Cloud コンソールを使用します。単一の予約の場合は、次のいずれかのオプションを選択します。
コンソール
Google Cloud コンソールで、[予約] ページに移動します。
[オンデマンド予約] タブ(デフォルト)で、削除する予約を選択します。
[
削除] をクリックします。[削除] をクリックして確定します。
gcloud
予約を削除するには、
gcloud compute reservations delete
コマンドを使用します。gcloud compute reservations delete RESERVATION_NAME \ --zone=ZONE
次のように置き換えます。
RESERVATION_NAME
: 予約の名前。ZONE
: 予約が存在するゾーン。
Go
Java
Node.js
Python
REST
予約を削除するには、
reservation.delete
メソッドにDELETE
リクエストを送信します。DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME
次のように置き換えます。
PROJECT_ID
: 予約を作成したプロジェクトの ID。ZONE
: 予約が存在するゾーン。RESERVATION_NAME
: 予約の名前。
次のステップ
- 予約を表示する方法を確認する。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-10-19 UTC。
-