I have been looking at the console’s billing as far as Cloud SQL and the VM Instance is concerned. I see that a lot of the cost comes from the idling hours of the Cloud SQL IP address. I am unsure as to where the settings are for this as i have tried to “unassign” the ip address that is associated with my Cloud SQL Instance. Are these charges static, as in am I always, no matter what, going to be charged for the ip address constantly or is there a way to turn this off when I am not using the Cloud SQL Instance? If so, how can I?
问题:
回答1:
You will be charged $0.01 for every hour the instance is not active and has an IPv4 address assigned. You can un-assign IP address using the Google Developers Console, go to your Cloud SQL instance, click on Edit and uncheck 'Assign an IPv4 address to my Cloud SQL instance' box.
回答2:
Click your SQL instance to go to Instance details > Connections > Public IP - uncheck it.
https://cloud.google.com/sql/docs/mysql/configure-ip
Note: When you disable public IP for an instance, you release its IPv4 address. If you later reenable public IP for this instance, it will get a different IPv4 address, and all applications that use the public IP address to connect to this instance must be modified.
Basically if you remove the public connection to your instance the IP is released too.
回答3:
A lot of answers, most of them partial (or old?), it seems. On top, Google's settings aren't very transparent either. I checked in early 2020 and it doesn't seem possible to switch off the IP address or avoid the charges on a stopped instance.
In more detail:
- I was billed €6.55 for 600 hours of SKU IP address idling in seconds for DB
- The Cloud SQL instance in question was turned off (most or all of) the month of December until right now
- Both Private IP and Public IP were deselected under [Google Cloud Project] > SQL > Connections
I then started the instance; no IP selected still. I let it run for some minutes and stopped it.
- In the instances overview (only visible when switching from some other section like Logging back to [Google Cloud Project] > SQL), there was an IP listed under Public IP Address now
- In [Google Cloud Project] > SQL > Connections, Public IP was selected (I didn't select anything there!)
Starting the instance now doesn't let me deselect both IP address options at the same time anymore like I had it before.
I do have a number of Authorized Networks configured under option Public IP and used these in some earlier months. I cannot test whether removing all if these will let me disable the option right now, as I need them again real soon. So, that's an open question.
In summary, besides a glitch in the system where no IP address option is selected, yet one is set up anyways, the charge seems to be unavoidable for a non-running instance. It's not possible to switch the IP off as @Tony Tseng suggested.
Why is that again, Google?
回答4:
https://cloud.google.com/sql/docs/mysql/configure-ip
Click the instance name to open its Instance details page.
Select the Connections tab.
Deselect the Public IP checkbox.
Click Save to update the instance.==> Save is disabled on unchecking Public IP checkbox. Looks like either Private IP or Public IP checkbox should be selected to enable Save button.