Google Cloud gcloud 命令显示 "Machine type with name 'f1-micro--subnet=default' does not exist in zone 'us-east1-b'"
Google Cloud gcloud command showing "Machine type with name 'f1-micro--subnet=default' does not exist in zone 'us-east1-b'"
我正在学习 Google Cloud Platform 实例创建。作为学习的一部分,尝试在 us-east1-b 区域的 f1.micro 实例类型上启动 RHEL 6 实例。
这是我使用过的 Gcloud 命令:
gcloud compute --project=<project-id> instances create cldinit-vm --zone=us-east1-b --machine-type=f1-micro--subnet=default --network-tier=PREMIUM --metadata-from-file startup-script=initscript.sh --maintenance-policy=MIGRATE --service-account=<account-id>@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --min-cpu-platform="Intel Broadwell" --tags=http-server --image=rhel-6-v20181210 --image-project=rhel-cloud --boot-disk-size=10GB --boot-disk-type=pd-standard --boot-disk-device-name=cldinit-vm --labels=name=cloudinit-vm
当我运行命令时,它显示下面的错误,
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Invalid value for field 'resource.machineType': 'https://www.googleapis.com/compute/v1/projects/<project-id>/zones/us-east1-b/machineTypes/f1-micro--subnet=default'.
Machine type with name 'f1-micro--subnet=default' does not exist in zone 'us-east1-b'.
我有两个问题:
- 我无法从 "default" 修改子网设置,因为它是实例启动页面中 "network" 中唯一可供选择的选项。
那么有人可以帮助解决这个问题吗?
- 自从我学习 GCP 以来,我直接从位于 GCP 计算引擎底部的 link 将 CLI 命令启动到 "CloudShell" - 实例启动页面。
是否需要从 "Google" 进行更正以提供工作命令?
作为学习的一部分,发现选项值 f1-micro 和 --subnet 之间缺少 space。
所以这是更正后的命令片段
gcloud compute --project=<project-id> instances create cldinit-vm --zone=us-east1-b --machine-type=f1-micro --subnet=default ....
我正在学习 Google Cloud Platform 实例创建。作为学习的一部分,尝试在 us-east1-b 区域的 f1.micro 实例类型上启动 RHEL 6 实例。
这是我使用过的 Gcloud 命令:
gcloud compute --project=<project-id> instances create cldinit-vm --zone=us-east1-b --machine-type=f1-micro--subnet=default --network-tier=PREMIUM --metadata-from-file startup-script=initscript.sh --maintenance-policy=MIGRATE --service-account=<account-id>@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --min-cpu-platform="Intel Broadwell" --tags=http-server --image=rhel-6-v20181210 --image-project=rhel-cloud --boot-disk-size=10GB --boot-disk-type=pd-standard --boot-disk-device-name=cldinit-vm --labels=name=cloudinit-vm
当我运行命令时,它显示下面的错误,
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Invalid value for field 'resource.machineType': 'https://www.googleapis.com/compute/v1/projects/<project-id>/zones/us-east1-b/machineTypes/f1-micro--subnet=default'.
Machine type with name 'f1-micro--subnet=default' does not exist in zone 'us-east1-b'.
我有两个问题:
- 我无法从 "default" 修改子网设置,因为它是实例启动页面中 "network" 中唯一可供选择的选项。 那么有人可以帮助解决这个问题吗?
- 自从我学习 GCP 以来,我直接从位于 GCP 计算引擎底部的 link 将 CLI 命令启动到 "CloudShell" - 实例启动页面。 是否需要从 "Google" 进行更正以提供工作命令?
作为学习的一部分,发现选项值 f1-micro 和 --subnet 之间缺少 space。 所以这是更正后的命令片段
gcloud compute --project=<project-id> instances create cldinit-vm --zone=us-east1-b --machine-type=f1-micro --subnet=default ....