Utrecht HowToAddVolumeStorageToMachine

From Fiware NL Wiki
Jump to: navigation, search

This How To will describe the setup of a new volume and attach it to your machine on the Utrecht FIWARE lab.
The result will be a new volume/disk to your machine.

To start this guide, please goto to the FIWARE Lab cloud node on http://46.44.173.83/dashboard/auth/login.
Utrecht fiwarelabloginscreen.jpg
note: If you do not have an account yet, send an email to TODO with the purposes of your project.

Login to the Utrecht node. For this How To you will need a running machine.
Select the 'Volumes' menu
Utrecht howtocreateavolumemainscreen.jpg

Select '+ Create Volume' to create a volume

Complete all field, enter a volume size. You could choose to use an existing image, but we will create an empty volume.
Press 'Create Instance' to complete the creation of the volume
Utrecht howtocreateavolumecreatevolume.jpg

Your volume is now created, but still not useable on a virtual machine. You need to attach the volume to an already existing instance
Utrecht howtocreateavolumecreatedvolume.jpg

Under Actions, select the pull down menu. In this menu select the 'Manage Attachments'
Utrecht howtocreateavolumemanageattachmentspulldown.jpg

Select the correct instance from the 'Attach to Instance' pulldown and press 'Attach Volume'
Utrecht howtocreateavolumeattachvolume.jpg

A brief notice (in the top-left corner) will appear, mentioning the mount location on the virtual machine
Utrecht howtocreateavolumeattachvolumepopup.jpg

The volume is now attached on the instance.
The following step is required for some Linux versions, and may differ between distributions.
Login to the instance on which the volume has been added.
The drive is (in my case, Centos 6) not visible and a forced scsi bus scan must be executed (as root!):
#> echo "- - -" > /sys/class/scsi_host/host0/scan
Now the volume is available as /dev/vdb on the server. Now just partition the drive (in this example used fdisk):
#> fdisk /dev/vdb and created a primary partition with all space used.
Utrecht howtocreateavolumelinux1.jpg

Now create a mount point for the drive, we will use /data
#> mkdir /data
Edit the /etc/fstab file, for automount after reboot. And just force a mount by:
#> mount -a
Utrecht howtocreateavolumelinux2.jpg

The volume is now available on your instance at the /data location