Managing Persistent Disks
Crusoe Cloud is currently in private beta. If you do not currently have access, please request access to continue.
Creating Persistent Disks
- CLI
- UI
Use the storage disks create
command to create a disk with your size. In the example below we will create 100 GiB disk called "data-1."
crusoe storage disks create \
--name data-1 \
--size 100GiB \
--location us-northcentral1
name
, size
, and location
are required arguments. The location
can be either "us-northcentral1" or "us-east1". When attaching a disk to a VM, the disk must be in the same location as the VM.
In order to create a Disk via the Crusoe Cloud console:
- Visit the Crusoe Cloud console
- Click the "Storage" tab in the left nav
- Click the "Create Disk" button
- Input a name for the disk, using only letters, numbers,
-
and_
- Set the desired size of the disk from 1GiB to 10TiB
- Click the "Create" button
Attaching Persistence Disks
Once the disk is created above we can attach and the disk to an instance. In both cases the instance must be in the stopped state.
- CLI
- UI
Use the compute vms attach-disks
command to attach a disk to an instance. You can attach multiple disks to an instance with this command as well using a comma separated list of disk names.
crusoe compute vms attach-disks my-vm --disks data-1
In order to attach a Disk to an instance via the Crusoe Cloud console:
- Visit the Crusoe Cloud console
- Click the "Instances" tab in the left nav
- Click on the instance that you want to attach the disk, you will get futher details about the instance
- Under the "Disks" section find the "Attach" dropdown menu and select the disk that you want to attach
- Click the "+" next to the drop down menu
- Start the instance
Formatting and Mounting Persistent Disks
Once the instance is started, login and use the command lsblk
to inspect the available disks attached to the instance. These persistent ssd disks will have the vd[b-z]
name. In situations where you have multiple disks with the same size, to associate which disk name corresponds to which disk in the consle you can navigate to /dev/disk/by-id
you will see the id after virtio-...
matches the serial number for that disk in the console. For example:
lrwxrwxrwx 1 root root 9 Jun 14 17:52 virtio-39734E8567D2ECA55C1 -> ../../vdb
39734E8567D2ECA55C1
matches the serial number in the Crusoe Cloud Instance details console.
Create the filesystem on the block device by running:
mkfs.ext4 /dev/vdb
Mount the volume by creating a /scratch
directory and mouting /dev/vdb
to /scratch
mount -t ext4 /dev/vdb /scratch
Some additional mount
options exist within the ext4 filesystem by passing -O ...
for example -O noatime,nodiratime,data=writeback
will avoid writing access times, as well disabling journaling if your workloads can benefit from these optimizations.