Skip to main content

Triage and Remediation

Remediation

Using Console

Below are step‑by‑step instructions to enable Idle Shutdown for Vertex AI Workbench notebook instances using the GCP Console.

A. Enable Idle Shutdown on an existing Vertex AI Workbench notebook

  1. Go to the Vertex AI Workbench page
    • In the Google Cloud Console, open the navigation menu (☰).
    • Go to Vertex AIWorkbench.
    • Make sure you are in the correct project and region.
  2. Locate your notebook instance
    • In the Workbench page, under the User-managed notebooks (or “Managed notebooks” depending on your type), find the notebook instance you want to configure.
  3. Stop the instance (if required)
    • If the instance is running, some settings might be locked.
    • Click the three‑dot menu (⋮) next to the instance and select Stop.
    • Wait until the status shows Stopped.
  4. Edit the instance settings
    • Click the three‑dot menu (⋮) next to the notebook instance.
    • Select Edit (or Edit settings).
  5. Enable Idle Shutdown
    • In the edit screen, scroll to the Idle shutdown or Idle timeout section (wording may vary slightly by UI version).
    • Check Enable idle shutdown (or similar toggle).
    • Set the Idle time (e.g., 60 minutes, 120 minutes) according to your policy.
  6. Save changes
    • Click Save (or Save & update).
    • If prompted to confirm changes and restart, confirm.
    • Start the instance again if needed: use the Start option from the three‑dot menu.

B. Ensure Idle Shutdown is set for new notebook instances

  1. Create a new notebook
    • In Vertex AI → Workbench, click New notebook.
    • Choose the appropriate environment / image (JupyterLab, VS Code, etc.).
  2. Configure Idle Shutdown during creation
    • In the creation wizard, find the Idle shutdown section.
    • Enable Idle shutdown.
    • Set the idle timeout duration according to your standard (e.g., 60 minutes).
  3. Finish creation
    • Complete the remaining configuration (machine type, disk, network, etc.).
    • Click Create.
By doing this for all existing and newly created Vertex AI Workbench notebook instances, you ensure the Idle Shutdown feature is consistently enabled.
Below are concise, step‑by‑step CLI instructions to ensure Idle Shutdown is enabled on Vertex AI Workbench notebooks.
Note: Commands differ for Managed vs User-Managed notebooks.

1. Set common variables


2. Managed Notebooks (Vertex AI Workbench “Managed”)

2.1 List managed notebook instances

Note the INSTANCE_NAME you want to fix.

2.2 Enable Idle Shutdown on a managed notebook

  • --idle-shutdown turns the feature on.
  • --idle-shutdown-timeout is in minutes (e.g., 30 minutes).

2.3 Verify configuration

You should see true and the timeout you set.

3. User-Managed Notebooks (legacy AI Platform / user-managed Workbench)

These are regular Compute Engine VMs with a notebook proxy.

3.1 List user-managed notebooks

3.2 Enable Idle Shutdown on a user-managed runtime

For Vertex AI Workbench user-managed runtime:
For older AI Platform Notebooks VM (Compute Engine):Idle shutdown is controlled via metadata; set the idle timeout in minutes:

After these steps, the notebook instances/runtimes will automatically shut down after the configured period of inactivity.
Below is one way to enable the Idle Shutdown feature on all (or selected) Vertex AI / Workbench notebook instances using Python and the Notebooks API.Assumptions (common for CIS-style checks):
  • Idle shutdown is controlled via instance metadata:
    • idleShutdown: "true" / "false"
    • idleShutdownTimeout: integer minutes (e.g., "60" for 1 hour)
  • You have permission to use the Notebooks API on the project.

1. Enable APIs and install libraries

Make sure these are enabled in your project:
  • notebooks.googleapis.com
Install the client libraries:
Authenticate (one way):

2. Python script to enable Idle Shutdown

This script:
  • Lists all Vertex AI / Workbench notebook instances in a region.
  • For each instance, sets idleShutdown=true and idleShutdownTimeout=60 (change as needed).
  • Uses the patch method with an updateMask on metadata.

3. Notes / adjustments

  • To target a single instance, set name explicitly and call patch once instead of looping over list.
  • Adjust IDLE_SHUTDOWN_TIMEOUT_MIN to your policy (e.g., "30", "120").
  • If you are using Workbench “Managed notebooks” (v2 “runtimes”), the resource type is runtimes instead of instances; the logic is similar but use:
    • build("notebooks", "v1")
    • projects().locations().runtimes().list(...) and ...runtimes().patch(...).
  • For organization-wide remediation, run this per-project and per-region where notebooks exist.
IDLE_TIMEOUT_MINUTES should be replaced with the numeric string for your desired idle timeout (for example "60"). Updating these metadata keys is an in‑place change and does not force replacement of the instance.To verify, terraform plan should show an update to the google_workbench_instance.VERTEX_NOTEBOOK resource adding or changing the two metadata entries above and no -/+ (destroy/create) for the instance.