Why shutdown scenarios are not guaranteed?

The documentation says that shutdown scenarios are executed only with maximum efficiency and that they are not guaranteed. I wonder what conditions will they be where they will not work?

Edit

As AndyJ pointed out, the documentation-related document describes when the script is supposed to run. To clarify, I read all this, but it seemed to me that the lack of a guarantee for launch includes the conditions in which it is usually assumed.

So, in order to better talk about my question, is the script guaranteed under conditions where the documentation says that it runs it, or is it only when it should , and not necessarily when it will

+8
google-compute-engine
source share
1 answer

They are addressed to this in the documentation you contacted.

Shutdown script call

Script termination is performed when the instance is scheduled to restart or terminate. There are many ways to restart or terminate an instance, but only a few actions trigger the shutdown of the script. The shutdown script will execute when:

The instance is deleted using instances (). delete request. This includes any tools or scripts that use the API, such as the Google Cloud Platform console and gcloud. The instance is closed through the console or the instance.stop () method. The instance restarts or exits through a request to the guest operating system, such as stopping sudo or rebooting sudo.

Note. If your disconnect script requires a network connection, we recommend that you disconnect your instance using this method, due to a known problem with losing a network connection. The problem primarily affects instances that were closed outside the guest operating system. The shutdown script will not be executed if the reset instance is used by the instances (). Reset

Shutdown script runtime

When a shutdown script is called, it has a limited period of time to run when the request is executed to complete or restart the instance, before the instance is actually completed. During this period, the Compute Engine will try to start shutting down the script, but if the script takes longer than this period of time, the instance will automatically end and all running tasks will be killed. If you complete or restart the instance by performing a request to the guest OS (for example, by running sudo shutdown), the restriction will not apply.

In general, we recommend shutting down the script within this period of time so that the operating system can complete its shutdown, including flushing buffers to disk.

For more information about this time limit, see Shutdown Time.

+1
source share

All Articles