削除できるカスタム イメージは、ご自身またはプロジェクトへのアクセス権を持つ他のユーザーが追加したカスタム イメージのみです。
イメージのバックアップを維持するには、削除する前にカスタム イメージを Cloud Storage にエクスポートします。
始める前に
- Images ドキュメントを確認します。
-
まだ設定していない場合は、認証を設定します。認証とは、 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
-
After installing the Google Cloud CLI, initialize it by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
- Set a default region and zone.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
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.
Google Cloud コンソールで [イメージ] ページに移動します。
削除するイメージの左側にあるチェックボックスをオンにします。
ページの上部にある [削除] をクリックします。イメージは削除されます。
PROJECT_ID
: イメージが属するプロジェクト。RESOURCE_ID
: 削除するイメージの名前。
Python
ローカル開発環境でこのページの Python サンプルを使用するには、gcloud CLI をインストールして初期化し、ユーザー認証情報を使用してアプリケーションのデフォルト認証情報を設定します。
詳細については Set up authentication for a local development environment をご覧ください。
REST
このページの REST API サンプルをローカル開発環境で使用するには、gcloud CLI に指定した認証情報を使用します。
After installing the Google Cloud CLI, initialize it by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
詳細については、 Google Cloud 認証ドキュメントの REST を使用して認証するをご覧ください。
カスタム イメージの削除
次のいずれかの方法でイメージを削除します。
コンソール
gcloud
gcloud compute images delete
コマンドを使用して、イメージを削除します。gcloud compute images delete IMAGE_NAME
IMAGE_NAME
は、削除するイメージの名前に置き換えます。Go
Java
Python
REST
images().delete
メソッドにPOST
リクエストを送信します。削除するイメージの名前を指定します。POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/images/RESOURCE_ID
次のように置き換えます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-14 UTC。
-