2012-06-18 21:29:04 +00:00
|
|
|
===================
|
|
|
|
RBD and OpenStack
|
|
|
|
===================
|
2012-09-18 20:00:58 +00:00
|
|
|
|
|
|
|
You may use Ceph block device images with OpenStack with QEMU and ``libvirt`` as
|
|
|
|
the interface. Ceph stripes block device images as objects across the cluster,
|
|
|
|
which means that large Ceph block device images have better performance than a
|
|
|
|
standalone server!
|
|
|
|
|
|
|
|
To use RBD with OpenStack, you must install QEMU, ``libvirt``, and OpenStack
|
|
|
|
first. We recommend using a separate physical host for your OpenStack
|
|
|
|
installation. OpenStack recommends a minimum of 8GB of RAM and a quad-core
|
|
|
|
processor. The following diagram depicts the OpenStack/Ceph technology stack.
|
|
|
|
|
|
|
|
|
|
|
|
.. ditaa:: +---------------------------------------------------+
|
|
|
|
| OpenStack |
|
|
|
|
+---------------------------------------------------+
|
|
|
|
| libvirt |
|
|
|
|
+---------------------------------------------------+
|
|
|
|
| QEMU/RBD |
|
|
|
|
+---------------------------------------------------+
|
|
|
|
| librbd |
|
|
|
|
+---------------------------------------------------+
|
2012-10-01 21:53:57 +00:00
|
|
|
| librados |
|
2012-09-26 00:19:50 +00:00
|
|
|
+------------------------+-+------------------------+
|
|
|
|
| OSDs | | Monitors |
|
|
|
|
+------------------------+ +------------------------+
|
2012-06-18 21:29:04 +00:00
|
|
|
|
|
|
|
.. _Installing OpenStack: ../../install/openstack
|
|
|
|
|
2012-06-19 17:10:51 +00:00
|
|
|
.. important:: To use RBD with OpenStack, you must have a running Ceph cluster.
|
2012-09-18 20:00:58 +00:00
|
|
|
|
2012-06-18 21:29:04 +00:00
|
|
|
|
|
|
|
Create a Pool
|
2012-09-18 20:00:58 +00:00
|
|
|
=============
|
|
|
|
|
2012-06-18 21:29:04 +00:00
|
|
|
By default, RBD uses the ``data`` pool. You may use any available RBD pool.
|
|
|
|
We recommend creating a pool for Nova. Ensure your Ceph cluster is running,
|
|
|
|
then create a pool. ::
|
|
|
|
|
2012-09-18 20:00:58 +00:00
|
|
|
ceph osd pool create nova
|
|
|
|
|
|
|
|
See `Create a Pool`_ for detail on specifying the number of placement groups
|
|
|
|
for your pool, and `Placement Groups`_ for details on the number of placement
|
|
|
|
groups you should set for your pool.
|
|
|
|
|
2012-09-18 20:55:18 +00:00
|
|
|
.. _Create a Pool: ../../cluster-ops/pools#createpool
|
|
|
|
.. _Placement Groups: ../../cluster-ops/placement-groups
|
2012-06-18 21:29:04 +00:00
|
|
|
|
|
|
|
Install Ceph Common on the OpenStack Host
|
2012-09-18 20:00:58 +00:00
|
|
|
=========================================
|
|
|
|
|
2012-06-18 21:29:04 +00:00
|
|
|
OpenStack operates as a Ceph client. You must install Ceph common on the
|
|
|
|
OpenStack host, and copy your Ceph cluster's ``ceph.conf`` file to the
|
2012-09-26 00:21:52 +00:00
|
|
|
``/etc/ceph`` directory. If you have installed Ceph on the host, ceph-common
|
2012-06-18 21:29:04 +00:00
|
|
|
is already included. ::
|
|
|
|
|
|
|
|
sudo apt-get install ceph-common
|
|
|
|
cd /etc/ceph
|
|
|
|
ssh your-openstack-server sudo tee /etc/ceph/ceph.conf <ceph.conf
|
|
|
|
|
2012-09-18 20:00:58 +00:00
|
|
|
|
2012-06-18 21:29:04 +00:00
|
|
|
Add the RBD Driver and the Pool Name to ``nova.conf``
|
2012-09-18 20:00:58 +00:00
|
|
|
=====================================================
|
|
|
|
|
2012-06-18 21:29:04 +00:00
|
|
|
OpenStack requires a driver to interact with RADOS block devices. You must also
|
|
|
|
specify the pool name for the block device. On your OpenStack host, navigate to
|
2012-09-26 00:21:52 +00:00
|
|
|
the ``/etc/nova`` directory. Open the ``nova.conf`` file in a text editor using
|
2012-06-18 21:29:04 +00:00
|
|
|
sudo privileges and add the following lines to the file::
|
|
|
|
|
|
|
|
volume_driver=nova.volume.driver.RBDDriver
|
|
|
|
rbd_pool=nova
|
|
|
|
|
2012-09-18 20:00:58 +00:00
|
|
|
|
2012-09-26 00:21:52 +00:00
|
|
|
Restart OpenStack
|
2012-09-18 20:00:58 +00:00
|
|
|
=================
|
|
|
|
|
2012-06-18 21:29:04 +00:00
|
|
|
To activate the RBD driver and load the RBD pool name into the configuration,
|
|
|
|
you must restart OpenStack. Navigate the directory where you installed
|
|
|
|
OpenStack, and execute the following::
|
|
|
|
|
|
|
|
./rejoin-stack.sh
|
|
|
|
|
|
|
|
If you have OpenStack configured as a service, you can also execute::
|
|
|
|
|
|
|
|
sudo service nova-volume restart
|
|
|
|
|
|
|
|
Once OpenStack is up and running, you should be able to create a volume with
|
2012-09-26 00:21:52 +00:00
|
|
|
OpenStack on a Ceph RADOS block device.
|