英文:
How to suspend a MIG in GCP so that I can stop a VM for cost saving
问题
我有一个具有1个VM的托管实例组(未配置自动缩放和自动修复)。我需要在周末停止VM以降低成本。如何能够在采取最少步骤且安全的情况下灵活地实现这一目标?我不想擦除状态(磁盘)。
我尝试了一些选项,比如放弃,这将使实例从MIG中移除,但无法再次添加到MIG。任何建议都将不胜感激。谢谢。
英文:
I have a managed instance group with 1 VM (Autoscaling and Autohealing are not configured). I need to stop the VM over weekends to reduce cost? How can I flexibly do that taking minial steps and securely? I do not want to erase the state (disk).
I tried options like abandon which will take instance out of MIG but cannot add it again to MIG. Any advise is appreciated. Thank you.
答案1
得分: 1
以下是翻译好的部分:
Option 1: 暂停虚拟机
如果您希望保留虚拟机实例但在不使用时不收费,可以将虚拟机暂停。在暂停虚拟机时,Google会保留虚拟机在您的项目中,并将虚拟机内存的内容移至存储中。在虚拟机暂停期间,Google仅对用于保留虚拟机内存的存储收费。
Option 2: 使用有状态的MIG:
如果您希望保留MIG的状态(附加磁盘和元数据),这对于数据库、数据处理等操作是推荐的。
英文:
Picked this from Google docs which might help you: (Note: both have limitations)
Option 1: Suspending a VM
If you want to keep your VM instance around but do not want to be charged for it when it is not in use, you can suspend the VM. When you suspend a VM, Google preserves the VM in your project and moves the contents of the VM's memory to storage. While the VM is suspended, Google only charges for the storage used to preserve the VM's memory.
Option 2: Using stateful MIGs:
If you want to preserve a state of a MIG (attached disks & metadata). This is recommended for DB, data processing etc.,
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论