1

I have Google VM windows server 2012 r2, and the server is shutting down daily, I need to stop that if there is any settings to change in the Google Console.

4 Answers4

1

Make sure that Preemptibility is off

enter image description here

Ahmed Abdelazim
  • 717
  • 7
  • 14
1
  1. billing problem
  2. other people in your organization was set that configuration
  3. another issues such as using cloud scheduler.

please check all above possibilites

1

There are a few things that could be checked, an instance rebooting itself can be triggered by:

The availability policies configured by default:

  1. Preemptibility Off (recommended): If this is ON the VM you are running will be a preemptible VM and the instance will be terminated after 24 hours.
  2. On host maintenance Migrate VM instance (recommended): In case of migrateOnHostMaintenance or hostError events you will get your instance moved to a new host due to the one your VM is at will have an update or has had an error, you only have this option or Terminate the VM instance
  3. Automatic restart: If your instance is set to terminate when there is a maintenance event(OnHostMaintenance), or if your instance crashes because of an underlying hardware issue (hostError), you can set up Compute Engine to automatically restart the instance by setting the automaticRestart field to On, this is how it is set by default, and can be turned off manually.

To check if you have had events of this type you can go to your cloud shell in the project where you're having problems and run this command: gcloud compute operations list and use it with a grep just to filter the migrateOnHostMaintenance or the hostError events like this: gcloud compute operations list | grep migrateOnHostMaintenance and gcloud compute operations list | grep hostError

If you don't found any of the above operations you can use same command and add the instance name gcloud compute operations list | grep INSTANCE_NAME and check fort the start and stop operations by describing them with next command: gcloud compute operations describe OPERATION_ID --zone, you will be able to see the details about the stop or start operations your instance is having, even the user who made the operation.

Ariel Palacios
  • 317
  • 1
  • 6
0

VM shouldn't auto-shutdown by default unless someone in your organisation has configured it to do so.

The google service that supports this behaviour is Cloud Scheduler. If you take a look at cloud scheduler job and see if it has any jobs listed. If so see what those jobs are doing.

Parth Mehta
  • 1,869
  • 5
  • 15