Simulating host maintenance on a spot VM does not run the shutdown script.

ARAS
New Member

I have created a spot VM to test the preemption process that I will be using in my clusters later in production. I have added a shutdown-script to the VM which creates and uploads a flag file to GCP storage for failure recovery /resumption of the job.

I have then simulated the preemption by simulating host maintenance on my VM (using `gcloud compute instances simulate-maintenance-event` command) and expected the VM to run the shutdown script when stopping and create and copy the file to the storage.

I can not see the VM doing the expected behavior when simulating the preemption, as if it is not running the shutdown script, however, it does as expected when I stop the VM manually both via the console and from within the VM itself using `shutdown now` command.

I wonder why this is happening and if I have configured something wrong?

2 1 63
1 REPLY 1

Hi @ARAS 

Welcome to Google Cloud Community!

You can compare the shutdown script that you're using with this sample shutdown script from the Google Cloud documents. It also contains instructions on how to use the shutdown script. If this does not resolve the issue, you can file a case with our support team and check with them if the problem that you're experiencing is related to a bug.

I hope this information is helpful.