Check provider logo

Compute Engine VM instances have Automatic Restart enabled

compute_instance_automatic_restart_enabled

Severitymedium
Servicecompute
by Prowler

Google Compute Engine virtual machine instances are evaluated to ensure that Automatic Restart is enabled. This feature allows the Google Cloud Compute Engine service to automatically restart VM instances when they are terminated due to non-user-initiated reasons such as maintenance events, hardware failures, or software failures.

Risk

VM instances without Automatic Restart enabled will not recover automatically from host maintenance events or unexpected failures, potentially leading to prolonged service downtime and requiring manual intervention to restore services.

Run this check with Prowler CLI

prowler gcp --checks compute_instance_automatic_restart_enabled

Recommendation

Enable the Automatic Restart feature for Compute Engine VM instances to enhance system reliability by automatically recovering from crashes or system-initiated terminations. This setting does not interfere with user-initiated shutdowns or stops.

Remediation

CLI

gcloud compute instances update <INSTANCE_NAME> --restart-on-failure --zone=<ZONE>

Terraform
Other
  1. Open Google Cloud Console → Compute Engine → VM instances
  2. Click on the instance name to view details
  3. Click 'Edit' at the top of the page
  4. Under 'Availability policies', set 'Automatic restart' to 'On (recommended)'
  5. Click 'Save' at the bottom of the page

Source Code

Resource Type

compute.googleapis.com/Instance

References