ブログ

【Google Cloud Skills Boost】VPC ネットワーク ピアリングのコースが動かない時の対処

同じようにハマった人にむけてメモ。

対象のコースは「VPC ネットワーク ピアリング」(以下)

VMインスタンス作るところでエラーになります。

gcloud compute instances create vm-a --zone us-central1-a --network network-a --subnet network-a-central
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
---
code: ZONE_RESOURCE_POOL_EXHAUSTED
errorDetails:
- help:
    links:
    - description: Troubleshooting documentation
      url: https://cloud.google.com/compute/docs/resource-error
- localizedMessage:
    locale: en-US
    message: A n1-standard-1 VM instance is currently unavailable in the us-central1-a
      zone. Alternatively, you can try your request again with a different VM hardware
      configuration or at a later time. For more information, see the troubleshooting
      documentation.
- errorInfo:
    domain: compute.googleapis.com
    metadatas:
      attachment: ''
      vmType: n1-standard-1
      zone: us-central1-a
      zonesAvailable: ''
    reason: stockout
message: The zone 'projects/qwiklabs-gcp-04-e69cd35e8b36/zones/us-central1-a' does
  not have enough resources available to fulfill the request.  Try a different zone,
  or try again later.

サブネット名、リージョン、ゾーンを変更して回避しました。

# プロジェクトA
$ gcloud compute networks create network-a --subnet-mode custom
$ gcloud compute networks subnets create network-a-subnet --network network-a --range 10.0.0.0/16 --region asia-northeast1
$ gcloud compute instances create vm-a --zone asia-northeast1-c --network network-a --subnet network-a-subnet
$ gcloud compute firewall-rules create network-a-fw --network network-a --allow tcp:22,icmp


# プロジェクトB
$ gcloud compute networks create network-b --subnet-mode custom
$ gcloud compute networks subnets create network-b-subnet --network network-b --range 10.8.0.0/16 --region asia-northeast1
$ gcloud compute instances create vm-b --zone asia-northeast1-c --network network-b --subnet network-b-subnet
$ gcloud compute firewall-rules create network-b-fw --network network-b --allow tcp:22,icmp
ビッグデータ分析
この記事に関連する記事