This patch explains how to choose an alternative Glance default store as well as how to configure additional stores. Closes-bug: 1531309 Change-Id: Id277a0f5909d64faedf04cfecc46e04ec2dc3587
4.5 KiB
Home OpenStack-Ansible Installation Guide
Configuring the Image Service
In an all-in-one deployment with a single infrastructure node, the Image Service uses the local file system on the target host to store images. When deploying production clouds we recommend backing Glance with a swift backend or some form or another of shared storage.
Configuring default and additional stores
OpenStack-Ansible provides two configurations for controlling where the Image Service stores files: the default store and additional stores. As mentioned in the previous section, the Image Service stores images in file-based storage by default. Two additional stores, http and cinder, are also enabled by default.
Deployers can choose alternative default stores, as shown in the swift example in the next section, and deployers can choose alternative additional stores. For example, a deployer that uses Ceph may configure the following Ansible variables:
glance_default_store = rbd
glance_additional_stores:
- swift
- http
- cinderThe configuration above will configure the Image Service to use rbd (Ceph) by default, but the swift, http and cinder stores will also be enabled in the Image Service configuration files.
Storing images in Cloud Files
The following procedure describes how to modify the
/etc/openstack_deploy/user_variables.yml file to enable
Cloud Files usage.
Change the default store to use Object Storage (swift), the underlying architecture of Cloud Files:
glance_default_store: swiftSet the appropriate authentication URL and version:
glance_swift_store_auth_version: 2 glance_swift_store_auth_address: https://127.0.0.1/v2.0Set the swift account credentials (see Special Considerations at the bottom of this page):
# Replace this capitalized variables with actual data. glance_swift_store_user: GLANCE_SWIFT_TENANT:GLANCE_SWIFT_USER glance_swift_store_key: SWIFT_PASSWORD_OR_KEYChange the
glance_swift_store_endpoint_typefrom the defaultinternalURLsettings topublicURLif needed.glance_swift_store_endpoint_type: publicURLDefine the store name:
glance_swift_store_container: STORE_NAMEReplace
STORE_NAMEwith the container name in swift to be used for storing images. If the container doesn't exist, it will be automatically created.Define the store region:
glance_swift_store_region: STORE_REGIONReplace
STORE_REGIONif needed.(Optional) Set the paste deploy flavor:
glance_flavor: GLANCE_FLAVORBy default, the Image Service uses caching and authenticates with the Identity service. The default maximum size of the image cache is 10 GB. The default Image Service container size is 12 GB. In some configurations, the Image Service might attempt to cache an image which exceeds the available disk space. If necessary, you can disable caching. For example, to use Identity without caching, replace
GLANCE_FLAVORwithkeystone:glance_flavor: keystoneOr, to disable both authentication and caching, set
GLANCE_FLAVORto no value:glance_flavor:This option is set by default to use authentication and cache management in the
playbooks/roles/os_glance/defaults/main.ymlfile. To override the default behavior, setglance_flavorto a different value in/etc/openstack_deploy/user_variables.yml.The possible values for
GLANCE_FLAVORare:- (Nothing)
cachingcachemanagementkeystonekeystone+cachingkeystone+cachemanagement(default)trusted-authtrusted-auth+cachemanagement
Special Considerations
If the swift password or key contains a dollar sign ($),
it must be escaped with an additional dollar sign ($$). For
example, a password of super$ecure would need to be entered
as super$$ecure. This is needed due to the way oslo.config
formats strings.