Stay organized with collections Save and categorize content based on your preferences.

Create a user-managed notebooks instance

A user-managed notebooks instance is a Deep Learning virtual machine instance with the latest machine learning and data science libraries preinstalled. You can optionally include Nvidia GPUs for hardware acceleration.

Before you begin

Follow the steps in Before you begin to create a Google Cloud project and enable the Notebooks API.

Create a user-managed notebooks instance with default properties

To create a user-managed notebooks instance with default properties, complete the following steps. To specify properties for your instance, see Create a user-managed notebooks instance with specific properties or go to notebook.new to go directly to the Create a user-managed notebook instance creation dialog.
  1. In the Google Cloud console, go to the User-managed notebooks page.

    Go to User-managed notebooks

  2. Click  New notebook.

  3. Select an instance type, and then choose whether to include a GPU.

  4. If you choose to include a GPU, you must select the option to Install NVIDIA GPU driver automatically for me. You can adjust the number of GPUs later if you need to. For information about adjusting the number of GPUs, see Change machine type and configure GPUs of a user-managed notebooks instance.

  5. Click Create.

  6. Vertex AI Workbench automatically starts the instance. When the instance is ready to use, Vertex AI Workbench activates an Open JupyterLab link.

Create a user-managed notebooks instance with specific properties

To create a user-managed notebooks instance with properties other than those provided by the default instance types, specify your preferred properties when you create an instance. You can specify your preferred properties by using either the Google Cloud console or the Google Cloud CLI:

Console

  1. In the Google Cloud console, go to the User-managed notebooks page. Or go to notebook.new (https://notebook.new) and skip the next step.

    Go to User-managed notebooks

  2. Click  New notebook, and then select Customize.

    The Create a user-managed notebook page opens.

  3. On the Create a user-managed notebook page, in the Details section, provide the following information for your new instance:

    • Name: Provide a name for your new instance.
    • Region and Zone: Select a region and zone for the new instance. For best network performance, select the region that is geographically closest to you. See the available user-managed notebooks locations.
  4. In the Environment section, provide the following:

    • Operating system: Select the operating system that you want to use.
    • Environment: Select the environment that you want to use.
    • Version: Select the version that you want to use.
    • Post-startup script: Optional: Click Browse to select a script to run after the instance starts. The path must be a URL or Cloud Storage path, for example: gs://<var>PATH_TO_FILE</var>/<var>FILE_NAME</var>.
    • Metadata: Optional: Provide custom metadata keys for the instance.
  5. In the Machine type section, provide the following:

    • Machine type: Select the number of CPUs and amount of RAM for your new instance. Vertex AI Workbench provides monthly cost estimates for each machine type that you select.
    • GPU type: Select the GPU type and Number of GPUs for your new instance. For information about the different GPUs, see GPUs on Compute Engine.

      Select the Install NVIDIA GPU driver automatically for me checkbox.

    • Shielded VM: Optional: Select or clear the following checkboxes:

      • Turn on Secure Boot
      • Turn on vTPM
      • Turn on Integrity Monitoring
  6. In the Disks section, provide the following:

    • Disks: Optional: To change the default boot or data disk settings, select the Boot disk type, Boot disk size in GB, Data disk type, and Data disk size in GB that you want. For more information about disk types, see Storage options.

    • Delete to trash?: Optional: Select this checkbox to use the operating system's default trash behavior, If you use the default trash behavior, files deleted by using the JupyterLab user interface are recoverable but these deleted files do use disk space.

    • Backup: Optional: To sync a Cloud Storage location with your instance's data disk, click Browse and specify the Cloud Storage location. To learn about storage costs, see Cloud Storage pricing.

    • Encryption: To change the encryption setting from Google-managed encryption key to Customer-managed encryption key (CMEK), see Customer-managed encryption keys.

  7. In the Networking section, provide the following:

    • Networking: Select either Networks in this project or Networks shared with me. If you are using a Shared VPC in the host project, you must also grant the Compute Network User role (roles/compute.networkUser) to the Notebooks Service Agent from the service project.

      1. In the Network field, select the network that you want. You can select a VPC network, as long as the network has Private Google Access enabled or can access the internet. For more information, see network configuration options.

      2. In the Subnetwork field, select the subnetwork that you want.

      3. To disable the external IP address, clear the Enable external IP address checkbox.

      4. To disable proxy access, clear the Allow proxy access when it's available checkbox.

  8. In the IAM and security section, provide the following:

    • Permission: To grant access to a service account or to a single user, complete one of the following steps:

      • Select Service account. To use the Compute Engine default service account, select Use Compute Engine default service account. To use a custom service account, clear Use Compute Engine default service account, and then, in the Service account email field, enter your custom service account email address.

      • Select Single user only, and then, in the User email field, enter the user account that you want to grant access. If the specified user is not the creator of the instance, you must grant the specified user the Service Account User role (roles/iam.serviceAccountUser) on the instance's service account.

      To learn more about granting access, see Manage access.

    • Security: Select or clear the following checkboxes:

      • Enable root access to the instance
      • Enable nbconvert
      • Enable file downloading from JupyterLab UI
      • Enable terminal
  9. In the System health section, provide the following:

    • Environment upgrade and system health: To automatically upgrade to newly released environment versions, complete the following steps:

      1. Select the Enable environment auto-upgrade checkbox.
      2. Choose whether to upgrade your notebook Weekly or Monthly.
      3. In the Weekday field, select the option that you want.
      4. In the Hour field, choose an hour of the day.
    • In System health and reporting, select or clear the following checkboxes:

      • Enable system health report
      • Report custom metrics to Cloud Monitoring
      • Install Cloud Monitoring agent
  10. Click Create.

  11. Vertex AI Workbench creates a user-managed notebooks instance based on your specified properties and automatically starts the instance. When the instance is ready to use, Vertex AI Workbench activates an Open JupyterLab link.

gcloud

By default, the Google Cloud CLI creates a user-managed notebooks instance with an external IP address. To create an instance without an external IP address, you must specify a subnet that has Private Google Access enabled. For more information, see networking configuration options.

  1. To create a user-managed notebooks instance from the command line, from Cloud Shell or any terminal where the Google Cloud CLI is installed, enter the following gcloud notebooks command:

    gcloud notebooks instances create INSTANCE_NAME
      --vm-image-project=deeplearning-platform-release
      --vm-image-family=VM_IMAGE_FAMILY
      --machine-type=MACHINE_TYPE
      --location=LOCATION
    

    Replace the following:

    • INSTANCE_NAME: the name of your new instance
    • VM_IMAGE_FAMILY: the image family name that you want to use to create your instance
    • MACHINE_TYPE: the machine type of your instance's VM
    • LOCATION: the Google Cloud location where you want your new instance to be
  2. Access your instance from the Google Cloud console.

For information about all commands for creating an instance from the command line, see the gcloud CLI documentation.

Determine who has access to the JupyterLab instance

Unless you granted access to a specific service account or a single user on the Create a user-managed notebook page Permissions, anyone who has Editor permissions to your Google Cloud project can access the notebook.

If you granted access to a specific service account, anyone who has access to that service account can access the JupyterLab instance. Anyone who doesn't have access to the specified service account cannot access the JupyterLab instance.

If you granted access to a single user, only that user can access the JupyterLab instance. If you are not that single user, even you yourself can't access the JupyterLab instance.

Open the notebook

To open a user-managed notebooks instance, complete the following steps:
  1. In the Google Cloud console, next to your user-managed notebooks instance's name, click Open JupyterLab.

  2. Your user-managed notebooks instance opens JupyterLab.

Network tags

Your new user-managed notebooks instance automatically has the deeplearning-vm and notebook-instance network tags assigned.

These tags let you manage network access to and from your instance by referencing these tags in your VPC networking firewall rules. For more information about network tags, see Configuring network tags.

To view the network tags for your new user-managed notebooks instance, complete the following steps:

  1. In the Google Cloud console, on the  navigation menu, point to Compute Engine and then click VM instances.
  2. Click the name of your new user-managed notebooks instance.
  3. In Networking, find Network tags.

Network configuration options

A user-managed notebooks instance must access service endpoints that are outside your VPC network.

You can provide this access in one of the following ways:

If you use the private.googleapis.com or restricted.googleapis.com VIP to provide access to the service endpoints, add DNS entries for each of the required service endpoints:

  • notebooks.googleapis.com
  • *.notebooks.cloud.google.com
  • *.notebooks.googleusercontent.com

Troubleshooting

If you encounter a problem when you create a notebook, see Troubleshooting Vertex AI Workbench for help with common issues.

What's next