user249018
user249018

Reputation: 557

ERROR:Project creation failed. The project ID you specified is already in use by another project. Please try an alternative ID

I am trying to use google cloud by going through a tutorial on formatting and filtering with gcloud. After entering gcloud projects list on the cloud shell I get a single project listed in which one can read the PROJECT-ID. After entering the command that includes the project-id, gcloud projects create <ENTER-PROJECT-ID>, I get the error message shown on the title of this post.

What is going wrong here ? What should I do ?

Thanks.

Upvotes: 0

Views: 1116

Answers (1)

Jyothi Kiranmayi
Jyothi Kiranmayi

Reputation: 2498

The command gcloud projects create < ENTER-PROJECT-ID> is used to create a new project using the Cloud shell. You cannot use the project-id which is mentioned in projects list i.e., from gcloud projects list to create a new project, because the output results the projects which are already created so it results in the following error: The project ID you specified is already in use by another project. Please try an alternative ID.

If you want to use the project from the projects list you can use the following command:

$ gcloud config set project $MY_PROJECT_ID 

Method -1:

To create a new project from cloud shell, use the gcloud projects create command:

   $ gcloud projects create <project-id>

Where PROJECT_ID is the ID for the project you want to create. A project ID must start with a lowercase letter, and can contain only ASCII letters, digits, and hyphens, and must be between 6 and 30 characters.

To create a project with an organization or a folder as parent, use the --organization or --folder flags. As a resource can only have one parent, only one of these flags can be used:

  $ gcloud projects create <project-id> --organization=ORGANIZATION_ID

  $ gcloud projects create <project-id> --folder=FOLDER_ID

Method -2:

You can also create a project using the cloud console. Here are the steps:

  1. Go to the Manage resources page in the Cloud Console.
  2. On the Select organization drop-down list at the top of the page, select the organization in which you want to create a project. If you are a free trial user, skip this step, as this list does not appear.
  3. Click Create Project.
  4. In the New Project window that appears, enter a project name and select a billing account as applicable. A project name can contain only letters, numbers, single quotes, hyphens, spaces, or exclamation points, and must be between 4 and 30 characters.
  5. Enter the parent organization or folder in the Location box. That resource will be the hierarchical parent of the new project.
  6. When you're finished entering new project details, click Create.

Refer creating and managing projects for information.

Upvotes: 1

Related Questions