Skip to content

Add a Volume to an Existing VM Instance

  1. Navigate to your Volumes List at https://cloud.cades.ornl.gov/dashboard/project/volumes/.
  2. At the top right click on Create Volume.
  3. Fill in the following fields:
    • Name : user choice
    • Description : optional and can be left blank
    • Source : No source, empty volume (this is default)
    • Type : Netapp (this is default)
    • Size : Size you need up to your quota, which is displayed on the right
    • Availability Zone: nova (this is default)
  4. Click Create Volume.
  5. Once created use the drop down ( ▾ ) on the right of the volume you just created and choose Manage Attachments.
  6. Select the instance from the drop down to which you would like to attach your new volume.
  7. Next, the volume will have to be partitioned, formatted, and mounted. To begin, SSH into your VM.
  8. Check that the volume was assigned by listing the available disks: type lsblk. You should see a new disk with the allotted storage amount in the listed output. Example output is shown below.
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda    253:0    0   8G  0 disk
└─vda1 253:1    0   8G  0 part /
vdb    253:16   0   8G  0 disk
  • In this case, the disk vda is the original disk that has a partition named vda1. You may want to create a partition in vdb (optional).

Optional: To create partition of the new disk, type sudo fdisk /dev/vdb. This command expects you to enter additional information.

  • To create a new partition, enter n then press Enter.
  • Choose p for primary or e for an extended partition. Usually, you will choose e then press Enter.
  • The next two prompts request space allocations. In typical situations, press Enter on these two prompts to select the defaults. If you would like more information about your options, check the "SIZES" section in the fdisk manual by typing man fdisk.
  • Type w and then press Enter to write your changes and reboot the system.
  • You will be returned to your bash prompt.
  • To check that the partition was created correctly, type lsblk and you should see the new partition labelled vdb1 (in this example case).
    NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    vda    253:0    0   8G  0 disk
    └─vda1 253:1    0   8G  0 part /
    vdb    253:16   0   8G  0 disk
    └─vdb1 253:17   0   8G  0 part

Next, the new volume/partition must be formatted. Type sudo mkfs.ext4 /dev/vdb1.

📝 Note: OpenStack and/or fdisk may impart a default filesystem type on the new volume. In this case, you will be asked if you would like to proceed with the formatting although an existing partition table exists. If you choose to proceed by typing y, you will rewrite the partition.

⚠ DO NOT PROCEED if this partition contains data that you need to keep!

  1. To check the formatting, type lsblk -f. You should see that the vdb1 entry has the ext4 filesystem type.
  2. To mount the volume for use, you need to create the mountpoint. For example: mkdir volume.
  3. Then, to mount the volume to the newly-created mountpoint, type sudo mount /dev/vdb1/ ./volume.
  4. Lastly, to check the mountpoint. type lsblk -f and you should see vdb is mounted at the location you chose: /home/cades/volume.
  5. To avoid having to mount the volume every time you boot your VM Instance, you may set up automounting by viewing the contents of /etc/fstab.
    • Type sudo nano /etc/fstab.
    • Check for an existing line of code: /dev/vdb /data auto defaults,nofail 0 2
    • If it is not present, add it. Save your changes.
  6. The new storage volume is ready to use.