Skip to main content

Managing Shared Disks

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-a

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>

Shared Disks' size can be increased or decreased in increments of 1 TiB with a minimum size of 1 TiB and a maximum size of 1000 TiB. Decreasing the size of a Shared Disk is only allowed up to the nearest rounded-up size in TiB. Any operation to reduce the size lower than the used capacity will fail.

Deleting a Shared Disk

danger

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 a Shared Disk is created, it can be attached and detached from a VM.

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, it can be mounted by running the mount command:

Mounting a virtiofs Shared Disk

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

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

ubuntu@<vm>:~$ findmnt -t virtiofs
TARGET SOURCE FSTYPE OPTIONS
<path-to-mount> <name of shared disk> 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 disk> 100T 0 100T 0% <path-to-mount>

To mount Shared Disks persistently across VM reboots, add an entry to the /etc/fstab file

danger

Warning: Always take a backup of the fstab file for recovery purposes and ensure serial console access is enabled to recover the VM in case of boot failures due to incorrect fstab entries

ubuntu@<vm>:~$sudo vi /etc/fstab
...
<name of shared disk> <path-to-mount> virtiofs defaults 0 0
...

Verify if the automount works for Shared Disks

ubuntu@<vm>:~$sudo mount -va
...
<path-to mount> : successfully mounted
...

Mounting a NFS Shared Disk

info

Please ensure the VAST NFS drivers are installed on the VM before running this command.

The mount command for the disk can be found in the Crusoe Cloud Console, either on the compute instance details page under the disk actions section or on the storage page under the actions section.

ubuntu@<vm>:~$ sudo mount -t nfs -o vers=3,nconnect=16,spread_reads,spread_writes,remoteports=100.64.0.2-100.64.0.17 100.64.0.2:/volumes/<uuid> <path-to-mount>

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

ubuntu@<vm>:~$ findmnt -t nfs
TARGET SOURCE FSTYPE OPTIONS
<path-to-mount> <path-of-shared-disk> nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,forcerdirplus,proto=tcp,nconnect=16,timeo=600,retrans=2,sec=sys,mountaddr=100.64.0.2,mountvers=3,mountport=20048,mountproto=tcp,local_lock=none,spread_reads,spread_writes,addr=100.64.0.2

Running df shows correct provisioned capacity for the Shared Disk

ubuntu@<vm>:~$ df -h
Filesystem Size Used Avail Use% Mounted on
<path-of-shared-disk> 100T 52G 101T 1% <path-to-mount>

To mount Shared Disks persistently across VM reboots, add an entry to the /etc/fstab file

danger

Warning: Always take a backup of the fstab file for recovery purposes and ensure serial console access is enabled to recover the VM in case of boot failures due to incorrect fstab entries

ubuntu@<vm>:~$sudo vi /etc/fstab
...
<path-of-shared-disk> <path-to-mount> nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,forcerdirplus,proto=tcp,nconnect=16,timeo=600,retrans=2,sec=sys,local_lock=none,spread_reads,spread_writes,addr=100.64.0.2 0 0
...

Verify if the automount works for Shared Disks

ubuntu@<vm>:~$sudo mount -va
...
<path-to mount> : successfully mounted
...

Unmounting Shared Disks

Shared Disks can be unmounted by running umount command:

ubuntu@<vm>:~$ sudo umount <path-to-unmount>
ubuntu@<vm>:~$ findmnt -t <virtiofs or nfs>
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

Performance Target of Shared Disks

This is the target aggregate performance of the shared disk across all VMs attached to it. Performance in individual VMs will vary based on available VPC Network Bandwidth.

Read (MB/s per TiB)Write (MB/s per TiB)IOPS (per TiB)
Up to 200 MB/s per TiBUp to 40 MB/s per TiBUp to 1.2k IOPs per TiB