Skip to content

Devmapper storage for Slicer

Devmapper is one of the options for storage with Slicer.

We generally recommend using disk images for long-running VMs, or ZFS for launching many short-lived VMs.

That said, you can install Devmapper as an alternative, with a backing drive set up for it, just like we do for ZFS.

Installation

To setup Devmapper you can run the installation script again, but this time, with additional flags.

First, install a drive, or make a partition available for Devmapper to use.

Run lsblk to identify your drives.

$ lsblk
NAME                             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme1n1                          259:0    0 931.5G  0 disk 
├─nvme1n1p1                      259:1    0     1G  0 part /boot/efi
├─nvme1n1p2                      259:2    0     2G  0 part /boot
└─nvme1n1p3                      259:3    0 928.5G  0 part 
  └─ubuntu--vg-ubuntu--lv        253:0    0   500G  0 lvm  /
nvme0n1                          259:4    0   1.8T  0 disk 

In this instance, you can see that my 2TB NVMe SSD is called nvme0n1 and is currently not allocated.

Run the installation script again and set the --devmapper flag:

curl -sLS https://get.slicervm.com | sudo bash -s -- \
  --devmapper /dev/nvme0n1 \
  --overwrite # Destroy any existing content on the disk

Be very careful that you specify the correct drive or partition. This operation cannot be reversed and will destroy any existing contents.

The default size for any unpacked VM disk is 30GB. To alter that size edit /etc/containerd/config.toml and restart containerd.

[plugins]
  [plugins."io.containerd.snapshotter.v1.devmapper"]
    pool_name = "slicer-thinpool"
    root_path = "/var/lib/containerd/devmapper"
-   base_image_size = "30GB"
+   base_image_size = "50GB"
    discard_blocks = true
sudo systemctl restart containerd

Configure Slicer to use Devmapper

config:
  host_groups:
  - name: vm
-   storage: image
-   storage_size: 25G
+   storage: devmapper

The storage_size field cannot be specified for Devmapper. So whatever size was setup for snapshots during the installation will be the size used for all VMs.