Cloud Infrastructure


Using Elastic Block Storage (EBS)

  • Firstly you sould start a vm and connect to it with ssh.

  • On your pc create the volume you want. For example to create a 5G volume:
    euca-create-volume --size 5 --zone NephelaeCC1
    > VOLUME	vol-XXXXXXXX	5	creating
    You can create up to 5 volumes with maximum 30G total capacity. If you need more space you can use walrus storage.

  • Wait for your volume to be created. You can see your volumes status using the command:
  • Attach your volume to your instance.
    euca-attach-volume -i i-XXXXXXXX -d vda vol-XXXXXXXX
    i-XXXXXXXX is your instance id as shown with euca-describe-instances
    vol-XXXXXXXX is you volume id as shown above
    vda is the device to which volume will be attached

  • Now that the volume is attached to your machine ONLY the first time you have to partition it.
    use as root fdisk -l to view it.

    root@10.16.3.XX:~$ fdisk -l
    Disk /dev/sdb: 5368 MB, 5368709120 bytes
    166 heads, 62 sectors/track, 1018 cylinders
    Units = cylinders of 10292 * 512 = 5269504 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    Disk /dev/vda doesn't contain a valid partition table
    If it is not shown you may try:
    1) depmod -a ; modprobe acpiphp; on your VM and try attaching again
    2) connect to sdb or
    3) try rebooting your instance (sudo reboot)
  • Format your new disk using fdisk:
    root@10.16.3.XX:~$ sudo fdisk /dev/vda
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0xfcb7187b.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
             switch off the mode (command 'c') and change display units to
             sectors (command 'u').
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    Partition number (1-4): 1
    First cylinder (1-1018, default 1): 
    Using default value 1
    Last cylinder, +cylinders or +size{K,M,G} (1-1018, default 1018): 
    Using default value 1018
    Command (m for help): w
    The partition table has been altered!
    Calling ioctl() to re-read partition table.
    Syncing disks. 
  • Build the file system
    root@10.16.3.XX:~$ mkfs.ext3 /dev/vda1
    mke2fs 1.41.11 (14-Mar-2010)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    327680 inodes, 1309649 blocks
    65482 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=1342177280
    40 block groups
    32768 blocks per group, 32768 fragments per group
    8192 inodes per group
    Superblock backups stored on blocks: 
    	32768, 98304, 163840, 229376, 294912, 819200, 884736
    Writing inode tables: done                            
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done
    This filesystem will be automatically checked every 38 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.
  • Mount vda1 to a folder you want
    root@10.16.3.XX:~$ mkdir /myebs1
    root@10.16.3.XX:~$ mount /dev/vda1 /myebs
    root@10.16.3.XX:~$ ls /myebs
  • Now you can store your data in your volume and you can attach it to any instance you want. In contrast to Amazon, Eucalyptus support attaching to only one instance at a time.

  • Before terminating the instance it is recommended to umount and detach your volume. Else may some or all data stored in yout volume will get lost.
    root@10.16.3.XX:~$ sync; umount /myebs
    user@client1:~$ euca-detach-volume vol-XXXXXXXX
    user@client1:~$ euca-terminate-instances i-XXXXXXXX


University of Cyprus Nephelae cloud infrastructure is funded by the
University of Cyprus