summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-03 11:34:12 +0000
committerGerrit Code Review <review@openstack.org>2016-02-03 11:34:12 +0000
commitdaf85dcc628e34a5f88d7dcc384daeea91cdb77d (patch)
tree0e665b787ccd2378f994dc6db6c0bde71aeadba2
parent73d1517e3a7e23e9e249b03866787ba4103c51ad (diff)
parent1ca7c413c36179a59c8a321143363478f0d4e093 (diff)
Merge "Ironic node auto-discovery"
-rw-r--r--specs/ironic-node-auto-discovery.rst172
1 files changed, 172 insertions, 0 deletions
diff --git a/specs/ironic-node-auto-discovery.rst b/specs/ironic-node-auto-discovery.rst
new file mode 100644
index 0000000..de1749d
--- /dev/null
+++ b/specs/ironic-node-auto-discovery.rst
@@ -0,0 +1,172 @@
1..
2 This work is licensed under a Creative Commons Attribution 3.0 Unported
3 License.
4
5 http://creativecommons.org/licenses/by/3.0/legalcode
6
7=====================
8Discover ironic nodes
9=====================
10
11https://bugs.launchpad.net/ironic-inspector/+bug/1524753
12
13This spec proposes auto-discovery Ironic nodes feature.
14
15Problem description
16===================
17
18A large network might consist of hundreds of servers. Keeping track of these
19servers can be a time-consuming process. To simplify the addition of new
20servers could be done with auto-discovery. Auto-discovery is a process through
21which Ironic identifies a resource automatically so it's possible to manage it.
22For now, Ironic is unable to automatically detect nodes. Operators have to
23create nodes manually and provide driver info for them.
24
25Proposed change
26===============
27
28Nodes that don't exist in the inspector node cache may still be booted and
29return inspection information to process, ``node-not-found-hook`` allows to
30handle that information. For discovery new implementation called
31``enroll_node_not_found_hook`` should be specified. It will create a node
32with ``fake`` driver.
33
34To customize discovery, introspection rules will be used, it allows operators
35to control the discovery process. A simple rule to match all new nodes and
36enroll them in Ironic with the ``agent_ipmitool`` driver will looks like::
37
38 "description": "Set IPMI driver_info if no address or credentials",
39 "actions": [
40 {'action': 'set-attribute', 'path': 'driver', 'value': 'agent_ipmitool'},
41 {'action': 'set-attribute', 'path': 'driver_info/ipmi_address',
42 'value': '{data[ipmi_address]}'},
43 {'action': 'set-attribute', 'path': 'driver_info/ipmi_username',
44 'value': 'username'},
45 {'action': 'set-attribute', 'path': 'driver_info/ipmi_password',
46 'value': 'password'}
47 ]
48 "conditions": [
49 {'op': 'eq', 'field': 'node://driver_info/ipmi_password',
50 'multiple': 'all', 'value': None},
51 {'op': 'eq', 'field': 'node://driver_info/ipmi_username',
52 'multiple': 'all', 'value': None}
53 ]
54
55
56 "description": "Set deploy info if not already set on node",
57 "actions": [
58 {'action': 'set-attribute', 'path': 'driver_info/deploy_kernel',
59 'value': '<glance uuid>'},
60 {'action': 'set-attribute', 'path': 'driver_info/deploy_ramdisk',
61 'value': '<glance uuid>'},
62 ]
63
64 "conditions": [
65 {'op': 'eq', 'field': 'node://driver_info/deploy_ramdisk',
66 'multiple': 'all', 'value': None},
67 {'op': 'eq', 'field': 'node://driver_info/deploy_kernel',
68 'multiple': 'all', 'value': None}
69 ]
70
71Rule changes:
72
73 - condition changes: extend field ``field``, for now it's represent
74 a `JSON path`_ to the field in the introspection data to use in comparison.
75 But sometimes it's needed to compare data from node(``deploy_ramdisk``
76 compared with None in example), so to get data from node, ``node://``
77 and ``data://`` scheme proposed to add. It will allow to fetch data using
78 path from the nodes info and introspection(``data://`` is default scheme
79 to keep backward compatibility)::
80
81 node://driver_info.deploy_ramdisk - ``deploy_ramdisk`` attribute from
82 node's driver_info.
83 data://memory_mb - ``memory_mb`` attribute from
84 introspection data.
85
86 - actions changes: for now it's impossible to assign values from inspection
87 data to node, to address this disadvantage it's proposed to add standard
88 python formatting `Python format`_ to ``value`` field.
89 For example, ``set-attribute`` sets an attribute on an Ironic node. It's
90 required the ``path`` field, which is the path to the attribute in Ironic,
91 e.g.``driver_info/ipmi_username``, and a ``value`` to set. Where ``value``
92 is simple value, which assigned to path::
93
94 {data[ipmi_address]} - ``ipmi_address`` attribute from introspection
95 data will be fetched.
96
97Creating new actions will allow the node info to be consumed in different
98ways. Proposed approach is pretty flexible, so more sophisticated conditions
99and actions could be added here based on operators specifications.
100
101Operator steps for achieve auto-discovery would be following:
102 * Operator creates a new rule or uses the predefined ``discovery rule``;
103 * Operator import rule to Inspector;
104 * All nodes after rule is imported will be discovered with it.
105
106Alternatives
107------------
108
109Continue enroll nodes manually and run inspection. But it's not appropriate
110approach for big significant environments.
111
112API impact
113----------
114
115None
116
117Performance and scalability impact
118----------------------------------
119
120None
121
122Security impact
123---------------
124
125None
126
127Deployer impact
128---------------
129
130Note: before discovery, the config option ``node_not_found_hook`` should be
131assigned to the ``enroll_node_not_found_hook`` value;
132deployers will be required to create rules, so they should be familiar
133with rules, rules conditions and actions; for simple cases example rules
134could be used.
135
136Developer impact
137----------------
138
139Developers can create additional conditions and actions regarding their
140needs to extend the discovery process.
141
142Implementation
143==============
144
145Assignee(s)
146-----------
147
148* Anton Arefiev(aarefiev)
149
150Work Items
151----------
152
153 * Extend conditions and actions to support proposed format;
154 * Cover new functionality with unit and integration tests;
155 * Add example rules;
156 * Update docs.
157
158Dependencies
159============
160
161None
162
163Testing
164=======
165
166Unit, functional and integration tests will be added.
167
168References
169==========
170
171.. _`JSON path`: http://goessner.net/articles/JsonPath/
172.. _`Python format`: https://docs.python.org/3/library/stdtypes.html#str.format