项目的结算帐号未开放 GCP

Tim*_*phy 7 google-cloud-platform google-cloud-billing

我正在尝试使用命令行将计算实例启动到 GCP 中:

gcloud compute instances create instance-1 --zone=uscentral1-a
Run Code Online (Sandbox Code Playgroud)

它告诉我该项目的计费尚未开放:

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
Run Code Online (Sandbox Code Playgroud)

我可以在控制台中启动计算实例,但不能在 CLI 上启动。

如何为我的项目启用计费,以便可以使用 CLI 启动实例?

Jos*_*llo 5

要确认您的项目已启用计费,请按照以下步骤操作:

  1. 登录Google Cloud Console
  2. 在 Google Cloud Console 页面顶部的项目下拉菜单(我的项目)中,选择您的项目。
  3. 打开控制台导航菜单 ,然后选择计费。

如果项目未启用计费,则会显示一个弹出窗口,其中的文本类似于:

"This project is not linked to a billing account"
Run Code Online (Sandbox Code Playgroud)

如果是这种情况,您可以按照本文档启用项目计费:为现有项目启用计费

要重新启用项目计费,请执行以下操作。

  1. 登录Google Cloud Console 中的管理结算帐号页面。

  2. 选择“我的项目”选项卡可查看项目列表以及每个项目的关联 Cloud Billing 帐号。

  3. 从项目列表中,找到要重新启用计费的项目,然后单击它旁边的菜单。

  4. 选择“更改账单”,然后选择所需的目标 Cloud Billing 帐户。