Thursday, February 16, 2017

[google-cloud-sql-discuss] Re: Recreating database with the same instance id

This is expected behavior. From https://cloud.google.com/sql/docs/mysql/delete-instance:

You cannot reuse an instance name for up to a week after you have deleted an instance.

On Wednesday, February 15, 2017 at 1:04:11 PM UTC-8, Michael Strickland wrote:
I originally created a database through the Google Cloud web console, and later attempted to replicate the steps using gcloud on the command line for reproducibility.

I found a gcloud command that works when creating a new instance with a different name, but attempting to delete the original instance I made, and recreate it using gcloud failed with the following error:

gcloud beta sql instances create stg-mysql-us-central1 \
  --database-version MYSQL_5_7 \
  --activation-policy ALWAYS \
  --tier db-n1-standard-8 \
  --region us-central1 \
  --replication SYNCHRONOUS \
  --storage-size 200GB \
  --storage-type SSD \
  --storage-auto-increase 
ERROR: (gcloud.beta.sql.instances.create) Project [MY_PROJECT] is the subject of a conflict: The Cloud SQL instance already exists.

This error occurs using the web console as well if you try to create an instance with a name you used previously, even if you have since deleted the instance.

Is this expected behavior? Can we expect that names can be reused after a given amount of time?

I found an old issue on the google bug tracker mentioning the same behavior, but there wasn't any resolution: https://code.google.com/p/googlecloudsql/issues/detail?id=84

Thanks!
Michael

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/564fde57-6cc5-49f8-add2-7c5d8dde226b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment