Registers all store modules and all schemes from the given configuration object.
conf – A oslo_config (or compatible) object
reserved_stores – A list of stores for the consuming service’s
internal use. The list must be the same
format as the enabled_backends
configuration
setting. The default value is None
The number of stores configured
glance_store.exceptions.BackendException
Configuring Multiple Backends
The backends to be configured are expected to be found in the
enabled_backends
configuration variable in the DEFAULT group
of the object. The format for the variable is a dictionary of
key:value pairs where the key is an arbitrary store identifier
and the value is the store type identifier for the store.
The type identifiers must be defined in the [entry points]
section of the glance_store setup.cfg
file as values for
the glance_store.drivers
configuration. (See the default
setup.cfg
file for an example.) The store type identifiers
for the currently supported drivers are already defined in the file.
Thus an example value for enabled_backends
is:
{'store_one': 'http', 'store_two': 'file', 'store_three': 'rbd'}
The reserved_stores
parameter, if included, must have the same
format. There is no difference between the enabled_backends
and
reserved_stores
from the glance_store point of view: the reserved
stores are a convenience for the consuming service, which may wish
to handle the two sets of stores differently.
The Default Store
If you wish to set a default store, its store identifier should be
defined as the value of the default_backend
configuration option
in the glance_store
group of the conf
parameter. The store
identifier, or course, should be specified as one of the keys in the
enabled_backends
dict. It is recommended that a default store
be set.
Configuring Individual Backends
To configure each store mentioned in the enabled_backends
configuration option, you must define an option group with the
same name as the store identifier. The options defined for that
backend will depend upon the store type; consult the documentation
for the appropriate backend driver to determine what these are.
For example, given the enabled_backends
example above, you
would put the following in the configuration file that loads the
conf
object:
[DEFAULT]
enabled_backends = store_one:rbd,store_two:file,store_three:http
[store_one]
store_description = "A human-readable string aimed at end users"
rbd_store_chunk_size = 8
rbd_store_pool = images
rbd_store_user = admin
rbd_store_ceph_conf = /etc/ceph/ceph.conf
[store_two]
store_description = "Human-readable description of this store"
filesystem_store_datadir = /opt/stack/data/glance/store_two
[store_three]
store_description = "A read-only store"
https_ca_certificates_file = /opt/stack/certs/gs.cert
[glance_store]
default_backend = store_two
The store_description
options may be used by a consuming service.
As recommended above, this file also defines a default backend.
Removes chunks of data from backend specified by uri.
Yields chunks of data from backend specified by uri.
Returns list of known schemes.
Retrieves image size from backend specified by uri.
Determine backing store from identifier.
Given a store identifier, return the appropriate store object for handling that scheme.
A wrapper around a call to each stores add() method.
This gives glance a common place to check the output.
image_id – The image add to which data is added
data – The data to be stored
size – The length of the data in bytes
store – The store to which the data is being added
context – The request context
verifier – An object used to verify signatures for images
backend – Name of the backend to store the image
The url location of the file, the size amount of data, the checksum of the data the storage systems metadata dictionary for the location
A wrapper around a call to each store’s add() method that requires a hashing_algo identifier and returns a 5-tuple including the “multihash” computed using the specified hashing_algo. (This is an enhanced version of store_add_to_backend(), which is left as-is for backward compatibility.)
image_id – The image add to which data is added
data – The data to be stored
size – The length of the data in bytes
store – The store to which the data is being added
hashing_algo – A hashlib algorithm identifier (string)
context – The request context
verifier – An object used to verify signatures for images
The url location of the file, the size amount of data, the checksum of the data, the multihash of the data, the storage system’s metadata dictionary for the location
glance_store.exceptions.BackendException
glance_store.exceptions.UnknownHashingAlgo
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.