Vegapatel
Vegapatel

Reputation: 11

Google Cloud Platform - VM instances terminate automatically

VM instances are automatically terminated when idle, log details of vm instance is provided below. Is there is any pre-set idle time for VM instances in GCP before they are terminated automatically?

compute.instances.guestTerminate
{"actor":{"user":"system"}

{
 insertId:  "1cul1b9g4an2h44"  
 jsonPayload: {
  actor: {
   user:  "system"    
  }
  event_subtype:  "compute.instances.guestTerminate"   
  event_timestamp_us:  "1516163427866891"   
  event_type:  "GCE_OPERATION_DONE"   
  operation: {

  }
  resource: {

  }
  trace_id:  "systemevent-1516163412743-562f14da3546f-72606fb9-e7cfbf6e"   
  version:  "1.2"   
 }
 labels: {

 }

191721/logs/compute.googleapis.com%2Factivity_log"
receiveTimestamp: "2018-01-17T04:30:27.942931382Z"
resource: { labels: {

  }
  type:  "gce_instance"   
 }
 severity:  "INFO"  
 timestamp:  "2018-01-17T04:30:27.866891Z"  
}

Upvotes: 1

Views: 2678

Answers (1)

Fady
Fady

Reputation: 355

Google Compute Engine has no pre-set idle time for VM instances. However, if your instance is Preemptible, Compute Engine might terminate it due to system events, and this probability is generally low. In this case, if you do not have a shutdown script, it will simulate an “ACPI Power Off” signal, and log "operationType": "stop".

On the other hand, if your instance is configured on maintenance events to live migrate with automatic restart, then “if a hardware fails completely or otherwise prevents live migration, the VM crashes and restarts automatically and a hostError (or compute.instances.hostError, and compute.instances.automaticRestart ), is logged.”

In your case, according to the first two lines in the log above, it seems that it was terminated (shut down) by the guest OS itself, and could be user initiated. I simulated the same exact log by running:

sudo shutdown -h now

To troubleshoot, you may have to check your VM logs. I found a similar report and answer at this link.

On another note, and for security reasons, it’s best to redact your project and resource information from the log above.

Upvotes: 2

Related Questions