简体   繁体   English

如何暂停/恢复 GCE VM

[英]How to suspend/resume GCE VM

We need the ability to suspend/resume GCE VMs to optimize the use of Compute Engine resources.我们需要暂停/恢复 GCE VM 的能力,以优化计算引擎资源的使用。

Right now this feature is available in gcloud alpha :现在这个功能在gcloud alpha中可用:

gcloud alpha compute instances suspend INSTANCE_NAMES [INSTANCE_NAMES …] [--async][--discard-local-ssd] [--zone=ZONE] [GCLOUD_WIDE_FLAG …]

But when I executed this command I got this error :但是当我执行这个命令时,我得到了这个错误

HTTPError 400: Invalid Resource Usage:'Suspend Instance Feature is not available for this project.' HTTPError 400:资源使用无效:“暂停实例功能不适用于此项目。”

Can anyone suggest to me ways to suspend Google Cloud VM?谁能向我建议暂停 Google Cloud VM 的方法? From the error stated, I get an understanding that we need some permission to include feature in the project.从陈述的错误中,我了解到我们需要一些许可才能在项目中包含功能。 Can anyone suggest to me ways to include Suspend Instance Feature in this project?任何人都可以向我建议在该项目中包含暂停实例功能的方法吗?

You need to apply for early access for this feature and have your project registered with Google.您需要申请此功能的抢先体验,并在 Google 注册您的项目。 Contact Google Support .联系谷歌支持 Include your email address, the project ID in your request and how you will be using the API.在您的请求中包括您的电子邮件地址、项目 ID 以及您将如何使用 API。

Do not expect a rapid response.不要指望快速响应。 My requests sometimes takes several weeks for approval.我的请求有时需要数周才能获得批准。

This feature is available in beta mode with GCP now.此功能现在可在 GCP 的 Beta 模式下使用。

gcloud beta compute instances suspend <instance-name>

gcloud beta compute instances resume <instance-name>

I tried this on Gcloud SDK and it has prompted me to install beta utility which worked for me..我在 Gcloud SDK 上试过这个,它提示我安装对我有用的 beta 实用程序。

More details can be found at https://cloud.google.com/sdk/gcloud/reference/beta/compute/instances/suspend更多详细信息,请访问https://cloud.google.com/sdk/gcloud/reference/beta/compute/instances/suspend

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 docker 容器完成后自动关闭 GCE VM? - How to automatically shutdown a GCE VM after the docker container finishes? 如何将数据从 GCS 传输到 Colab GCE VM? - How to transfer data from GCS to Colab GCE VM? GCE - 我们无法连接到端口 22 上的虚拟机 - GCE - We are unable to connect to the VM on port 22 如何将文件从 GCE VM 上的 R Studio 服务器保存到 Google Cloud Bucket? 可能的设置问题 - How to save files from R Studio-server on GCE VM to a Google Cloud Bucket? Possible settings issue 如何在 GCE 上将 NodePort 暴露给 inte.net - How to expose NodePort to internet on GCE 如何允许 GCE 中私有实例之间的通信 - How to allow communication between private instances in GCE 如何重命名 GCE 永久磁盘? - How do you rename a GCE persistent disk? 如何阻止正在调用 firebase 的挂起 function - How to block a suspend function that is calling firebase 通过带有外部 IP 的美国 GCE VM 从多区域美国存储桶中读取的成本 - Cost of reading from mulit-region US bucket via US GCE VM with external IP 如何为 App Engine/Java 上的单个请求暂停 appstats? - How can I suspend appstats for a single request on App Engine/Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM