You need to create an autoscaling managed instance group for an HTTPS web application.
You want to make sure that unhealthy VMs are recreated.
What should you do?
Click on the arrows to vote for the correct answer
A. B. C. D.C.
https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instancesTo create an autoscaling managed instance group for an HTTPS web application and ensure that unhealthy VMs are recreated, the following steps can be taken:
Option A: Create a health check on port 443 and use that when creating the Managed Instance Group. This option is correct because a health check on port 443 can be used to check the availability and health of the web application. The health check can be configured to periodically check the web server's response on port 443, and if the response is not satisfactory, the instance group can automatically recreate the unhealthy VMs. Therefore, this option is the correct choice to ensure that unhealthy VMs are recreated.
Option B: Select Multi-Zone instead of Single-Zone when creating the Managed Instance Group. This option is not directly related to ensuring that unhealthy VMs are recreated. Selecting Multi-Zone instead of Single-Zone only determines the availability and distribution of the instances across zones, and does not guarantee that unhealthy VMs will be recreated.
Option C: In the Instance Template, add the label health-check'. Adding a label to the instance template is not directly related to ensuring that unhealthy VMs are recreated. Adding a label can be used to filter and identify instances, but it does not ensure that the instances are healthy or that they will be recreated if they become unhealthy.
Option D: In the Instance Template, add a startup script that sends a heartbeat to the metadata server. Adding a startup script that sends a heartbeat to the metadata server is not a direct solution to ensuring that unhealthy VMs are recreated. While a heartbeat can indicate that the instance is running, it does not ensure that the web application is healthy or that the instance will be recreated if it becomes unhealthy.
In conclusion, the correct option to ensure that unhealthy VMs are recreated in an autoscaling managed instance group for an HTTPS web application is to create a health check on port 443 and use that when creating the Managed Instance Group.