Volumes are ideal for adding additional storage for existing servers without having to pay for additional compute resources. So you can spin up a small VM and use volumes to supplement your storage requirements.
For example, provisioning a 512MB VM with 10GB of disk and using volumes to make up the next (20GB) tier’s disk of 30GB would only cost an additional $5 (20GB * $0.25). You aren’t charged for incoming traffic or the amount of I/O you do. You are simply charged for the amount of storage you have. This is measured by GBs of provisioned storage and charged at $0.25 / GB / month, or ~$0.0003 / GB / hr. This can enable huge cost savings by only provisioning exactly what you need.
To create a volume, visit the Volumes page on your dashboard, and click on the “Create Volume” button.
In the modal window, enter a Volume Name, optional Description, select the Type (Regular) and your desired Size in GB. We’ll just make a small 2GB Volume for this demo. After hitting “Create Volume”, you’ll see a “Creating Volume” message while it is being provisioned.
Once you have your Volume created you need to Attach it to the desired Instance. Click Edit Attachments to open the Manage Volume Attachments window. Under Attachments you will see any Instances the volume is currently attached to. (It should be blank now).
Open the Attach to Instance dropdown and select the instance you wish to connect the volume to, then “Attach Volume”.
Just like that, your Volume is attached to your instance, and available to be formatted & mounted in the OS.
Before you can make use of your volume in your operating system of choice, you’ll need to format the disk and mount it so you can start using it for storage. Below you’ll find some basic instructions for Linux and Windows instances that will get your disk mounted and ready.
For linux servers (ubuntu 12.04 is used in the example below), it’s a quick process using fdisk, mkfs and mount.
$ ssh ubuntu@<my-instance-ip> $ sudo -i $ fdisk /dev/vdb # create new partition (n), # primary (1), # answer yes to start and end blocks to use entire disk. $ mkfs.ext4 /dev/vdb1 $ mkdir /mount $ mount /dev/vdb1 /mount
If you would like the Volume to be mounted on boot (permanently attached). You can add an entry in your
/etc/fstab that looks something like the following.
/dev/vdb1 /mount ext4 defaults 0 2
For Windows servers (Windows Server 2008 R2 is used in the example), You can do it all from the console. If you’re still on the Volumes screen, you can click the link to the server, and then click the “Console” tab to get to it quickly.
Once logged in and set up, click on Server Manager – on bottom left next to the Start button. Then click on Storage and then Disk Management.
Right click the Volume you added (labelled Disk 1), and select New Simple Volume. That will launch a Wizard to format the new disk. Following the prompts and using the default values will be fine. Once it finishes formatting (this may take a few moments), you’re done!
If you flip back to your dashboard, you should see that the Status is “In-Use”. Success!