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

Configuring OpenStack Image Service with OpenStack Object Storage

By default, images are stored as files in the /var/lib/glance/images/ directory. However, OpenStack Image Service can be configured to use OpenStack Object Storage (Swift) for storing images, as well as other backend storage such as Ceph and GlusterFS. In this recipe, we will go through the steps required to configure OpenStack Image service (Glance) to use Object Storage service (Swift).

Getting ready

To begin with, ensure you're logged in to our OpenStack Controller host or the host that is running OpenStack Image Service.

To log in to our OpenStack Controller host that was created using Vagrant, issue the following command:

vagrant ssh controller

How to do it...

To configure OpenStack Image Service to use OpenStack Object Storage, carry out the following steps:

  1. We first edit the /etc/glance/glance-api.conf file to notify Glance that we will use Swift instead of the default filesystem by editing the following line under the [DEFAULT] section:
    [DEFAULT]
    default_store = swift
    
  2. We then edit the [glance_store] section in the same file to configure Swift:
    [glance_store]
    stores = glance.store.filesystem.Store,
             glance.store.http.Store,
             glance.store.swift.Store
    swift_store_auth_version = 2
    swift_store_auth_address = https://192.168.100.200:5000/v2.0/
    swift_store_user = service:glance
    swift_store_key = glance
    swift_store_container = glance
    swift_store_create_container_on_put = True
    swift_store_large_object_size = 5120
    swift_store_large_object_chunk_size = 200
    swift_enable_snet = False
    swift_store_auth_insecure = True

    Tip

    We are using swift_store_auth_insecure = True because we are using self-signed certificates for our SSL Keystone implementation. Adjust this to suit your environment.

  3. Then, we restart the two OpenStack Image Service processes to pick up the changes:
    sudo restart glance-api
    sudo restart glance-registry
    

How it works...

OpenStack Image Service can be configured to use several different backend for storing images, such as Ceph, OpenStack Object Storage, and raw disk. Once Object Storage is configured as a backend, images will be uploaded to Swift instead of being stored locally. Check Chapter 5, Swift – OpenStack Object Storage on configuring and using Object Storage.

主站蜘蛛池模板: 金华市| 公主岭市| 吴旗县| 黔西县| 榕江县| 监利县| 筠连县| 博野县| 宜州市| 应用必备| 始兴县| 乌鲁木齐市| 西安市| 保靖县| 屯门区| 上杭县| 巫溪县| 乌什县| 巨野县| 淅川县| 黄大仙区| 佳木斯市| 泰兴市| 台前县| 新邵县| 玛纳斯县| 温宿县| 吉隆县| 扎赉特旗| 历史| 安西县| 安乡县| 海阳市| 遂宁市| 渑池县| 图片| 工布江达县| 贺州市| 浦城县| 台中县| 辉县市|