1 =============================
2 Block Devices and CloudStack
3 =============================
5 You may use Ceph Block Device images with CloudStack 4.0 and higher through
6 ``libvirt``, which configures the QEMU interface to ``librbd``. Ceph stripes
7 block device images as objects across the cluster, which means that large Ceph
8 Block Device images have better performance than a standalone server!
10 To use Ceph Block Devices with CloudStack 4.0 and higher, you must install QEMU,
11 ``libvirt``, and CloudStack first. We recommend using a separate physical host
12 for your CloudStack installation. CloudStack recommends a minimum of 4GB of RAM
13 and a dual-core processor, but more CPU and RAM will perform better. The
14 following diagram depicts the CloudStack/Ceph technology stack.
17 .. ditaa:: +---------------------------------------------------+
19 +---------------------------------------------------+
21 +------------------------+--------------------------+
25 +---------------------------------------------------+
27 +---------------------------------------------------+
29 +---------------------------------------------------+
31 +------------------------+-+------------------------+
33 +------------------------+ +------------------------+
35 .. important:: To use Ceph Block Devices with CloudStack, you must have
36 access to a running Ceph Storage Cluster.
38 CloudStack integrates with Ceph's block devices to provide CloudStack with a
39 back end for CloudStack's Primary Storage. The instructions below detail the
40 setup for CloudStack Primary Storage.
42 .. note:: We recommend installing with Ubuntu 14.04 or later so that
43 you can use package installation instead of having to compile
46 Installing and configuring QEMU for use with CloudStack doesn't require any
47 special handling. Ensure that you have a running Ceph Storage Cluster. Install
48 QEMU and configure it for use with Ceph; then, install ``libvirt`` version
49 0.9.13 or higher (you may need to compile from source) and ensure it is running
53 .. note:: Ubuntu 14.04 and CentOS 7.2 will have ``libvirt`` with RBD storage
54 pool support enabled by default.
56 .. index:: pools; CloudStack
61 By default, Ceph block devices use the ``rbd`` pool. Create a pool for
62 CloudStack NFS Primary Storage. Ensure your Ceph cluster is running, then create
65 ceph osd pool create cloudstack
67 See `Create a Pool`_ for details on specifying the number of placement groups
68 for your pools, and `Placement Groups`_ for details on the number of placement
69 groups you should set for your pools.
71 A newly created pool must initialized prior to use. Use the ``rbd`` tool
72 to initialize the pool::
74 rbd pool init cloudstack
79 To access the Ceph cluster we require a Ceph user which has the correct
80 credentials to access the ``cloudstack`` pool we just created. Although we could
81 use ``client.admin`` for this, it's recommended to create a user with only
82 access to the ``cloudstack`` pool. ::
84 ceph auth get-or-create client.cloudstack mon 'profile rbd' osd 'profile rbd pool=cloudstack'
86 Use the information returned by the command in the next step when adding the
89 See `User Management`_ for additional details.
94 To add primary storage, refer to `Add Primary Storage (4.2.0)`_ to add a Ceph block device, the steps
97 #. Log in to the CloudStack UI.
98 #. Click **Infrastructure** on the left side navigation bar.
99 #. Select the Zone you want to use for Primary Storage.
100 #. Click the **Compute** tab.
101 #. Select **View All** on the `Primary Storage` node in the diagram.
102 #. Click **Add Primary Storage**.
103 #. Follow the CloudStack instructions.
105 - For **Protocol**, select ``RBD``.
106 - Add cluster information (cephx is supported). Note: Do not include the ``client.`` part of the user.
107 - Add ``rbd`` as a tag.
110 Create a Disk Offering
111 ======================
113 To create a new disk offering, refer to `Create a New Disk Offering (4.2.0)`_.
114 Create a disk offering so that it matches the ``rbd`` tag.
115 The ``StoragePoolAllocator`` will choose the ``rbd``
116 pool when searching for a suitable storage pool. If the disk offering doesn't
117 match the ``rbd`` tag, the ``StoragePoolAllocator`` may select the pool you
118 created (e.g., ``cloudstack``).
124 - CloudStack will only bind to one monitor (You can however create a Round Robin DNS record over multiple monitors)
128 .. _Create a Pool: ../../rados/operations/pools#createpool
129 .. _Placement Groups: ../../rados/operations/placement-groups
130 .. _Install and Configure QEMU: ../qemu-rbd
131 .. _Install and Configure libvirt: ../libvirt
132 .. _KVM Hypervisor Host Installation: http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.0/html/Installation_Guide/hypervisor-kvm-install-flow.html
133 .. _Add Primary Storage (4.2.0): http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.0/html/Admin_Guide/primary-storage-add.html
134 .. _Create a New Disk Offering (4.2.0): http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.0/html/Admin_Guide/compute-disk-service-offerings.html#creating-disk-offerings
135 .. _User Management: ../../rados/operations/user-management