Skip to main content

Volumes

A volume is a persistent disk of the lab. It lives apart from the notebooks: what you save in it is still there when you stop, restart or delete the notebook that used it. Everything else (the container's disk, memory) is lost on every restart.

Volumes are managed in Volumes, in the lab panel menu.

Before you start​

  • Access to the lab as owner or collaborator (Share).
  • Free disk in the lab's budget: each volume takes its full size from the moment it is created, whether you fill it or not (Sizes and quota).

The two kinds of volume​

A notebook mounts volumes in two ways. The disk is the same; what changes is what it is for and where it shows up.

Workspace VolumeData Volume
What forYour personal folder: notebooks, code, virtual environments.Project data: datasets, trained models, results.
How many per notebookOne.As many as you need.
Where it shows up/home/jovyanThe path you choose when mounting it.
How it is createdBy itself, when you create the notebook (<nombre>-workspace).With New Volume, or with Add new volume in the notebook form.
Typical useOne notebook, one person.Several notebooks read and write the same data.

Keep data apart from code: a dataset in a Data Volume is mounted in each member's notebook without copying it, and survives even if someone deletes their notebook along with its Workspace Volume.

The volume list​

Each row in Volumes is a volume:

ColumnWhat it says
StatusGreen when the disk is ready to be mounted.
NameName of the volume. Opens its details.
Created atWhen it was created.
SizeReserved size, in Gi.
Access ModeHow many notebooks can mount it at once (see Access modes).
Storage ClassThe installation's storage type where the disk lives.
Used byNotebook that has it mounted, even when stopped.

At the end of the row there are three actions: the folder opens the file browser (Upload and download files), the X closes it and the bin deletes the volume. Filter searches any column, for example a notebook's name to see its disks.

Create a volume​

  1. In Volumes, click New Volume.
  2. Name: a name that says what it holds (dataset-imagenes, modelos-entrenados). Lowercase letters, numbers and hyphens.
  3. Volume size in Gi: the size. The form suggests 10.
  4. Storage Class: choose the same class shown by the volumes that already exist in your lab (Storage Class column). In the reference installation it is saptiva-file.
  5. Access Mode: choose ReadWriteMany.
  6. Click CREATE.
Change the two values the form suggests

The form opens with a different storage class and with ReadWriteOnce. The lab only accepts volumes of the class its working disks use, which is the one that counts against your budget: with any other, the volume is not created. Set Storage Class and Access Mode before clicking CREATE.

The volume shows up in the list with nothing under Used by. It is empty until you mount it in a notebook or upload files to it with the file browser.

Access modes​

The form offers three:

ModeWho can mount itWhen to use it
ReadWriteManySeveral notebooks at once, all read and write.The one the lab's volumes use. Good for sharing data between notebooks.
ReadWriteOnceA single compute machine at a time.Does not apply to the lab's working disks.
ReadOnlyManySeveral notebooks at once, read only.Reference data nobody should change, if your installation supports it.

The mode is chosen when the volume is created and cannot be changed afterwards.

Mount a volume in a notebook​

A volume is mounted when the notebook is created, in the Data Volumes section of the form (Notebooks):

  • Attach existing volume mounts one that already exists. Choose the volume and the path where it will show up, for example /home/jovyan/datos.
  • Add new volume creates a new one on the spot.

To share data between two notebooks, mount the same volume in both: what one writes, the other sees at the same path, with nothing copied. It works even when one of the notebooks is stopped.

Two people writing the same file at once overwrite each other. Split the volume into folders per person or per experiment.

See a volume's details​

Click the volume's name. Volume details has three tabs:

  • OVERVIEW: Access modes, Size, Storage class, Volume mode, Volume name (the disk's identifier in the storage) and Pods Mounted, which lists what has it mounted right now. With the notebook stopped it says "No pods are using this PVC.".
  • EVENTS: what has happened to the volume. If it was never created, the reason is here.
  • YAML: the full definition, useful to hand to your administrator when you ask for help.

DELETE, at the top right, deletes the volume.

Size and budget​

  • A volume reserves its full size on the lab's disk. The lab's chips in Studio show the sum (used / limit).
  • If the new volume does not fit in what is left, it is not created. Delete volumes you no longer use or ask for more disk (Resize a lab).
  • The panel does not offer changing the size of a volume once created. If it turned out too small, create a larger one, mount both in a notebook, copy the content and delete the old one.
  • Each volume's file browser takes memory while it is open. Close it with the X when you finish (Upload and download files).

Delete a volume​

  1. Check that Used by is empty. While a notebook uses it, even a stopped one, the bin stays disabled: delete that notebook first, without ticking the volume.
  2. Download what you want to keep (Upload and download files).
  3. Click the bin on the row, or DELETE in the details, and confirm.
There is no recycle bin

Deleting a volume erases its content and it cannot be recovered. Deleting the lab deletes all its volumes.

When you delete a notebook, the dialog asks whether its volumes are deleted too. Untick them to keep the data and mount them again in another notebook.

Recommendations​

  • One Data Volume per dataset or per project, not one per person.
  • Names that say what is inside: nobody remembers what volumen-2 held.
  • Keep code in a repository; the volume is for data and results.
  • Before deleting a lab, download what you need: its volumes go with it.
  • Check Volumes now and then: a volume with no Used by still takes budget.

Next step​