Friday, April 13, 2018

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

My understanding is that these names need to be unique to all CloudSQL instances.  In this case, you might simply be running up against a whole bunch of other users who decided to use the name 'test' for their first instance and the number got auto-incremented.  It's also possible that this got a little out of hand in terms of overuse of 'test' for an instance name so 'test' + {number} might just not be allowed anymore (but that's pure speculation).  

If you try a naming convention like: {your company name}-test and then try to create {your company name}-test1 it should work just fine.  That way you can still specify that it's a test instance, and then use the {your company name} prefix for future production instances.

Hope this was helpful/correct,

-Kurt

p.s.: I'm not affiliated with google in any way, but have been using CloudSQL for a couple years now and I might be one of the users who created a test+number instance when I first started out :)

On Fri, Apr 13, 2018 at 12:20 PM, 'Pia Chamberlain' via Google Cloud SQL discuss <google-cloud-sql-discuss@googlegroups.com> wrote:
That would not be expected, no. But I can't reproduce that behavior in my project.

On Friday, April 13, 2018 at 5:59:28 AM UTC-7, Leonardo Faoro wrote:
I can't use any name containing similar words:

gcloud sql instances create test1 -> The Cloud SQL instance already exists.
gcloud sql instances create test2 -> The Cloud SQL instance already exists.
gcloud sql instances create test123456 -> The Cloud SQL instance already exists.

Is this behavior expected as well?

On Thursday, February 16, 2017 at 5:08:03 PM UTC+1, Pia Chamberlain wrote:
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/83528c13-c1bd-4ca9-8aac-18dbae5d02a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAN-WJY8Jbkw3GF1nL5Rcz-SNQ0qZffr7VhqQyx0KtxuycFZ%3D6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment