Skip to main content

Managing Instance Ephemeral Storage

info

Crusoe Cloud is currently in private beta. If you do not currently have access, please request access to continue.

Overview

Ephemeral disks are available on certain VM instance types. On GPU enabled VMs, we typically offer 1x 960 GB NVMe drive per GPU.

Lifecycle

Ephemeral disks have a lifecycle that is tied to the server associated with a given virtual machine. If the physical server reboots, or the VM is stopped and restarted, the disks are erased.

Note: if a VM is restarted from within the VM (e.g. using sudo reboot now) rather than by stopping and restarting the VM from the UI, CLI, or API, the disks will not be erased.

Formatting and Mounting Ephemeral Disks

Below is a script you can add to your startup scripts to automatically detect the number of ephemeral disks and create an ext4 file system mounted at the /nvme path. If multiple ephemeral disks are found, the script will create a RAID0 array of the disks for additional performance benefits, mounted at the /raid0 path.

#!/bin/bash

apt update && apt install -y nvme-cli mdadm

num_nvme=`nvme list | grep -i /dev | wc -l`

if [[ $num_nvme -eq 1 ]]; then
dev_name=`nvme list | grep -i /dev | awk '{print $1}'`
mkfs.ext4 $dev_name
mkdir /nvme && mount -t ext4 /dev/nvme0n1 /nvme
elif [[ $num_nvme -gt 1 ]]; then
dev_name=`nvme list | grep -i /dev | awk '{print $1}'`
mdadm --create --verbose /dev/md127 --level=0 --raid-devices=$num_nvme $dev_name
mkfs.ext4 /dev/md127
mkdir /raid0 && mount -t ext4 /dev/md127 /raid0
else
echo "no ephemeral drives detected"
fi