How to create and attach Elastic Block Storage volume to a Linux server?

Elastic block storage volume configuration on Linux servers

Deploy & Manage Volumes

Create a new volume

In case you don't have any storage devices in your project yet, click on Storage tab at Client Portal and you will see the following:

Create a new elastic volume cherry servers

In order to create a new volume click on "Add volume" button then select region, add description of your volume and choose desired size. Click "Add volume".

Buy elastic storage

 

Attach / Detach volume at Client Portal side

When volume is created you need to attach it to the desired server in order to mount and use it.

Delete elastic storage

In order to do that click on the volume management icon and select "Attach volume". Choose server to attach and click on "Attach Volume".

Order elastic storage

Attach volume at the server side

Once server has been attached at the Client Portal, you need to configure it at your server side in order to mount and use it. To do so, we have prepared a script which automates the configuration process for you.

wget -O /usr/local/bin/cherry-elastic-storage "https://raw.githubusercontent.com/cherryservers/cherry-elastic-storage/master/cherry-elastic-storage"

You will find all the required variables at the Client Portal after volume attachment is done.

Cherry servers client portal

After you import required variables and download the script run in your SHELL environment:

chmod +x /usr/local/bin/cherry-elastic-storage
cherry-elastic-storage -v $vlan_id -z $vlan_ip -d $portal_ip -i $initiator -e

At the end of the script processing you will be provided with block storage device you will use for further actions like creating file system and mounting it.

block storage device mounting

Bear in mind that volume name will be different than in this example, so use volume name provided by the script.

Create file system on the volume

In order to use the volume you need to create a file system on it first. To do so, you may use following command:

Create file system on elastic storage

Mounting the volume

After volume is successfully formatted in order to access it for further actions you need to mount it. To do so, you may use such command:

Mount elastic storage image

Once it's done, you can put data on your volume.

To make volume mount permanent so it can survive reboot of the server, execute following command:

Permanent mount block storage

The _netdev option ensures that system will not try to mount the file system until network is available. It is necessary option.

Detach volume

If you want to detach volume to delete it or to move and attach to another server:

  • Unmount volume from the system
  • Detach it via command cherry-elastic-storage. Use -q option instead of -e to detach volume
  • Detach it via Client Portal
  • Now you may attach it to another server or delete if not required anymore.