glance/doc/source/configuring.rst
2011-04-26 16:10:33 -07:00

7.0 KiB

Configuring Glance

In addition to this documentation page, you can check the etc/glance.conf.sample sample configuration file distributed with Glance for an example configuration file with detailed comments on what each options does.

Common Configuration Options in Glance

Glance has a few command-line options that are common to all Glance programs:

  • --verbose

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.

  • --debug

Optional. Default: False

Can be specified on the command line and in configuration files.

Turns on the DEBUG level in logging.

  • --config-file=PATH

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:

  • ./glance.conf
  • ~/glance.conf
  • ~/.glance/glance.conf
  • /etc/glance/glance.conf
  • /etc/glance.conf

Configuring Logging in Glance

There are a number of configuration options in Glance that control how Glance servers log messages.

  • --log-config=PATH

Optional. Default: None

Specified on the command line only.

Takes a path to a configuration file to use for configuring logging.

Logging Options Available in glance.conf

You will want to place the different logging options in each of the API and registry application sections in your glance.conf. As an example, you might do the following:

[app:glance-api]
... other options ...
log_file = /var/log/glance/api.log

[app:glance-registry]
... other options ...
log_file = /var/log/glance/registry.log
  • log_file

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.

  • log_dir

The filepath of the directory to use for log files. If not specified (the default) the log_file is used as an absolute filepath.

  • log_date_format

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.

Configuring Glance Storage Backends

There are a number of configuration options in Glance that control how Glance stores disk images. These configuration options are specified in the glance.conf config file in the section [app:glance-api].

  • default_store=STORE

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

  • filesystem_store_datadir=PATH

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.

  • swift_store_auth_address=URL

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.

  • swift_store_user=USER

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.

  • swift_store_key=KEY

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.

  • swift_store_container=CONTAINER

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.

  • swift_store_create_container_on_put

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.

Configuring the Glance Registry

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.conf config file in the section [app:glance-registry].

  • sql_connection=CONNECTION_STRING (--sql-connection when specified on command line)

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.

  • sql_timeout=SECONDS on command line)

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.