Browse Source

New flavor for baremetal servers

This spec proposes a new flavor for both general nodes and
Valence nodes.

Change-Id: I355a3f817eefb54a763314c6365c0b9d030988b3
Zhenguo Niu 2 years ago
parent
commit
5f58e34f1e
1 changed files with 236 additions and 0 deletions
  1. 236
    0
      specs/pike/approved/new-flavor.rst

+ 236
- 0
specs/pike/approved/new-flavor.rst View File

@@ -0,0 +1,236 @@
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
+New Flavor
9
+==========
10
+
11
+https://blueprints.launchpad.net/mogan/+spec/new-flavor
12
+
13
+Ironic added a "resource class" attribute to the primary node object represents
14
+the hardware specs. And not like VMs, baremetal nodes are consumed atomically,
15
+not piecemeal, so we would like to have the scheduler using a simplified search
16
+for the baremetal nodes that only looks for node that has a particular resource
17
+class.
18
+
19
+Operators are the people who create the flavors and set the baremetal node
20
+resource class attribute, so we need to add a 'resources' field to the flavor
21
+which can include one or more resource classes (not only baremetal node, may
22
+also extend to add other resources later). And a 'description' field would be
23
+added for operators to fill the detail hardware profile.
24
+
25
+
26
+Problem description
27
+===================
28
+
29
+Currently, we just use the flavor name to match with the baremetal nodes,
30
+which is not flexible, as we also want to support associating one flavor to
31
+some different resource classes. And the detail hardware properties fields
32
+make the flavor too complex, we need to keep the flavor simple.
33
+
34
+Use Cases
35
+---------
36
+
37
+Operators and users wish to use a simple flavor/scheduler to search for
38
+baremetal nodes.
39
+
40
+Proposed change
41
+===============
42
+
43
+We proposes to add a resources field which can associate one or more resource
44
+classes with the required quantities, like I need $N this resource, but for
45
+baremetal node, it's atomic, so it always be 1. And we also need a description
46
+field for hardware profile. For Valence integration, the flavor.resources can
47
+also reference to a Valence flavor which include all detail required hardware
48
+properties.
49
+
50
+The operator might define the flavors as such::
51
+
52
+    - baremetal-gold
53
+      resources:
54
+        CUSTOM_BAREMETAL_GOLD: 1
55
+      resource_traits:
56
+        CUSTOM_BAREMETAL_GOLD: FPGA
57
+      description:
58
+        Intel(R) Xeon(R) E5620 2.40GHz 16 cores, 8GB RAM
59
+
60
+    - baremetal-RSD-gold
61
+      resources:
62
+        valence-gold-flavor: 1
63
+      resource_traits:
64
+        valence-gold-flavor: PodM1
65
+      description:
66
+        Intel(R) Xeon(R) E5620 2.40GHz 16 cores, 8GB RAM
67
+
68
+Alternatives
69
+------------
70
+
71
+None
72
+
73
+Data model impact
74
+-----------------
75
+
76
+The proposed change will be adding the following fields to the flavor object
77
+with their data type and default value for migrations.
78
+
79
++-----------------------+--------------+-----------------+
80
+| Field Name            | Field Type   | Default Value   |
81
++=======================+==============+=================+
82
+| uuid                  | UUID         | None            |
83
++-----------------------+--------------+-----------------+
84
+| name                  | String       | None            |
85
++-----------------------+--------------+-----------------+
86
+| resources             | DictOfString | None            |
87
++-----------------------+--------------+-----------------+
88
+| resource_traits       | DictOfString | None            |
89
++-----------------------+--------------+-----------------+
90
+| description           | String       | None            |
91
++-----------------------+--------------+-----------------+
92
+| is_public             | Bool         | True            |
93
++-----------------------+--------------+-----------------+
94
+| disabled              | Bool         | False           |
95
++-----------------------+--------------+-----------------+
96
+
97
+The `resources` field indicates the resource quantities and the
98
+`resource_traits` field reference to the resource qualities.
99
+
100
+The `disabled` field is intended to be used when phasing out flavors. In this
101
+case, a delete wouldn't work because the flavor needs to still be available
102
+for live servers using that flavor, but we don't want to allow *new* servers
103
+created from that flavor. And we propose to deny deleting flavors if they are
104
+associated with servers.
105
+
106
+REST API impact
107
+---------------
108
+
109
+REST API will be changed as part of this change.
110
+
111
+- To create a new flavor, a user will::
112
+
113
+    POST /v1/flavors
114
+
115
+  With a body containing the JSON description of the flavor.
116
+
117
+  JSON Schema::
118
+
119
+    {
120
+        "type": "object",
121
+        "properties": {
122
+            'name': {'type': 'string', 'minLength': 1, 'maxLength': 255},
123
+            'resources': {
124
+                'type': 'object',
125
+                'patternProperties': {
126
+                    '^[a-zA-Z0-9-_:. ]{1,255}$': {
127
+                        'type': 'integer', 'minimum': 1
128
+                    }
129
+                },
130
+                'additionalProperties': False
131
+            },
132
+            'resource_traits': {
133
+                'type': 'object',
134
+                'patternProperties': {
135
+                    '^[a-zA-Z0-9-_:. ]{1,255}$': {
136
+                        'type': 'string', 'maxLength': 255
137
+                    }
138
+                },
139
+                'additionalProperties': False
140
+            },
141
+            'description': {'type': 'string', 'minLength': 1},
142
+            'disabled': {'type': 'boolean'},
143
+            'is_public': {'type': 'boolean'},
144
+        },
145
+        'required': ['name', 'resources', 'description'],
146
+        'additionalProperties': False,
147
+    }
148
+
149
+- To update a flavor, a user will::
150
+
151
+    PATCH /v1/flavors/flavor_uuid
152
+
153
+  We only allow to update below attributes::
154
+
155
+    ['/name', '/is_public', '/disabled']
156
+
157
+  Example of request BODY::
158
+
159
+    {
160
+        "op": "replace",
161
+        "path": "/disabled",
162
+        "value": true
163
+    }
164
+
165
+  Update other properties is not allowed, as it will make server properties
166
+  not consistent with the real hardware. Users need to create a new flavor
167
+  instead in this scenario. And when creating a server, we will check if
168
+  the specified flavor is disabled.
169
+
170
+Security impact
171
+---------------
172
+
173
+None
174
+
175
+Notifications impact
176
+--------------------
177
+
178
+None
179
+
180
+Other end user impact
181
+---------------------
182
+
183
+None
184
+
185
+Performance Impact
186
+------------------
187
+
188
+None
189
+
190
+Other deployer impact
191
+---------------------
192
+
193
+None
194
+
195
+Developer impact
196
+----------------
197
+
198
+None
199
+
200
+Implementation
201
+==============
202
+
203
+Assignee(s)
204
+-----------
205
+
206
+Primary assignee:
207
+  <niu-zglinux>
208
+
209
+Work Items
210
+----------
211
+
212
+* Modify flavor object with the proposed fields.
213
+* Change REST API to support new flavor properties.
214
+* Change scheduler filters/weighters to match the new flavor.
215
+* Change CLI to support flavor management.
216
+* Add UT and docs.
217
+
218
+Dependencies
219
+============
220
+
221
+None
222
+
223
+Testing
224
+=======
225
+
226
+Unit Testing will be added.
227
+
228
+Documentation Impact
229
+====================
230
+
231
+Docs about new flavor will be added.
232
+
233
+References
234
+==========
235
+
236
+None

Loading…
Cancel
Save