CSS Corp Open Source Services

UEC Storage Management on Ubuntu 10.04 Lucid Lynx

leave a comment »

Storage Controller

The Storage Controller is a block storage in Eucalyptus which is compatible with Amazon’s Elastic Block Store. euca2ools or EC2 commands can be used to control these volumes. Below we specify on using euca2ools commands for volume creation, attaching a volume to a running instance and how-to use the attached volume in the instance.

Interacting with Storage Controller

Linux Instances

  • First create a volume of the required size using euca-create-volume

uecadmin@client1:~$ euca-create-volume -s 10 -z mycloud
VOLUME  vol-333C04B8    10       creating        2010-03-26T05:20:56.383Z

  • Check the available volumes and their status with euca-describe-volumes

uecadmin@client1:~$ euca-describe-volumes
VOLUME  vol-333C04B8    10   mycloud   available     2010-03-26T05:20:56.383Z

  • Now attach the volume to a running instance using euca-attach-volume

uecadmin@client1:~$ euca-attach-volume -i i-41620887 -d /dev/sdb vol-333C04B8

  • The volumes status changes from “available” to “in-use” if it is attached properly.

uecadmin@client1:~$ euca-describe-volumes
VOLUME  vol-333C04B8    10  mycloud in-use  2010-03-26T05:41:28.019Z
ATTACHMENT      vol-331F04B2    i-41620887      unknown,requested:/dev/sdb  2010-03-26T05:43:51.343Z

  • Once you login to the instance through ssh, you should see the new volume.

$ sudo fdisk -l

Disk /dev/sda: 2195 MB, 2195718144 bytes
4 heads, 32 sectors/track, 33504 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Disk identifier: 0x000adc1c

Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       32769     2097152+  83  Linux
/dev/sda3           32769       33504       47071   82  Linux swap / Solaris

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

Now /dev/sdb is ready to be formatted and mounted so that it can be used as a permanent storage. Unmount the volume before bringing down the instance, to avoid any data corruption.

Windows Instances

For windows instances, creating the volume and attaching the volume would be the same.

NOTE: Even while attaching to windows instances, the device has to be specified as /dev/sdb.

The only change is the way this disk is accessed. Once the disk is attached to a running windows instance, perform the following steps:

  • Connect to windows instance via RDP
  • Go to Start -> Run and type diskmgmt.msc without the quotes. Select OK. This opens the Disk Management console.
  • Right click on the new disk at the bottom of the list and choose Initialize Disk.
  • A pop up will appear, choose OK.
  • Next right click on the volume and select New Partition.
  • A wizard appears and accept the defaults, other than change the disk letter as per need.
  • Finish up the wizard, and windows will now format the partition.

After completion the disk management tool shows a healthy partition on the new drive.
To detach a volume from an instance use euca-detach-command command:

uecadmin@client1:~$ euca-detach-volume vol-333C04B8

Note that the volume has to unmounted before detaching it from the instance. Volume can be deleted using euca-delete-volume command:

uecadmin@client1:~$ euca-delete-volume vol-333C04B8

WS3 Storage Controller

Walrus is a storage service in Eucalyptus which is compatible with Amazon’s S3. Using Walrus users can store persistent data, which is organized as buckets and objects. WS3 is a file level storage system, as compared to the block level storage system of Storage Controller.

See Amazon’s S3 Getting Started Guide for more information: http://docs.amazonwebservices.com/AmazonS3/2006-03-01/gsg/ .

Walrus Controller options can be modified from the Web UI, on the “Configuration” page under “Walrus Configuration” section.

For using Walrus to manage Eucalyptus VM images, you can use Amazon’s tools to store/register/delete them from Walrus. Other third party tools can also be used to interact with Walrus directly.

Third party tools for interacting with Walrus

Snapshots

The volumes that have been created on the Block Storage can be used to create point-in-time snapshots of volumes, which are stored on WS3. These snapshots can be used as the starting point for new Block Storage volumes and protect data for long-term durability. The same snapshot can be used to create many volumes as per requirement.
Snapshots can be created by using euca-create-snapshot command:

uecadmin@client1:~$ euca-create-snapshot vol-333C04B8

euca-describe-snapshots lists the available snapshots.

uecadmin@client1:~$ euca-describe-snapshots
SNAPSHOT        snap-32A804A2   vol-333C04B8    completed       2010-04-15T13:48:32.01Z      100%

Volumes from these snapshots can be created by using the snapshot id.

uecadmin@client1:~$ euca-create-volume -s 10 --snapshot snap-32A804A2 --zone mycloud

Please note that the volume can only be created after the snapshot status is completed. Similarly, snapshots from a volume can only be created after the volume status is created, but not during the creating stage. To delete a snapshot:

uecadmin@client1:~$ euca-delete-snapshot snap-32A804A2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: