Three parts of OpenStack integrate with Ceph's block devices:
-- **Images**: OpenStack Glance manages images for VMs. Images are immutable.
+- **Images**: OpenStack Glance manages images for VMs. Images are immutable.
OpenStack treats images as binary blobs and downloads them accordingly.
-- **Volumes**: Volumes are block devices. OpenStack uses volumes to boot VMs,
- or to attach volumes to running VMs. OpenStack manages volumes using
+- **Volumes**: Volumes are block devices. OpenStack uses volumes to boot VMs,
+ or to attach volumes to running VMs. OpenStack manages volumes using
Cinder services.
-- **Guest Disks**: Guest disks are guest operating system disks. By default,
+- **Guest Disks**: Guest disks are guest operating system disks. By default,
when you boot a virtual machine, its disk appears as a file on the filesystem
- of the hypervisor (usually under ``/var/lib/nova/instances/<uuid>/``). Prior
- to OpenStack Havana, the only way to boot a VM in Ceph was to use the
+ of the hypervisor (usually under ``/var/lib/nova/instances/<uuid>/``). Prior
+ to OpenStack Havana, the only way to boot a VM in Ceph was to use the
boot-from-volume functionality of Cinder. However, now it is possible to boot
- every virtual machine inside Ceph directly without using Cinder, which is
- advantageous because it allows you to perform maintenance operations easily
- with the live-migration process. Additionally, if your hypervisor dies it is
+ every virtual machine inside Ceph directly without using Cinder, which is
+ advantageous because it allows you to perform maintenance operations easily
+ with the live-migration process. Additionally, if your hypervisor dies it is
also convenient to trigger ``nova evacuate`` and run the virtual machine
elsewhere almost seamlessly.
they do not have to be used together. You may store images in Ceph block devices
while running VMs using a local disk, or vice versa.
-.. important:: Ceph doesn’t support QCOW2 for hosting a virtual machine disk.
- Thus if you want to boot virtual machines in Ceph (ephemeral backend or boot
+.. important:: Ceph doesn’t support QCOW2 for hosting a virtual machine disk.
+ Thus if you want to boot virtual machines in Ceph (ephemeral backend or boot
from volume), the Glance image format must be ``RAW``.
.. tip:: This document describes using Ceph Block Devices with OpenStack Havana.
Save the uuid of the secret for configuring ``nova-compute`` later.
-.. important:: You don't necessarily need the UUID on all the compute nodes.
- However from a platform consistency perspective, it's better to keep the
+.. important:: You don't necessarily need the UUID on all the compute nodes.
+ However from a platform consistency perspective, it's better to keep the
same UUID.
.. _cephx authentication: ../../rados/operations/authentication
Note that this exposes the back end location via Glance's API, so the endpoint
with this option enabled should not be publicly accessible.
+Disable the Glance cache management to avoid images getting cached under ``/var/lib/glance/image-cache/``,
+assuming your configuration file has ``flavor = keystone+cachemanagement``::
+
+ [paste_deploy]
+ flavor = keystone
Configuring Cinder
------------------
OpenStack requires a driver to interact with Ceph block devices. You must also
-specify the pool name for the block device. On your OpenStack node, edit
+specify the pool name for the block device. On your OpenStack node, edit
``/etc/cinder/cinder.conf`` by adding::
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_flatten_volume_from_snapshot=false
rbd_max_clone_depth=5
+ rbd_store_chunk_size=4
+ rados_connect_timeout=-1
glance_api_version=2
-If you're using `cephx authentication`_, also configure the user and uuid of
+If you're using `cephx authentication`_, also configure the user and uuid of
the secret you added to ``libvirt`` as documented earlier::
rbd_user=cinder
Configuring Nova
----------------
-In order to boot all the virtual machines directly into Ceph, you must
+In order to boot all the virtual machines directly into Ceph, you must
configure the ephemeral backend for Nova.
Havana and Icehouse require patches to implement copy-on-write cloning and fix
instance, Nova usually attempts to open the rootfs of the virtual machine.
Then, Nova injects values such as password, ssh keys etc. directly into the
filesystem. However, it is better to rely on the metadata service and
-``cloud-init``.
+``cloud-init``.
On every Compute node, edit ``/etc/nova/nova.conf`` and add::
qemu-img convert -f qcow2 -O raw precise-cloudimg.img precise-cloudimg.raw
When Glance and Cinder are both using Ceph block devices, the image is a
-copy-on-write clone, so it can create a new volume quickly. In the OpenStack
-dashboard, you can boot from that volume by performing the following steps:
+copy-on-write clone, so it can create a new volume quickly. In the OpenStack
+dashboard, you can boot from that volume by performing the following steps:
-#. Launch a new instance.
+#. Launch a new instance.
#. Choose the image associated to the copy-on-write clone.
#. Select 'boot from volume'
#. Select the volume you created.