Browse Source

Add Redfish OOB driver to Drydock

This spec outlines the implementation details to add
Redfish as OOB driver for Drydock.

Change-Id: I354a630f36606f830d9abf2cad539651462c46cb
Hemanth Nakkina 9 months ago
parent
commit
bc98c24ece
1 changed files with 224 additions and 0 deletions
  1. 224
    0
      specs/approved/drydock_add_redfish_as_oob_driver.rst

+ 224
- 0
specs/approved/drydock_add_redfish_as_oob_driver.rst View File

@@ -0,0 +1,224 @@
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
+==============================================
8
+Introduce Redfish based OOB Driver for Drydock
9
+==============================================
10
+
11
+Proposal to support new OOB type Redfish as OOB driver for Drydock. Redfish
12
+is new standard for Platform management driven by DMTF.
13
+
14
+Links
15
+=====
16
+
17
+https://storyboard.openstack.org/#!/story/2003007
18
+
19
+Problem description
20
+===================
21
+
22
+In the current implementation, Drydock supports the following OOB types
23
+
24
+#. IPMI via pyhgmi driver to manage baremetal servers
25
+#. Libvirt driver to manage Virtual machines
26
+#. Manual driver
27
+
28
+Phygmi is python implementation for IPMI functionality. Currently phygmi
29
+supports few commands related to power on/off, boot, events and Lenovo OEM
30
+functions. Introducing a new IPMI command in pyghmi is complex and requires
31
+to know the low level details of the functionality like Network Function,
32
+Command and the data bits to be sent.
33
+
34
+DMTF's have proposed a new Standard Platform management API Redfish using a
35
+data model representation inside of hypermedia RESTful interface. Vendors like
36
+Dell, HP supports Redfish and Rest API are exposed to perform any actions.
37
+Being a REST and model based standard makes it easy for external tools like
38
+Drydock to communicate with the Redfish server.
39
+
40
+Impacted components
41
+===================
42
+
43
+The following Airship components would be impacted by this solution:
44
+
45
+#. Drydock - new OOB driver Redfish
46
+
47
+Proposed change
48
+===============
49
+
50
+Proposal is to add new OOB driver that supports all Drydock Orchestrator
51
+actions and configure the node as per the action. The communication between
52
+the driver and node will be REST based on Redfish resources exposed by the
53
+node. There shall be no changes in the way driver creates tasks using
54
+Orchestrator, exception handling and the concurrent execution of tasks.
55
+
56
+Redfish driver
57
+--------------
58
+Adding a new OOB driver requires to extend the base driver
59
+``drydock_provisioner.drivers.driver.OobDriver``.
60
+
61
+OOB type will be named as::
62
+
63
+    oob_types_supported = ['redfish']
64
+
65
+All the existing Orchestrator OOB actions need to be supported. New Action
66
+classes will be created for each of the OOB action and uses Redfish client
67
+to configure the node.::
68
+
69
+    action_class_map = {
70
+        hd_fields.OrchestratorAction.ValidateOobServices: ValidateOobServices,
71
+        hd_fields.OrchestratorAction.ConfigNodePxe: ConfigNodePxe,
72
+        hd_fields.OrchestratorAction.SetNodeBoot: SetNodeBoot,
73
+        hd_fields.OrchestratorAction.PowerOffNode: PowerOffNode,
74
+        hd_fields.OrchestratorAction.PowerOnNode: PowerOnNode,
75
+        hd_fields.OrchestratorAction.PowerCycleNode: PowerCycleNode,
76
+        hd_fields.OrchestratorAction.InterrogateOob: InterrogateOob,
77
+    }
78
+
79
+Implement Action classes
80
+------------------------
81
+
82
+Action class have to extend the base action
83
+``drydock_provisioner.orchestrator.actions.orchestrator.BaseAction``.
84
+The actions are executed as threads and so each action class have to
85
+implement the start method.
86
+
87
+Below is the table that mentions the OOB action and the corresponding
88
+Redfish commands. Details of each redfish command in terms of Redfish API
89
+is specified in the next section.
90
+
91
+.. table:: Drydock Actions and redfish commands
92
+
93
+   ======================  =========================
94
+   Action                  Redfish Commands
95
+   ======================  =========================
96
+   ValidateOobServices     Not implemented
97
+   ConfigNodePxe           Not implemented
98
+   SetNodeBoot             set_bootdev, get_bootdev
99
+   PowerOffNode            set_power, get_power
100
+   PowerOnNode             set_power, get_power
101
+   PowerCycleNode          set_power, get_power
102
+   InterrogateOob          get_power
103
+   ======================  =========================
104
+
105
+No configuration is required for the actions ValidateOobServices, ConfigNodePxe.
106
+
107
+Redfish client
108
+--------------
109
+
110
+Above mentioned commands (set_bootdev, get_bootdev, set_power, get_power)
111
+will be implemented by new class RedfishObject. This class is responsible
112
+for converting the commands to corresponding REST API and call the
113
+opensource python implementations of redfish clients.
114
+python-redfish-library provided by DMTF is chosen as Redfish client.
115
+
116
+In addition, there will be Redfish API extensions related to OEM which will
117
+be specific to vendor. Based on the need, the RedfishObject have to handle them
118
+and provide a clean interface to OOB actions.
119
+
120
+The redfish REST API calls for the commands::
121
+
122
+    Command:   get_bootdev
123
+    Request:   GET https://<OOB IP>/redfish/v1/Systems/<System_name>/
124
+    Response:  dict["Boot"]["BootSourceOverrideTarget"]
125
+
126
+    Command:   set_bootdev
127
+    Request:   PATCH https://<OOB IP>/redfish/v1/Systems/<System_name>/
128
+               {"Boot": {
129
+                   "BootSourceOverrideEnabled": "Once",
130
+                   "BootSourceOverrideTarget": "Pxe",
131
+               }}
132
+
133
+    Command:   get_power
134
+    Request:   GET https://<OOB IP>/redfish/v1/Systems/<System_name>/
135
+    Response:  dict["PowerState"]
136
+
137
+    Command:   set_power
138
+    Request:   POST https://<OOB IP>/redfish/v1/Systems/<System_name>/Actions/ComputerSystem.Reset
139
+               {
140
+                   "ResetType": powerstate
141
+               }
142
+               Allowed powerstate values are "On", "ForceOff", "PushPowerButton", "GracefulRestart"
143
+
144
+Configuration changes
145
+---------------------
146
+
147
+OOB driver that will be triggered by Drydock orchestrator is determined by
148
+
149
+- availability of driver class in configuration parameter oob_driver
150
+  under [plugins] section in drydock.conf
151
+- OOB type specified in HostProfile in Site manifests
152
+
153
+To use the Redfish driver as OOB, the OOB type in Host profile need to be
154
+set as ``redfish`` and a new entry to be added for oob_driver in drydock.conf
155
+``drydock_provisioner.drivers.oob.redfish_driver.RedfishDriver``
156
+
157
+Sample Host profile with OOB type redfish::
158
+
159
+    ---
160
+    schema: drydock/HostProfile/v1
161
+    metadata:
162
+      schema: metadata/Document/v1
163
+      name: global
164
+      storagePolicy: cleartext
165
+      labels:
166
+        hosttype: global_hostprofile
167
+      layeringDefinition:
168
+        abstract: true
169
+        layer: global
170
+    data:
171
+      oob:
172
+        type: 'redfish'
173
+        network: 'oob'
174
+        account: 'tier4'
175
+        credential: 'cred'
176
+
177
+Security impact
178
+---------------
179
+
180
+None
181
+
182
+Performance impact
183
+------------------
184
+
185
+None
186
+
187
+Implementation
188
+==============
189
+
190
+Work Items
191
+----------
192
+
193
+- Add redfish driver to drydock configuration parameter ``oob_driver``
194
+
195
+- Add base Redfish driver derived from oob_driver.OobDriver with
196
+  oob_types_supported `redfish`
197
+
198
+- Add RedfishObject class that uses python redfish library to talk with
199
+  the node.
200
+
201
+- Add OOB action classes specified in Proposed change
202
+
203
+- Add related tests - unit test cases
204
+
205
+Assignee(s)
206
+-----------
207
+
208
+Primary assignee:
209
+  Hemanth Nakkina
210
+
211
+Other contributors:
212
+  PradeepKumar KS
213
+  Gurpreet Singh
214
+
215
+Dependencies
216
+============
217
+
218
+None
219
+
220
+References
221
+==========
222
+
223
+.. _Redfish_standard: https://www.dmtf.org/standards/redfish
224
+.. _Redfish_python_library: https://github.com/DMTF/python-redfish-library

Loading…
Cancel
Save