Google Cloud Platform (GCP)
Instance Template
Steps:
- 建立 VM Instance (via web)
- 關閉 VM Instance
- 建立 Custom Image for VM Instance (via web)
- 建立 Instance Template for Custom Image (via web)
- Boot Disk: Custom Image
- Region: Global (Recommend)
- 用 Instance Template 新增多個 VM Instances(via CLI or web)
# sets up the authentication
gcloud init
# create new VM instances with the template named vm1-template
gcloud compute instances create --zone "Zone" --source-instance-template vm1-template vm2 vm3 vm4 vm5 vm6 vm7 vm8
gcloud compute instances list
其他方式大量部署 VM
Quotas
-
https://cloud.google.com/compute/quotas#understanding_vm_cpu_and_ip_address_quotas
-
https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html
-
https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits#service-specific-limits
Active Cloud Shell
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Tip: Cloud Shell 環境已經預裝好 GCP SDK, docker 等開發工具,可以用來執行 gcloud 指令,或者簡易的 docker 操作。
在 GCP 控制台點擊右上角 Activate Cloud Shell。
gcloud auth list
ACTIVE: *
ACCOUNT: alang.hsu@gmail.com
To set the active account, run:
$ gcloud config set account `ACCOUNT`
gcloud config list project
[core]
project = <project_ID>
No Comments