Deactivating and Activating a Notebook Session

Activate a deactivated Data Science notebook session or deactivate an active one.

Deactivating Notebook Sessions

Before you deactivate a notebook session, save your work to its attached block volume to retain the data. Any data on the boot volume of the notebook session is deleted after you deactivate it.

When you deactivate a notebook session, the underlying Compute instance stops and, the attached block volume is detached and preserved. The block volume drive is mounted in /home/datascience so any data, notebooks, and conda environments that you save are stored there. The work you save in the block volume drive is retained after a notebook session is deactivated. When a notebook session is reactivated, you can access the work that you saved in the block volume.

Activating Notebook Sessions

When you activate a notebook session, any saved data or files on the block volume of that deactivated notebook session are available in the activated notebook session.

Caution

When activating a notebook session, you can use only a VCN and subnet that let the reactivated notebook session remain in the same availability domain. If you use an availability-domain-specific subnet that would change the availability domain of the notebook session, then the activation action fails because the block volume reattachment fails. We recommend that you use regional subnets to avoid this type of error.

While activating a notebook session, you can change the following:

  • Compute shape

  • Block volume size

  • VCN

  • Subnet

  • Storage mounts

  • Runtime configuration's custom environment variables and Git repository URLs to clone

Note

The network configuration of a notebook session can't be changed when the notebook session is reactivated. If a notebook session was configured to use a default network, you can't deactivate the notebook session then select custom networking when you reactivate it.

Note

If you choose to change the block volume size, then you must specify a larger value than the current block volume size.
  • To activate or deactivate a notebook session, follow these steps:

    1. Use the Console to sign in to a tenancy with the necessary policies.
    2. Open the navigation menu and select Analytics & AI. Under Machine Learning, select Data Science.
    3. Select the compartment that contains the project with the notebook session.

      All projects in the compartment are listed.

    4. Select the name of the project.

      The project details page opens and lists the notebook sessions.

    5. Select the name of the notebook session that you want to activate or deactivate.

      The notebook session details page opens.

    6. Select Deactivate or Activate.

      When you activate, you can change the Compute shape, block storage size, or runtime configuration.

    The notebook session is updated to the new state and shows Updating until it's completed.

  • Use the oci data-science notebook-session activate and oci data-science notebook-session deactivatecommands and required parameters:

    oci data-science notebook-session activate --notebook-session-id  <notebook-session-id>.-c [<text>].. [OPTIONS]
    oci data-science notebook-session deactivate --notebook-session-id  <notebook-session-id>.-c [<text>].. [OPTIONS]

    For a complete list of flags and variable options for CLI commands, see the CLI Command Reference.

  • Use the ActivateNotebookSession and DeactivateNotebookSession operations to activate or deactivate a notebook session.