Attach a volume to a cluster machine

Learn how to attach your volume to a cluster machine and mount it

Guide

Attach a volume to a cluster machine

To attach a volume to a cluster machine, you will need to have an existing volume and a cluster machine. If you haven't created a volume yet, see Create a volume. If you haven't created a cluster yet, see Create a cluster.

Once you have both a volume and a cluster, attach the volume to a cluster machine by following these steps:

  1. Navigate to the project you wish to attach a volume to.
  2. Click Clusters in the navigation menu.
  3. Click on the cluster you wish to attach the volume to.
  4. Click on the dropdown next to the cluster machine you wish to attach the volume to.
  5. Click on Attach volume.
  6. Select the volume you wish to attach from the dropdown.
  7. Click Attach volume.

This will ensure that the volume is available to the cluster machine and can be mounted.

Mounting a volume

Once a volume is attached to a cluster machine, you will need to mount it to read and write data. Establish an SSH connection with the cluster machine using the ssh command and run the following commands:

  1. Install the necessary Network File System (NFS) dependencies:
        
        sudo apt install nfs-common
    
        
      
  2. Create a directory on the system where you will mount your storage volume:
        
        sudo mkdir /data
    
        
      
  3. Add a record to the File Systems Table (/etc/fstab) to ensure the volume is automatically mounted when the cluster machine is restarted. The value for <IP address> can be found on the Volumes page in the CUDO Compute console.
        
        <IP address>:/data /data nfs rw,nconnect=16,nfsvers=3 0 0
    
        
      
  4. Once you have updated the configuration in /etc/fstab run the following command to mount the volume:
        
        sudo mount -a
    
        
      
  5. To confirm that the volume mounted correctly, run the following command to see if the target directory (/data) has successfully mounted the storage volume:
        
        df -h
    
        
      

Unmounting the volume

You may want to unmount a volume from a cluster machine if you plan to delete or replace the volume.

Run the umount command to unmount the volume:

    
    sudo umount /data

    
  

Remove the record for the volume from the File Systems Table (/etc/fstab) to prevent it from being automatically mounted when the cluster machine is restarted.