google-cloud-platformgoogle-cloud-billing

Billing account for project is not open GCP


I'm trying to launch a compute instance into GCP using the command line:

gcloud compute instances create instance-1 --zone=uscentral1-a

And it tells me that billing is not open for the project:

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

I am able to launch compute instances in the console, but not on the CLI.

How do I enable billing for my project so that I can launch instances with the CLI?


Solution

  • To confirm that billing is enabled on your project please follow the next steps:

    1. Sign in to the Google Cloud Console.
    2. In the project drop down ( My Project) at the top of the Google Cloud Console page, select your project.
    3. Open the console Navigation menu , and then select Billing.

    If billing is not enabled on the project, a pop-up window will display, with text similar to:

    "This project is not linked to a billing account"
    

    If this is your case, you can enable billing on your project following this documentation: Enable billing for an existing project

    To re-enable billing on a project, do the following.

    1. Sign in to the Manage billing accounts page in the Google Cloud Console.

    2. Select the My projects tab to view a list of projects and the associated Cloud Billing account for each project.

    3. From the list of projects, locate the project for which you want to re-enable billing, and then click the menu next to it.

    4. Select Change billing, then choose the desired destination Cloud Billing account.