使用 bash 或 python 脚本启动和停止 GCE 实例

Start and stop GCE instances using bash or python script

我有 GCE 实例设置并且已经在使用中。使用一些服务设置和 运行。我需要能够停止它并在 cron 作业中使用 bash 或 python 脚本启动它,因为我不会只在特定时间和日期成为 运行。这可能吗?如果我可以制作快照并从中恢复也很好。

您使用命令行 (gcloud tool) or Google Compute API 启动或停止实例。您可以在脚本中实现上述任何方法。

此外,您可以查看最近公布的 Preemptible 个实例。这些实例定期运行,非常适合批处理等作业。