CEPHdatablock to your Virtual Machine
We recommend you to run your operating system on a small
SSD image and store your bulk data on
In this page we will show you how to create
Ceph datablocks of customisable size for your bulk data and make it available to your Virtual Machine.
The steps you require to add a
Ceph datablock to your Virtual Machine are:
In this section we will be setting up an empty disk on ceph Datastore.
A new image will show on the
Imageslist, and it will keep in status LOCKED while it is being created. When it is created it will come to status READY. Then you still have to format and mount the disk.
In order to let you VM know about the new datablock, you need to add it to your VM’s
template by editing storage options.
Disk 0(that will make a new Disk 1), and then choose the output data
imageyou created as a second
The datablock will be available to your VM the next time you instantiate it. If your VM is running then changes in the Template will not have any effect.
In this section we show you how you can start using the new disk.
VMby selecting the
Templateyou created in the previous step.
VMis in RUNNING state, ssh as root to the machine using your SSH-key.
fdisk -land see that your new datablock is there (Disk /dev/vdb: 10.5 GB).
In the following listing, the first
mkfscommands only need to be run once (and they do destroy everything on the image!). The
mountcommand (fourth line) needs to be run every time you start the VM with that image. Alternatively, you can add this line to /etc/fstab to have it done automatically:
/dev/vdb /data xfs defaults 0 0. For more information on fstab you can consult the Ubuntu Community Wiki.
sudo su - mkdir /data mkfs -t xfs /dev/vdb mount /dev/vdb /data
Optionally you may apply the following commands (the one with
mkdir -ponwards) in order to ask the operating system to perform some optimisations when using Ceph. Note that the directory /etc/rc.d/ may or may not exist, but the -p will make sure that it exists after the command is run.
mkdir -p /etc/rc.d/ && touch /etc/rc.d/rc.local echo "echo 4096 > /sys/block/vdb/queue/read_ahead_kb" > /etc/rc.d/rc.local chmod 755 /etc/rc.d/rc.local