Artica Wiki

Docker: Container disk quotas

Fixed size storage volumes for the persistent data of a container: creation, usage, extension, backup and removal.

Back to Artica for Docker Edition

One runaway application should never fill the whole server.
Artica gives a container its own storage space of a fixed size.
When that space is full, only that application is affected and the rest of the appliance keeps running.

The Disk Quota tab of a container

What it does

A quota volume is a virtual disk of fixed size, stored as a file on the appliance.
Artica formats it, mounts it and shows it inside the container at the folder you choose, for example /data.
The application writes its persistent data there and cannot write more than the size of the volume.

The volume has its own identity.
It survives the removal and the recreation of the container.

Benefits

Use cases

What the quota covers

Item Counted in the quota
Files written in the quota volume (for example /data) Yes
Docker image layers No
The container's writable layer (files written outside the volume) No
Container logs No
Other volumes and temporary file systems No

The size of the volume is the size of the virtual disk.
The file system itself takes a small part of it, so the application sees slightly less free space.
The tab shows both figures.

Requirements

Create a volume

  1. Open Docker > Containers and click the container.
  2. Open the Disk Quota tab.
  3. Click Create quota volume.
  4. Choose the Size (GiB), from 1 to 16384.
    The default is 2 GiB.
  5. Enter the Folder in the container where the application writes its data, for example /var/lib/mysql for a database.
  6. Set the File owner UID and File owner GID.
    Keep 0 unless the application runs as a specific user, for example 999 for many database images.
  7. Click Create quota volume.

Creating a quota volume

Artica creates the volume and mounts it on the appliance.
Then attach it to the container: open the menu of the volume card and choose Attach by recreating container.

Attaching recreates the container.
The volume hides the files that the image already had in that folder.
Tick the acknowledgement that accepts the recreation, the interruption and the masking of these files.

Watch the usage

The tab shows:

The usage is sampled every minute.
The percentage turns orange at 80 % and red at 95 %.

Extend a volume

  1. Click Extend capacity.
  2. Enter the new size.
  3. Confirm.

The data stays in place.
A volume cannot be reduced.

Back up and restore

Artica takes a backup with the container stopped, so that the data is consistent.

  1. Stop the container.
  2. Click Offline backup.
  3. To go back to a backup, click Restore offline and pick it.

Backups are kept outside the volume and do not count in its size.
They remain after the volume is destroyed, until you remove them with Delete a backup.

Remove a volume

Removing a container keeps its volume.
To free the space:

  1. Detach the volume from the container with Detach by recreating container.
  2. Click Archive and retain data.
    The volume is unmounted and kept.
  3. Click Permanently destroy data and confirm twice.

Restarts managed by Artica

Artica, not Docker alone, starts a container that has a quota volume.
It keeps the restart policy you chose and applies it once the volume is mounted.
After a reboot, the container waits until its volume is back.
When a volume cannot be checked safely, it is marked Manual recovery required and its container stays stopped.

Permissions

Action Permission
Read volumes and their usage Read disk quotas
Create a volume Create quota volume
Extend a volume Extend capacity
Archive a volume Archive and retain data
Attach, detach, back up, restore, destroy, delete a backup Administer disk quotas

Troubleshooting

Symptom What to do
Creation refused for lack of space The appliance needs the full size plus 1 GiB free.
Free some space or choose a smaller size.
The container does not start after a reboot Open the Disk Quota tab.
The volume may be unmounted or in Manual recovery required.
Backup or restore refused Stop the container first.
The application reports "no space left on device" The volume is full.
Extend it.