David
David

Reputation: 16726

MySQL on Compute Engine did not shutdown correctly due to maintenance

I've discovered that a recent automatic migration of my Compute Engine VM instance has caused by mysql not to shutdown correctly and thus the restart took much longer do to checks.

Is there a way to initiate and wait for mysql service to shutdown for the VM maintenance/migration?

Upvotes: 0

Views: 49

Answers (1)

Parth Mehta
Parth Mehta

Reputation: 1917

Think you are looking for shutdown scripts. Using which you request to wait about 90 seconds before GCE will forcibly terminates your instance.

You set your shutdown script instance metadata

gcloud compute instances create example-instance \ --metadata-from-file shutdown-script=examples/scripts/install.sh

Hope this helps.

Upvotes: 2

Related Questions