How to do it…

This recipe talks about configuring the Glance component of OpenStack to store virtual machine images on Ceph RBD:

  1. Log in to os-node1, which is our Glance node, and edit /etc/glance/glance-api.conf for the following changes:
    1. Under the [DEFAULT] section, make sure that the following lines are present:
                default_store=rbd
show_image_direct_url=True
    1. Execute the following command to verify entries:
                # cat /etc/glance/glance-api.conf | 
egrep -i "default_store|image_direct"
    1. Under the [glance_store] section, make sure that the following lines are present under RBD store options:
              stores = rbd
rbd_store_ceph_conf=/etc/ceph/ceph.conf
rbd_store_user=glance
rbd_store_pool=images
rbd_store_chunk_size=8
    1. Execute the following command to verify the previous entries:
              # cat /etc/glance/glance-api.conf | 
egrep -v "#|default" | grep -i rbd
  1. Restart the OpenStack Glance services:
        # service openstack-glance-api restart
  1. Source the keystonerc_admin file for OpenStack and list the Glance images:
        # source /root/keystonerc_admin
# glance image-list
  1. Download the cirros image from the internet, which will later be stored in Ceph:
      # wget http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-
x86_64-disk.img
  1. Add a new Glance image using the following command:
        # glance image-create --name cirros_image --is-public=true 
--disk-format=qcow2 --container-format=bare
< cirros-0.3.1-x86_64-disk.img
  1. List the Glance images using the following command; you will notice there are now two Glance images:
        # glance image-list
  1. You can verify that the new image is stored in Ceph by querying the image ID in the Ceph images pool:
        # rbd -p images ls --id glance
# rbd info images/<image name> --id glance
  1. Since we have configured Glance to use Ceph for its default storage, all the Glance images will now be stored in Ceph. You can also try creating images from the OpenStack horizon dashboard:

 

  1. Finally, we will try to launch an instance using the image that we have created earlier:
# nova boot --flavor 1 --image b1c39f06-5330-4b04-ae0f-0b1d5e901e5b vm1
  1. You can check with the Nova list command:
While you are adding new Glance images or creating an instance from the Glance image stored on Ceph, you can check the IO on the Ceph cluster by monitoring it and using the # watch ceph -s command.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset