The Compute service supports a large number of configuration options. These options
are specified in a configuration file whose default location in
/etc/nova/nova.conf
.
The configuration file is in INI file format, with options specified as key=value
pairs, grouped into sections. Almost all of the configuration options are in the
DEFAULT
section. Here's a brief
example:
[DEFAULT] debug=true verbose=true [trusted_computing] server=10.3.4.2
Each configuration option has an associated type that indicates what values can be set. The supported option types are as follows:
- BoolOpt
Boolean option. Value must be either
true
orfalse
. Example:debug=false
- StrOpt
String option. Value is an arbitrary string. Example:
my_ip=10.0.0.1
- IntOption
Integer option. Value must be an integer. Example:
glance_port=9292
- MultiStrOpt
String option. Same as StrOpt, except that it can be declared multiple times to indicate multiple values. Example:
ldap_dns_servers=dns1.example.org ldap_dns_servers=dns2.example.org
- ListOpt
List option. Value is a list of arbitrary strings separated by commas. Example:
enabled_apis=ec2,osapi_compute,metadata
- FloatOpt
Floating-point option. Value must be a floating-point number. Example:
ram_allocation_ratio=1.5
Important | |
---|---|
Nova options should not be quoted. |
Configuration options are grouped by section. The Compute config file supports the following sections.
[DEFAULT]
Almost all of the configuration options are organized into this section. If the documentation for a configuration option does not specify its section, assume that it should be placed in this one.
[cells]
The
cells
section is used for options for configuring cells functionality. See the Cells section of the OpenStack Compute Admin Manual for more details.[baremetal]
This section is used for options that relate to the baremetal hypervisor driver.
[conductor]
The
conductor
section is used for options for configuring the nova-conductor service.[trusted_computing]
The
trusted_computing
section is used for options that relate to the trusted computing pools functionality. Options in this section describe how to connect to a remote attestation service.
The configuration file supports variable substitution. Once a configuration option is
set, it can be referenced in later configuration values when preceded by
$
. Consider the following example where my_ip
is defined and then $my_ip
is used as a
variable.
my_ip=10.2.3.4 glance_host=$my_ip metadata_host=$my_ip
If you need a value to contain the $
symbol, escape it by doing
$$
. For example, if your LDAP DNS password was
$xkj432
, you would
do:
ldap_dns_password=$$xkj432
The Compute code uses Python's string.Template.safe_substitute()
method to implement variable substitution. For more details on how variable substitution
is resolved, see Python
documentation on template strings and PEP 292.
To include whitespace in a configuration value, use a quoted string. For example:
ldap_dns_passsword='a password with spaces'
The configuration file is loaded by all of the nova-* services, as well as the
nova-manage command-line tool. To specify an alternate location
for the configuration file, pass the --config-file
argument when starting a
nova-* service or calling nova-manage./path/to/nova.conf