Ask Your Question

where does nova.conf comes in for nova services?

asked 2015-03-04 21:48:22 -0600

Waid gravatar image

When I read the source code of nova-scheduler, I don't find the entry where the nova.con comes in. Here is my searching path:

/etc/init.d/nova-scheduler : nothing, just run nova-scheduler(in /usr/bin/nova-scheduler)

/usr/bin/nova-scheduler : run nova.cmd.scheduler main()


Well, I guess this code is where nova.conf comes in. And the most probably entry is:


if we assign --config-file=/etc/nova/nova.conf option when running nova-scheduler, then this is the entry where nova.conf comes in manually

The reason why I emphasise "manually" is because when we run the service, we don't need to assign such option.(We can see the openstack installation guide of with version icehouse, that when executing the nova services, we just only run:service nova-xxxx restart)

Well, this is not a big deal since when creating nova services, all of the options has the default values:(for instance, /usr/share/pyshared/nova/, we can see that there are settings of default options at the beginning of the file). But even if so, then that seems there are no entry of nova.conf for the nova services. Then why do we need it?

Anyone has any idea?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-03-05 19:53:46 -0600

Waid gravatar image

updated 2015-03-05 19:55:02 -0600

Got the answer: if we run the nova services without assigning --config-file=/etc/nova/nova.conf like:

service nova-scheduler start

Then in /usr/share/pyshared/nova/cmd/ will run with nova.conf.

Actually yes, the entry is config.parse_args(sys.argv) in, lets trace parse_args() in /usr/share/pyshared/nova/


Well if we don't manually assign default_config_file when running nova service, then this value is None. So let's find out the entry of nova.con in cfg.CONF:


 CONF = ConfigOpts()

let's see the caller in ConfigOpts(), first note that we have this pre_setup to assign the config_file(s):

    prog, default_config_files = self._pre_setup(project,

We can find that the nova.conf enters in:

    if default_config_files is None:
        default_config_files = find_config_files(project, prog)

If we trace the find_config_file, we can see that it will find the nova.conf in the directories:

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2015-03-04 21:48:22 -0600

Seen: 227 times

Last updated: Mar 05 '15