ASSOCIATE-CLOUD-ENGINEER practice question 4 of 35

You want to configure 10 Compute Engine instances for availability when maintenance occurs. Your requirements state that these instances should attempt to automatically restart if they crash. Also, the instances should be highly available including during system maintenance. What should you do?

Full set: 332 questions
Answer options
A: Create an instance template for the instances. Set the ‘Automatic Restart’ to on. Set the ‘On-host maintenance’ to Migrate VM instance. Add the instance template to an instance group. Correct answer
B: Create an instance template for the instances. Set ‘Automatic Restart’ to off. Set ‘On-host maintenance’ to Terminate VM instances. Add the instance template to an instance group.
C: Create an instance group for the instances. Set the ‘Autohealing’ health check to healthy (HTTP).
D: Create an instance group for the instance. Verify that the ‘Advanced creation options’ setting for ‘do not retry machine creation’ is set to off.
Correct Answer:
A. Create an instance template for the instances. Set the ‘Automatic Restart’ to on. Set the ‘On-host maintenance’ to Migrate VM instance. Add the instance template to an instance group.
Explanation

This solution correctly addresses all requirements for high availability as stated in the scenario. Using an instance template is the standard practice for creating multiple, identical instances. Setting 'Automatic Restart' to 'on' ensures that if a VM crashes due to an underlying hardware or system issue, Compute Engine will attempt to restart it. Setting 'On-host maintenance' to 'Migrate VM instance' enables live migration, where Google Cloud moves the running instance to another host in the same zone before maintenance begins, ensuring the instance remains available and avoiding downtime. Combining these settings in an instance template and applying it to an instance group provides a scalable and highly available configuration.

Why Incorrect

B. This configuration is the opposite of what is required for high availability. Disabling automatic restart and terminating instances during maintenance would lead to significant downtime.
C. Autohealing is for application-level failures (e.g., a frozen application), not for VM crashes or host maintenance events. The question specifies infrastructure-level availability, which is handled by restart and migration policies.
D. The 'do not retry machine creation' setting applies only to the initial creation of an instance within a group. It does not affect the availability of an already running instance.

References

1. Setting instance availability policies: The official Google Cloud documentation specifies the two key settings for instance availability.

On host maintenance: "To ensure that your instances continue to run during a host system event

Compute Engine can live migrate your running instances... Your instance continues to run on the new host while the original host is updated."

Automatic restart: "If your instance is set to terminate due to a host error

you can specify that Compute Engine should automatically restart the instance."

Source: Google Cloud Documentation

Compute Engine

"Setting instance availability policies". Section: "Setting the host maintenance policy" and "Setting the automatic restart policy".

2. Instance templates: This document explains the purpose and use of instance templates for creating consistent VM configurations.

"An instance template is a resource that you can use to create VM instances and managed instance groups (MIGs). Instance templates define the machine type

boot disk image or container image

labels

and other instance properties."

Source: Google Cloud Documentation

Compute Engine

"Instance templates". Section: "Overview".

3. Live Migration: This document details the live migration process

which is the mechanism behind the 'Migrate VM instance' setting.

"By default

standard instances are set to live migrate

where Compute Engine automatically migrates your instance away from an infrastructure maintenance event

and your instance remains running during the migration."

Source: Google Cloud Documentation

Compute Engine

"Live migration". Section: "How does live migration work?".

Scroll to Top