tiktok
tiktok

Reputation: 157

How to schedule stop vertex (ai-platform) notebook everyday in specific time?

I want to force stop vertex (ai-platform) notebook everyday in specific time?

can u tell what is the best practice for it? is there a minimal solution for this

(maybe it can be attach into the init script in advanced mode when creating the notebook)?

can u assist please?

thanks

Upvotes: 1

Views: 2088

Answers (1)

gogasca
gogasca

Reputation: 10058

You will need to develop your own script.

  1. Create a crontab job which defines the time you want to shut down the VM.
  2. Create a script that will be launched by crontab job #1

Example:

30 23 * * * root shutdown -h now

When you create a new instance you can use: post-startup-script to install it. This parameter is executed only once after Notebook installation.

If you already created some instances, you can use native Compute Engine metadata, using startup-script metadata.

The script could be something as simple as shutdown now

Upvotes: 1

Related Questions