From fa8cc62734118b1731114167b7ffe47c29b3c9dd Mon Sep 17 00:00:00 2001 From: Devananda van der Veen Date: Sun, 26 May 2013 08:46:54 -0700 Subject: [PATCH] Minor doc change for manager and resorce_manager. Change-Id: If24fe5bf637493918d9f1faf113f1d356801dc73 --- ironic/manager/manager.py | 31 ++++++++++++++++++++---------- ironic/manager/resource_manager.py | 14 ++++++++------ 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ironic/manager/manager.py b/ironic/manager/manager.py index eaa96fd804..c0fb63db4e 100644 --- a/ironic/manager/manager.py +++ b/ironic/manager/manager.py @@ -15,6 +15,26 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +"""Handles all activity related to bare-metal deployments. + +A single instance of :py:class:`ironic.manager.manager.ManagerService` is +created within the *ironic-manager* process, and is responsible for performing +all actions on bare metal resources (Chassis, Nodes, and Ports). Commands are +received via RPC calls. The manager service also performs periodic tasks, eg. +to monitor the status of active deployments. + +Drivers are loaded via entrypoints, by the +:py:class:`ironic.manager.resource_manager.NodeManager` class. Each driver is +instantiated once and a ref to that singleton is included in each resource +manager, depending on the node's configuration. In this way, a single +ManagerService may use multiple drivers, and manage heterogeneous hardware. + +When multiple :py:class:`ManagerService` are run on different hosts, they are +all active and cooperatively manage all nodes in the deplyment. Nodes are +locked by each manager when performing actions which change the state of that +node; these locks are represented by the +:py:class:`ironic.manager.task_manager.TaskManager` class. +""" from ironic.common import service from ironic.manager import task_manager @@ -24,16 +44,7 @@ LOG = log.getLogger(__name__) class ManagerService(service.PeriodicService): - """Ironic Manager Service. - - A single instance of this class is created within the ironic-manager - process. It is responsible for performing all actions on Chassis, Nodes, - and Ports, and tracks these actions via Trackers. - - Tracker instances are created on-demand and destroyed when the - operation(s) are complete. Persistent state is stored in a database, - which is also used to coordinate locks between ManagerServices. - """ + """Ironic Manager service main class.""" def __init__(self, host, topic): super(ManagerService, self).__init__(host, topic) diff --git a/ironic/manager/resource_manager.py b/ironic/manager/resource_manager.py index 739cb34578..6ecfa301a0 100644 --- a/ironic/manager/resource_manager.py +++ b/ironic/manager/resource_manager.py @@ -17,14 +17,16 @@ # under the License. """ -A NodeManager instance holds the data and drivers for a distinct node. +Hold the data and drivers for a distinct node within a given context. -Each NodeManager instance is a semi-singleton, keyed by the node id, and -contains references to the TaskManagers which called it. When no more -TaskManagers reference a given NodeManager, it is automatically destroyed. +Each :py:class:`ironic.manager.resource_manager.NodeManager` instance is a +semi-singleton, keyed by the node id. It contains references to all +:py:class:`ironic.manager.task_manager.TaskManager` which called it. When no +more TaskManagers reference a given NodeManager, it is automatically destroyed. -Do not request a NodeManager directly; instead, you should use a -TaskManager to manage the resource in a given context. +Do not request a NodeManager directly; instead, you should use a TaskManager to +manage the resource in a given context. See the documentation on TaskManager +for an example. """ from stevedore import dispatch