Skip to main content

Managing Shared Disks

info

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

Creating Shared Disks

Use the storage disks create command and specify the type "shared-volume" to create a shared disk of your specified size. In the example below we will create 1 TiB disk called "shared-1."

crusoe storage disks create \
--name shared-1 \
--type shared-volume
--size 1TiB \
--location us-southcentral1

name, size, type and location are required arguments to create a shared disk. When attaching a disk to a VM, the disk must be in the same location as the VM.

Viewing all Shared Disks

Use the storage disks list command to list existing disks.


crusoe storage disks list

Update an existing Shared Disk

Use the storage disks resize <name> command to resize existing disks using the --size flag. Here's an example:


crusoe storage disks resize <name> --size <size>

Deleting a Shared Disk

info

Warning: Deleting a disk is a permanent action.

All Crusoe VMs must be detached from a Shared Disk before the Shared Disk can be deleted.

Use the storage disks delete <name> command to delete a disk of your choice. As an example, you can delete a disk by replacing DISK_NAME with the name of the disk you wish to delete:

crusoe storage disks delete DISK_NAME

Attaching and detaching Shared Disks

Once the disk is created above we can attach and detach the disk to an instance.

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 --disk name=data-1,mode=read-write

Use the compute vms detach-disks command to detach a disk from an instance. You can detach multiple disks from an instance with this command as well using a comma separated list of disk names.

crusoe compute vms detach-disks my-vm --disk name=data-1

Mounting Shared Disks

Once a Shared Disk is attached, the Shared Disk can be mounted by running mount command:

ubuntu@<vm>:~$ sudo mount -t virtiofs <name of shared volume> <path>

findmnt command is used to confirm the Shared Disk is mounted correctly,

ubuntu@<vm>:~$ findmnt -t virtiofs
TARGET SOURCE FSTYPE OPTIONS
<path> <name of shared volume> virtiofs rw,relatime

Running df shows correct provisioned capacity for the Shared Disk

ubuntu@<vm>:~$ df -h
Filesystem Size Used Avail Use% Mounted on
...
<name of shared volume> 100T 0 100T 0% <path>

Unmounting Shared Disks

Shared Disks can be unmounted by running umount command:

ubuntu@<vm>:~$ sudo umount <path>
ubuntu@<vm>:~$ findmnt -t virtiofs
ubuntu@<vm>:~$

Unmounted Shared Disks can be mounted again as long as the shared volume is still attached in control plane.

Benchmarking a mounted Shared Disk

The fio tool can be used to benchmark Shared Disks. From within a mounted Shared Disk you can run the following commands to test read/write bandwidth and iops:

# test write bw
fio --name=my-job --group_reporting --time_based=1 --cpus_allowed_policy=split --runtime=10s --ramp_time=5s --size 20G --numjobs=32 --ioengine=aio --direct=1 --iodepth 8 --rw write --bs 1m
# test read bw
fio --name=my-job --group_reporting --time_based=1 --cpus_allowed_policy=split --runtime=10s --ramp_time=5s --size 20G --numjobs=32 --ioengine=aio --direct=1 --iodepth 8 --rw read --bs 1m
# test write iop
fio --name=my-job --group_reporting --time_based=1 --cpus_allowed_policy=split --runtime=10s --ramp_time=5s --size 20G --numjobs=32 --ioengine=aio --direct=1 --iodepth 8 --rw write --bs 4k
# test read iop
fio --name=my-job --group_reporting --time_based=1 --cpus_allowed_policy=split --runtime=10s --ramp_time=5s --size 20G --numjobs=32 --ioengine=aio --direct=1 --iodepth 8 --rw read --bs 4k