Triage and Remediation
- Remediation
Remediation
Using Console
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
-
Go to the Vertex AI Workbench page
- In the Google Cloud Console, open the navigation menu (☰).
- Go to Vertex AI → Workbench.
- Make sure you are in the correct project and region.
-
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.
-
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.
-
Edit the instance settings
- Click the three‑dot menu (⋮) next to the notebook instance.
- Select Edit (or Edit settings).
-
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.
-
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
-
Create a new notebook
- In Vertex AI → Workbench, click New notebook.
- Choose the appropriate environment / image (JupyterLab, VS Code, etc.).
-
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).
-
Finish creation
- Complete the remaining configuration (machine type, disk, network, etc.).
- Click Create.
Using CLI
Using CLI
Below are concise, step‑by‑step CLI instructions to ensure Idle Shutdown is enabled on Vertex AI Workbench notebooks.
Note the You should see
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.
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
INSTANCE_NAME you want to fix.2.2 Enable Idle Shutdown on a managed notebook
--idle-shutdownturns the feature on.--idle-shutdown-timeoutis in minutes (e.g., 30 minutes).
2.3 Verify configuration
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:After these steps, the notebook instances/runtimes will automatically shut down after the configured period of inactivity.
Using Python
Using Python
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):
Authenticate (one way):
- 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
2. Python script to enable Idle Shutdown
This script:- Lists all Vertex AI / Workbench notebook instances in a region.
- For each instance, sets
idleShutdown=trueandidleShutdownTimeout=60(change as needed). - Uses the
patchmethod with anupdateMaskonmetadata.
3. Notes / adjustments
- To target a single instance, set
nameexplicitly and callpatchonce instead of looping overlist. - Adjust
IDLE_SHUTDOWN_TIMEOUT_MINto your policy (e.g.,"30","120"). - If you are using Workbench “Managed notebooks” (v2 “runtimes”), the resource type is
runtimesinstead ofinstances; 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.
Using Terraform
Using Terraform
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.
