add "Shutdown script (Optional)" field in addResourceForm on Google Cloud Console
In Google Cloud Console
In Create an instance template and Create an instance (addResourceForm)
in Automation section
add "Shutdown script (Optional)" text area like "Startup script (Optional)"
Thanks for the suggestion!
Hi there. What is the status of this? I see that Google writes, "Shutdown scripts are especially useful for instances in a managed instance group with an autoscaler. If the autoscaler shuts down an instance in the group, the shutdown script runs before the instance stops and the shutdown script performs any actions that you define. The script runs during the limited shutdown period before the instance stops. For example, your shutdown script might copy processed data to Cloud Storage or back up any logs." here: https://cloud.google.com/compute/docs/shutdownscript#provide_a_shutdown_script_file
But I can't tell how to add a shutdown script to a managed instance group or to an instance template.