You may want to create additional storage volumes or disks to attach to your VMs in addition to the root volume where the operating system resides.

Those will only be visible and mountable from that particular VM, so if you want to share this storage with other VMs, you may want to expose it through NFS.

Creating a new instance with extra storage disks

If you haven't created the instance yet, this is how you can provision extra volumes along with the creation of the instance itself

  1. Follow the steps described in Provision a new instance - web
  2. When configuring the volumes, create a new one clicking on the + sign and customise the label and size
     
  3. Complete the process until the new instance is up and running.

Adding a disk to existing instances

If you want to expand the storage of an existing instance with extra volumes, you can do so following these steps:

Before you begin, make sure the VM you will alter is ready for being rebooted!  It may be better to shut it down cleanly.

  1. In the web portal, go to Provision - Instances and click on the instance you want to fix.
  2. Click on the ACTIONS button on the upper-right side, and select Reconfigure from the drop-down menu.
  3. Create a new volume by clicking on the + sign and customise the label and size, then click reconfigure
    1. Here, we're adding a new 20GB disk (not usefully) named "data-1" - you should choose a meaningful name.
  4. The VM will be stopped, the disk added and the VM restarted


Current to 2022, there is a bug in Morpheus such that if the disk creation fails (e.g. due to hitting a quota limit), no error is reported.  You can check in the instance details → storage if the disk is there before proceeding.

Configuring the extra volume in the instance

That extra volume is not mounted (or even formatted) by default. You must log in to your VM and then follow the instructions below:

  1. After booting up, the VM should now have an additional disk, typically named vd(SOME_LETTER) - below, we assume the disk is named vdb, but it may be vdc, vdd, etc if you already had a second, third, etc disk.  You can check what disks are attached by running lsblk , which shows disks (e.g. vda, vdb) and partitions on the disks (vda1, vda2, etc for partitions 1 & 2 on vda)
    1. You should expect to see something like this, showing vdb with no partitions:

      NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
      vda     252:0    0   20G  0 disk 
      ├─vda1  252:1    0 19.9G  0 part /
      ├─vda14 252:14   0    4M  0 part 
      └─vda15 252:15   0  106M  0 part /boot/efi
      vdb     252:16   0  128G  0 disk 

      vda is your root disk - do not reformat this!

    2. If you don't see the new disk, check that it was successfully created by Morpheus (see creation section above). If it's there in Morpheus, but not visible in the VM, please contact support
  2. Create a single partition (number 1, so vdb1) filling the disk, labelled "data-1" here, and format it. You may use parted and mkfs.ext4:

    1. Please change the label name to match what you called the new disk in the Morpheus interface (this is not a requirement, but reduces confusion later)

      sudo parted --script  -- /dev/vdb mklabel gpt
      sudo parted --script --align optimal -- /dev/vdb mkpart primary ext4 0% 100%
      sudo mkfs.ext4 -L data-1 /dev/vdb1

      You may partition the disk differently and use any other filesystem type. It is a good idea to use the same name for the volume to set the label of the new filesystem

  3. To have the disk automounted on start up, add an entry to your VM's /etc/fstab, adapting the label to the name you chose earlier:
    1. ​echo "LABEL=data-1 /data1 ext4 defaults 0 0" | sudo tee -a /etc/fstab > /dev/null
  4. Create the directory where you are mounting your filesystem. Make sure you use the same path as defined in fstab:

    sudo mkdir /data1
  5. Mount the file system this first time around and check its ok.  It should be automatically mounted on future reboots (test this now if it's important).

    sudo mount -av

Related articles