Creating an Array of Volumes

Datapipe's Stratosphere volumes have a maximum size of 1TB which is a large amount of disk and should be enough for most applications.   However, larger volumes are sometimes required. That can be accomplished by creating a logical RAID (Redundant Array of Inexpensive Drives) and joining numerous smaller volumes into a single large logical volume. 

Note: The maximum number of volumes you can have attached to a VM is seven (root and six data). That would make the maximum capacity of a RAID 0 array 6 TB.

Because snapshots are restricted to one volume at a time, it is not possible to snapshot an entire array of volumes. If you opt to create such an array, you need to make provisions for some other method of backing up and restoring data. You will likely not be able to recover an array from a series of snapshots since each snapshot would have been performed at different times, making the contents of striped or mirrored volumes inconsistent.

Creating an array

In your Stratosphere portal, select the button labeled 'Storage'. This will open drop down list with additional options. Click 'Volumes', 'New Volume'.

Volumeview01

You should now see the 'New Volume' overlay. From this point give the volume a name, and choose the volume size and zone into which it should be created. Click 'Create Volume'.


Diskofferings

After clicking create, you are brought back to the 'Volumes' main page where you'll be able to see the newly created volume. We now have to attach the volume to one of the running VMs. Locate the new volume and click 'Attach Disk' (It's an icon on the right side of the page.)

Volattach

You should now see 'Attach Volume' overlay. Click the drop down and choose the VM you would like to attach the volume. (At this time leave the 'Device ID' field blank).

Volattach03

You should now see the drive 'State' as ready and the VM to which it is attached. Repeat steps 1 - 9 three additional times resulting in a total of four new volumes. Make sure all are attached to the same VM.

The next steps will be completed within the VM. Login to your VM. Run the following: ssh root@<VM IP ADDRESS>

Once logged in we have to install two packages mdadm (software RAID) and xfsprogs. NOTE: XFS file system recommended by mongodb/mysql.

RPM Based:

Vol Raidpic3

APT Based:

Vol Raidpic4

Verify all four of the new volumes have been attached and note the device id for later (e.g. /dev/vde, /dev/vdf). Run 'fdisk -l'

Vol Raidpic5

Now we begin the process of creating a RAID.

Vol Raidpic6

**Update all occurences of '/dev/vd*' with the correct device id's attached in steps 1-9 **

Append configuration to mdadm.conf config file. This ensures that the RAID will be re-assembled automatically. Run the following:

echo DEVICE /dev/sdh1 /dev/sdh2 /dev/sdh3 /dev/sdh4 | sudo tee /etc/mdadm.conf
mdadm --detail --scan | sudo tee -a /etc/mdadm.conf

Verify the mdadm.conf is correct. Should have something similar to the following two lines.

Vol Raidpic7

Note: UUID will be different. Device ID's may also differ.

  • Format the RAID with a file system. If using XFS, run the following: sudo mkfs.xfs /dev/md1 If using EXT4, run the following:sudo mkfs.ext4 /dev/md1
  • Add the newly created RAID array to /etc/fstab to ensure the array is mounted automatically. Run the following: echo '/dev/md1 /<CHOOSE MOUNT NAME> <CHOOSE FILE SYSTEM> noatime 0 0 | sudo tee -a /etc/fstab
  • Create the mount point. Run the following: sudo mkdir /<CHOOSE MOUNT NAME>
  • Mount the array. Run the following: sudo mount /<CHOOSE MOUNT NAME>

You should now have a functional array. Verify by running 'df -h'

Vol Raidpic8