nova/doc/source/reference/services.rst
jichenjc 73b6598d41 Enhance doc for nova services
make some modifications to nova db reference and add some
basic information about some functions such as nova.service.start

Change-Id: I70c1a5eac91ab61ecd4ebc1c8ed95e4e4ba6b9fc
2017-08-31 08:30:48 +08:00

2.3 KiB

Services, Managers and Drivers

The responsibilities of Services, Managers, and Drivers, can be a bit confusing to people that are new to nova. This document attempts to outline the division of responsibilities to make understanding the system a little bit easier.

Currently, Managers and Drivers are specified by flags and loaded using utils.load_object(). This method allows for them to be implemented as singletons, classes, modules or objects. As long as the path specified by the flag leads to an object (or a callable that returns an object) that responds to getattr, it should work as a manager or driver.

The nova.service Module

nova.service

The nova.manager Module

nova.manager

Implementation-Specific Drivers

A manager will generally load a driver for some of its tasks. The driver is responsible for specific implementation details. Anything running shell commands on a host, or dealing with other non-python code should probably be happening in a driver.

Drivers should not touch the database as the database management is done inside nova-conductor.

It usually makes sense to define an Abstract Base Class for the specific driver (i.e. VolumeDriver), to define the methods that a different driver would need to implement.