我正在尝试使用命令行将计算实例启动到 GCP 中:
gcloud compute instances create instance-1 --zone=uscentral1-a
它告诉我该项目的计费尚未开放:
API [compute.googleapis.com] not enabled on project [847006780503].
Would you like to enable and retry (this will take a few minutes)?
(y/N)? Y
Enabling service [compute.googleapis.com] on project [847006780503]...
ERROR: (gcloud.compute.instances.create) FAILED_PRECONDITION: Billing account for project '847006780503' is not open. Billing must be enabled for activation of service(s) 'compute.googleapis.com,compute.googleapis.com,compute.googleapis.com' to proceed.
- '@type': type.googleapis.com/google.rpc.PreconditionFailure
violations:
- subject: ?error_code=390002&project=847006780503&services=compute.googleapis.com&services=compute.googleapis.com&services=compute.googleapis.com
type: googleapis.com/billing-enabled
- '@type': type.googleapis.com/google.rpc.ErrorInfo
domain: serviceusage.googleapis.com/billing-enabled
metadata:
project: '847006780503'
services: compute.googleapis.com,compute.googleapis.com,compute.googleapis.com
reason: UREQ_PROJECT_BILLING_NOT_OPEN
我可以在控制台中启动计算实例,但不能在 CLI 上启动。
如何为我的项目启用计费,以便我可以使用 CLI 启动实例?