An EBS volume can range from 1GB to 1TB and can be mounted to an Amazon EC2 instance as a device, each EBS volume can be mounted to one instance but multiple volumes can be mounted to the same instance. To mount an EBS volume to an instance you have to first log into the AWS Management Console and follow a few simple steps.
Creating a new volume
1. Once inside the AWS Management Console, click the Volumes link under Elastic Block Store in the Navigation panel:
2. Click the ‘Create Volume’ button:
3. In the pop-up form, choose the size of the EBS volume you want to create and select the availability zone (remember, the EBS volume needs to be in the same availability zone as the instance it needs to be attached to):
Click “Create” to create a new EBS volume.
Attaching an EBS Volume to an Instance
1. Once the EBS volume is created and its status changed to ‘available’, select it, and click the “Attach Volume” button:
2. In the following pop-up, choose the instance you want to attach the volume:
Mount the EBS Volume as a drive
1. Now that the EBS volume is attached to the instance, remote connect to the instance, go to Start –> Run, and enter “diskmgmt.msc” to start the Disk Management tool:
2. In the Disk Management tool, right click on the new disk, which is “Offline” right now and bring it “Online”:
3. The disk then needs to be initialized, right click again and select “Initialize Disk”:
4. Choose whether to initialize the disk with MBR or GPT:
5. You’re almost there! Right click on the unallocated space in the initialized disk and create a “New Simple Volume”:
and follow the steps in the wizard.
6. A 10GB volume will probably take 5 ~ 10 mins to format, and once it’s done you’ll be able to see the drive:
As mentioned in Membase’s documentation here, when using an Amazon EC2 instance as a Membase cache server you can use an EBS volume to alleviate the risk of losing your data when an instance fails because the EBS volume can be attached to another instance to effectively restore the node.
Another fun fact about EBS and Amazon EC2 is that Windows 2008 instances are backed and run directly from an EBS volume because of the sheer size of the images themselves! Which is why for every Windows Server 2008 instance you are running you’ll find a 30GB EBS volume attached to that instance, and every AMI you create will have a matching EBS snapshot. And the implication of this is that, if you’re using a Windows instance to run Membase, you won’t need to create additional EBS volumes to store the Membase sqlite files. BUT, there’s a catch, if you terminate the instance manually or through a scaling down event the EBS volume will be deleted too, so be sure to take this into consideration when deriving your strategy for deploying and scaling your Membase cache clusters.