Browse Source

Sync auto-discovery spec with impl

Mentioning details was added in ipmlementation,
but missing in spec, also fix some nits.

Change-Id: Ic59e3206e2be6dc99e52feecfd129342d866c1b6
Anton Arefiev 3 years ago
parent
commit
bd92b96fe3
1 changed files with 29 additions and 10 deletions
  1. 29
    10
      specs/ironic-node-auto-discovery.rst

+ 29
- 10
specs/ironic-node-auto-discovery.rst View File

@@ -10,15 +10,15 @@ Discover ironic nodes
10 10
 
11 11
 https://bugs.launchpad.net/ironic-inspector/+bug/1524753
12 12
 
13
-This spec proposes auto-discovery Ironic nodes feature.
13
+This spec proposes auto-discovery of Ironic nodes feature.
14 14
 
15 15
 Problem description
16 16
 ===================
17 17
 
18 18
 A large network might consist of hundreds of servers. Keeping track of these
19
-servers can be a time-consuming process. To simplify the addition of new
20
-servers could be done with auto-discovery. Auto-discovery is a process through
21
-which Ironic identifies a resource automatically so it's possible to manage it.
19
+servers can be a time-consuming process. Auto-discovery could simplify the
20
+addition of new servers into Ironic. It will identifies a resource
21
+automatically so it's possible to manage it.
22 22
 For now, Ironic is unable to automatically detect nodes. Operators have to
23 23
 create nodes manually and provide driver info for them.
24 24
 
@@ -26,10 +26,16 @@ Proposed change
26 26
 ===============
27 27
 
28 28
 Nodes that don't exist in the inspector node cache may still be booted and
29
-return inspection information to process, ``node-not-found-hook`` allows to
30
-handle that information. For discovery new implementation called
31
-``enroll_node_not_found_hook`` should be specified. It will create a node
32
-with ``fake`` driver.
29
+return inspection information to process, the ``node-not-found-hook`` hook
30
+is run by the inspector when it receives information from a node it can not
31
+identify. For auto-discovery a new hook that will plugin at this point will
32
+be written, called ``enroll``.
33
+
34
+The hook will enroll the unknown node into Ironic with the ``fake`` driver
35
+(this driver is a configurable option, set ``enroll_node_driver`` in the
36
+configuration file allows to change the Ironic driver). Also the ``enroll``
37
+hook will set the ``ipmi_address`` property on the new node, if its available
38
+in the introspection data we received.
33 39
 
34 40
 To customize discovery, introspection rules will be used, it  allows operators
35 41
 to control the discovery process. A simple rule to match all new nodes and
@@ -62,9 +68,9 @@ enroll them in Ironic with the ``agent_ipmitool`` driver will looks like::
62 68
     ]
63 69
 
64 70
     "conditions": [
65
-        {'op': 'eq', 'field': 'node://driver_info/deploy_ramdisk',
71
+        {'op': 'eq', 'field': 'node://driver_info.deploy_ramdisk',
66 72
          'multiple': 'all', 'value': None},
67
-        {'op': 'eq', 'field': 'node://driver_info/deploy_kernel',
73
+        {'op': 'eq', 'field': 'node://driver_info.deploy_kernel',
68 74
          'multiple': 'all', 'value': None}
69 75
     ]
70 76
 
@@ -94,6 +100,19 @@ Rule changes:
94 100
         {data[ipmi_address]} - ``ipmi_address`` attribute from introspection
95 101
                                data will be fetched.
96 102
 
103
+All nodes discovered and enrolled via the ``enroll`` hook, will contain an
104
+``auto_discovered`` flag in the introspection data, this flag makes it
105
+possible to distinguish between manually enrolled nodes and auto-discovered
106
+nodes in the introspection rules using the rule condition ``eq``::
107
+
108
+    "description": "Enroll auto-discovered nodes with fake driver",
109
+    "actions": [
110
+        {'action': 'set-attribute', 'path': 'driver', 'value': 'fake'}
111
+    ]
112
+    "conditions": [
113
+        {'op': 'eq', 'field': 'data://auto_discovered', 'value': True}
114
+    ]
115
+
97 116
 Creating new actions will allow the node info to be consumed in different
98 117
 ways. Proposed approach is pretty flexible, so more sophisticated conditions
99 118
 and actions could be added here based on operators specifications.

Loading…
Cancel
Save