Glance has a number of options that you can use to configure the Glance API server, the Glance Registry server, and the various storage backends that Glance can use to store images.
Most configuration is done via configuration files, with the Glance API server and Glance Registry server using separate configuration files.
When starting up a Glance server, you can specify the configuration file to use (see the documentation on controller Glance servers). If you do not specify a configuration file, Glance will look in the following directories for a configuration file, in order:
The Glance API server configuration file should be named glance-api.conf. Similarly, the Glance Registry server configuration file should be named glance-registry.conf. If you installed Glance via your operating system’s package management system, it is likely that you will have sample configuration files installed in /etc/glance.
In addition to this documentation page, you can check the etc/glance-api.conf and etc/glance-registry.conf sample configuration files distributed with Glance for example configuration files for each server application with detailed comments on what each options does.
Glance has a few command-line options that are common to all Glance programs:
Optional. Default: False
Can be specified on the command line and in configuration files.
Turns on the INFO level in logging and prints more verbose command-line interface printouts.
Optional. Default: False
Can be specified on the command line and in configuration files.
Turns on the DEBUG level in logging.
Optional. Default: None
Specified on the command line only.
Takes a path to a configuration file to use when running the program. If this CLI option is not specified, then we check to see if the first argument is a file. If it is, then we try to use that as the configuration file. If there is no file or there were no arguments, we search for a configuration file in the following order:
The filename that is searched for depends on the server application name. So, if you are starting up the API server, glance-api.conf is searched for, otherwise glance-registry.conf.
There are a number of configuration options in Glance that control how Glance servers log messages.
Optional. Default: None
Specified on the command line only.
Takes a path to a configuration file to use for configuring logging.
You will want to place the different logging options in the [DEFAULT] section in your application configuration file. As an example, you might do the following for the API server, in a configuration file called etc/glance-api.conf:
[DEFAULT]
log_file = /var/log/glance/api.log
The filepath of the file to use for logging messages from Glance’s servers. If missing, the default is to output messages to stdout, so if you are running Glance servers in a daemon mode (using glance-control) you should make sure that the log_file option is set appropriately.
The filepath of the directory to use for log files. If not specified (the default) the log_file is used as an absolute filepath.
The format string for timestamps in the log output.
Defaults to %Y-%m-%d %H:%M:%S. See the logging module documentation for more information on setting this format string.
There are a number of configuration options in Glance that control how Glance stores disk images. These configuration options are specified in the glance-api.conf config file in the section [DEFAULT].
Optional. Default: file
Can only be specified in configuration files.
Sets the storage backend to use by default when storing images in Glance. Available options for this option are (file, swift, or s3).
Optional. Default: /var/lib/glance/images/
Can only be specified in configuration files.
This option is specific to the filesystem storage backend.
Sets the path where the filesystem storage backend write disk images. Note that the filesystem storage backend will attempt to create this directory if it does not exist. Ensure that the user that glance-api runs under has write permissions to this directory.
Required when using the Swift storage backend.
Can only be specified in configuration files.
This option is specific to the Swift storage backend.
Sets the authentication URL supplied to Swift when making calls to its storage system. For more information about the Swift authentication system, please see the Swift auth documentation and the overview of Swift authentication.
Required when using the Swift storage backend.
Can only be specified in configuration files.
This option is specific to the Swift storage backend.
Sets the user to authenticate against the swift_store_auth_address with.
Required when using the Swift storage backend.
Can only be specified in configuration files.
This option is specific to the Swift storage backend.
Sets the authentication key to authenticate against the swift_store_auth_address with for the user swift_store_user.
Optional. Default: glance
Can only be specified in configuration files.
This option is specific to the Swift storage backend.
Sets the name of the container to use for Glance images in Swift.
Optional. Default: False
Can only be specified in configuration files.
This option is specific to the Swift storage backend.
If true, Glance will attempt to create the container swift_store_container if it does not exist.
Optional. Default: 5120
Can only be specified in configuration files.
This option is specific to the Swift storage backend.
What size, in MB, should Glance start chunking image files and do a large object manifest in Swift? By default, this is the maximum object size in Swift, which is 5GB
Optional. Default: 200
Can only be specified in configuration files.
This option is specific to the Swift storage backend.
When doing a large object manifest, what size, in MB, should Glance write chunks to Swift? This amount of data is written to a temporary disk buffer during the process of chunking the image file, and the default is 200MB
Required when using the S3 storage backend.
Can only be specified in configuration files.
This option is specific to the S3 storage backend.
Default: s3.amazonaws.com
Sets the main service URL supplied to S3 when making calls to its storage system. For more information about the S3 authentication system, please see the S3 documentation
Required when using the S3 storage backend.
Can only be specified in configuration files.
This option is specific to the S3 storage backend.
Sets the access key to authenticate against the s3_store_host with.
You should set this to your 20-character Amazon AWS access key.
Required when using the S3 storage backend.
Can only be specified in configuration files.
This option is specific to the S3 storage backend.
Sets the secret key to authenticate against the s3_store_host with for the access key s3_store_access_key.
You should set this to your 40-character Amazon AWS secret key.
Required when using the S3 storage backend.
Can only be specified in configuration files.
This option is specific to the S3 storage backend.
Sets the name of the bucket to use for Glance images in S3.
Note that the namespace for S3 buckets is global, and therefore you must use a name for the bucket that is unique. It is recommended that you use a combination of your AWS access key, lowercased with “glance”.
For instance if your Amazon AWS access key is:
ABCDEFGHIJKLMNOPQRST
then make your bucket value be:
abcdefghijklmnopqrstglance
Optional. Default: False
Can only be specified in configuration files.
This option is specific to the S3 storage backend.
If true, Glance will attempt to create the bucket s3_store_bucket if it does not exist.
Glance ships with a default, reference implementation registry server. There are a number of configuration options in Glance that control how this registry server operates. These configuration options are specified in the glance-registry.conf config file in the section [DEFAULT].
Optional. Default: None
Can be specified in configuration files. Can also be specified on the command-line for the glance-manage program.
Sets the SQLAlchemy connection string to use when connecting to the registry database. Please see the documentation for SQLAlchemy connection strings online.
Optional. Default: 3600
Can only be specified in configuration files.
Sets the number of seconds after which SQLAlchemy should reconnect to the datastore if no activity has been made on the connection.
Glance can optionally generate notifications to be logged or sent to a RabbitMQ queue. The configuration options are specified in the glance-api.conf config file in the section [DEFAULT].
Optional. Default: noop
Sets the strategy used for notifications. Options are logging, rabbit and noop. For more information Glance notifications
Optional. Default: localhost
Host to connect to when using rabbit strategy.
Optional. Default: 5672
Port to connect to when using rabbit strategy.
Optional. Default: false
Boolean to use SSL for connecting when using rabbit strategy.
Optional. Default: guest
Userid to use for connection when using rabbit strategy.
Optional. Default: guest
Password to use for connection when using rabbit strategy.
Optional. Default: /
Virtual host to use for connection when using rabbit strategy.
Optional. Default: glance_notifications
Topic to use for connection when using rabbit strategy.