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 Volume | Data Volume | |
|---|---|---|
| What for | Your personal folder: notebooks, code, virtual environments. | Project data: datasets, trained models, results. |
| How many per notebook | One. | As many as you need. |
| Where it shows up | /home/jovyan | The path you choose when mounting it. |
| How it is created | By itself, when you create the notebook (<nombre>-workspace). | With New Volume, or with Add new volume in the notebook form. |
| Typical use | One 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:
| Column | What it says |
|---|---|
| Status | Green when the disk is ready to be mounted. |
| Name | Name of the volume. Opens its details. |
| Created at | When it was created. |
| Size | Reserved size, in Gi. |
| Access Mode | How many notebooks can mount it at once (see Access modes). |
| Storage Class | The installation's storage type where the disk lives. |
| Used by | Notebook 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
- In Volumes, click New Volume.
- Name: a name that says what it holds (
dataset-imagenes,modelos-entrenados). Lowercase letters, numbers and hyphens. - Volume size in Gi: the size. The form suggests
10. - 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. - Access Mode: choose ReadWriteMany.
- Click CREATE.
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:
| Mode | Who can mount it | When to use it |
|---|---|---|
| ReadWriteMany | Several notebooks at once, all read and write. | The one the lab's volumes use. Good for sharing data between notebooks. |
| ReadWriteOnce | A single compute machine at a time. | Does not apply to the lab's working disks. |
| ReadOnlyMany | Several 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
- 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.
- Download what you want to keep (Upload and download files).
- Click the bin on the row, or DELETE in the details, and confirm.
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-2held. - 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.