I am confused why I get an error message suggesting I am passing an empty string value to --ipv6-network-tier.
Is the cli tool passing an incorrect value for this parameter?
gcloud is sending "networkTier": "STANDARD" as expected. The '' in the error message is a bug in how the Compute Engine API formats validation errors for ipv6AccessConfigs. Because ipv6AccessConfigs is a list field (ipv6AccessConfigs[0]) and the error path omits the [0] index (resource.networkInterfaces[0].ipv6AccessConfigs.networkTier), the API fails to extract the value from your request payload and prints ''.
Invalid value for field ‘resource.networkInterfaces[0].ipv6AccessConfigs.networkTier’: ‘’. Network tier in IPv6 access config must be PREMIUM.
For external IPv6, the network tier is configured on the subnet first rather than per VM, since each VM gets a /96 range from the subnet’s /64 external IPv6 prefix. My assumption is that --subnet subnet had external IPv6 enabled before the Standard Tier IPv6 preview rolled out, so the subnet doesn’t have the ipv6NetworkTier property set on it (which causes the API to default to requiring PREMIUM).
You can verify the subnet’s IPv6 configuration with:
gcloud beta compute networks subnets describe subnet \
--region=<REGION> \
--format="yaml(stackType,ipv6AccessType,ipv6NetworkTier,externalIpv6Prefix)"
A subnet’s external IPv6 network tier can’t be changed once its /64 prefix is allocated. To use Standard Tier IPv6 on a VM, you’ll need to either 1) create a new dual-stack subnet with --ipv6-network-tier=STANDARD or 2) update an existing IPV4_ONLY subnet to enable external IPv6 with --ipv6-network-tier=STANDARD:
gcloud beta compute networks subnets create subnet-ipv6-std \
--network=<NETWORK> \
--region=<REGION> \
--range=10.0.10.0/24 \
--stack-type=IPV4_IPV6 \
--ipv6-access-type=EXTERNAL \
--ipv6-network-tier=STANDARD
Once the subnet has ipv6NetworkTier: STANDARD, creating the VM on that subnet with --ipv6-network-tier=STANDARD will succeed:
gcloud beta compute instances create test1 \
--subnet=subnet-ipv6-std \
--stack-type=IPV4_IPV6 \
--ipv6-network-tier=STANDARD