官术网_书友最值得收藏!

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 keystone_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.

主站蜘蛛池模板: 特克斯县| 额济纳旗| 嵩明县| 监利县| 大庆市| 曲沃县| 西平县| 军事| 定边县| 兴文县| 汤原县| 阳山县| 会昌县| 界首市| 米泉市| 安仁县| 东丽区| 东安县| 林周县| 嘉荫县| 南康市| 紫金县| 周口市| 恩施市| 米脂县| 江华| 宜阳县| 招远市| 保山市| 昌江| 牡丹江市| 襄樊市| 宜宾县| 阳谷县| 临澧县| 观塘区| 巍山| 昭苏县| 泸水县| 德安县| 怀来县|