我想使用GCE服務器和VNC來運行我編寫的一些桌面程序。但是,我想不讓GCE服務器一直在運行(爲了節省費用),我想讓VNC桌面的設置保持不變(以節省時間)。看起來最簡單的方法是以某種方式休眠GCE實例。有沒有辦法從腳本或從命令行執行此操作?如何休眠Google Compute Engine服務器?
回答
我知道的唯一當前支持的技術是使用可啓動的持久磁盤,它超過了虛擬機,因此您可以通過適度快速(不到30秒)的啓動時間刪除並重新啓動虛擬機,因爲除非您的應用程序內置了強大的檢查點/恢復邏輯,否則您可能無法從桌面上停止的位置獲取內容。
解決此問題的另一種方法是使用輕量級容器,如Docker,該容器在其設計中內置了暫停/恢復和檢查點。您目前無法在Google Compute Engine上運行Docker容器,但我們有興趣探索Docker對GCE的潛力,敬請關注。
聽起來像你真正想要的是一種本地暫停功能,即時恢復,暫停狀態下沒有或非常低的虛擬機收費。我認爲這是一個有趣的想法 - 我已經向計算引擎工程團隊提交了內部功能請求,供將來考慮。
計算引擎有alpha support for suspending virtual machines。來自該文檔的報價:
gcloud alpha compute instances suspend
用於暫停Google Compute引擎虛擬機。暫停虛擬機相當於睡眠或待機模式:來賓收到ACPI S3掛起信號,之後所有虛擬機狀態都保存到臨時存儲器。一個實例只能在RUNNING狀態下掛起。暫停的實例將處於SUSPENDED狀態。
的命令是尚未計算引擎的網絡用戶界面提供,但可以像在命令行中調用:
gcloud alpha compute instances suspend my-vm
處於暫停狀態的虛擬機仍處於運行狀態時是否還會產生費用? – killjoy
- 1. 如何使用GUI連接到Google Compute Engine虛擬服務器?
- 2. 如何在Google Compute Engine上執行服務器更新?
- 3. Google Compute Engine GPU
- 4. 調試Google Compute Engine代理服務器拒絕連接
- 5. 'Google App Engine'遠比'Google Compute Engine'貴嗎?
- 6. 如何在Google Compute Engine上驗證BigQuery?
- 7. Google Compute Engine負載平衡器限制
- 8. Google Compute Engine上的Spark SQL
- 9. Google Compute Engine上的FreeBSD
- 10. 在Google Compute Engine的Ubuntu上安裝可擴展服務代理
- 11. 如何爲Google Compute Engine虛擬機創建新的服務帳戶?
- 12. Websphere服務器/休眠內存泄漏?
- 13. 休眠,服務器特定配置
- 14. 休眠與SQL服務器2014年
- 15. 休眠:@Temporal與服務器和MySQL
- 16. 休眠與MSSQL服務器2008
- 17. 休眠執行Sql服務器程序
- 18. 休眠JPQL CURRENT_DATE沒有SQL服務器
- 19. Google App Engine與Google Compute Engine有什麼區別?
- 20. 啓用Google Container Engine API不會自動啓用Google Compute Engine API
- 21. JSF,休眠和服務BLOB
- 22. 在Google Compute Engine上成功安裝Oryx?
- 23. 端口5432在Google Compute Engine上關閉
- 24. Google Compute Engine - 刪除帳戶+資源
- 25. 在Debian(Google Compute Engine)上安裝libssl0.9.7
- 26. 在Google Compute Engine上添加Secundary IP
- 27. Google Compute Engine虛擬機備份策略
- 28. Gitlab - Google compute engine持續交付
- 29. Google Compute Engine:來自OAuth的錯誤403
- 30. Google Compute Engine中的Oracle數據庫
我希望這樣的事情時,休眠(HTTP:// WWW。 cyberciti.biz/faq/linux-command-to-suspend-hibernate-laptop-netbook-pc/),但我猜GCE內核不支持。感謝您添加功能請求。 –