Browse Source

Node aggregates

This spec introduces aggregate concept to Mogan.

Change-Id: I371605d56dc41a39f56dad060f640dad6bf0c6b7
Implements: bp node-aggregate
Zhenguo Niu 1 year ago
parent
commit
a533d36231
1 changed files with 248 additions and 0 deletions
  1. 248
    0
      specs/pike/approved/node-aggregate.rst

+ 248
- 0
specs/pike/approved/node-aggregate.rst View File

@@ -0,0 +1,248 @@
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
+Node Aggregates
9
+===============
10
+
11
+https://blueprints.launchpad.net/mogan/+spec/node-aggregate
12
+
13
+This introduces the concept of aggregate into Mogan, which is quite like Nova
14
+host aggregate, but we are based on baremetal nodes. Node aggregate allows the
15
+partition of baremetal nodes into logical groups for server distribution.
16
+
17
+
18
+Problem description
19
+===================
20
+
21
+Currently Mogan only have a concept of availability zones which is for
22
+providing isolation and redundancy from other availability zones. We need a
23
+mechanism to further partitioning baremetal nodes.
24
+
25
+Use Cases
26
+---------
27
+
28
+* As a cloud operator, I want to classify baremetal nodes based on the
29
+  location like rack, row, cage, zone, DC.
30
+
31
+* As a cloud operator, I want to classify baremetal nodes based on the
32
+  hardware specs like with GPU, FPGA, ceph storage backend.
33
+
34
+
35
+Proposed change
36
+===============
37
+
38
+* A new mogan.objects.aggregate.Aggregate object would be added to the object
39
+model.
40
+
41
+* Add a set of API that only allow admins to create, delete, and list
42
+aggregates, also admins should be able to add nodes to the specific aggregate
43
+and remove nodes from it.
44
+
45
+* When do resources update we will cache the resource providers and the map of
46
+aggregates with resource providers. Add a node list API for admins which will
47
+derive resource providers from the cache.
48
+
49
+* Before scheduling, mogan will handle the flavor resource_aggregates matching
50
+with node aggregate metadata, then got a list of aggregates, and pass it to
51
+placement with `member_of` parameter when listing resource providers::
52
+
53
+    /resource_providers?member_of=in:{agg1_uuid},{agg2_uuid},{agg3_uuid}
54
+
55
+Alternatives
56
+------------
57
+
58
+None
59
+
60
+Data model impact
61
+-----------------
62
+
63
+The proposed change will be adding the following fields to the aggregate
64
+object with their data type and default value for migrations.
65
+
66
++-----------------------+--------------+
67
+| Field Name            | Field Type   |
68
++=======================+==============+
69
+|          id           | Integer      |
70
++-----------------------+--------------+
71
+|         uuid          | UUID         |
72
++-----------------------+--------------+
73
+|         name          | String       |
74
++-----------------------+--------------+
75
+|        metadata       | DictOfStrings|
76
++-----------------------+--------------+
77
+
78
+For the database schema, the following table constructs would suffice ::
79
+
80
+    op.create_table(
81
+        'aggregates',
82
+        sa.Column('created_at', sa.DateTime(), nullable=True),
83
+        sa.Column('updated_at', sa.DateTime(), nullable=True),
84
+        sa.Column('id', sa.Integer(), nullable=False),
85
+        sa.Column('uuid', sa.String(length=36), nullable=False),
86
+        sa.Column('name', sa.String(length=255), nullable=False),
87
+        sa.PrimaryKeyConstraint('id'),
88
+        mysql_ENGINE='InnoDB',
89
+        mysql_DEFAULT_CHARSET='UTF8'
90
+    )
91
+
92
+    op.create_table(
93
+        'aggregate_metadata',
94
+        sa.Column('created_at', sa.DateTime(), nullable=True),
95
+        sa.Column('updated_at', sa.DateTime(), nullable=True),
96
+        sa.Column('id', sa.Integer(), primary_key=True, nullable=False),
97
+        sa.Column('key', sa.String(length=255), nullable=False),
98
+        sa.Column('value', sa.String(length=255), nullable=False),
99
+        sa.Column('aggregate_id', sa.Integer(), nullable=False),
100
+        sa.PrimaryKeyConstraint('id'),
101
+        sa.ForeignKeyConstraint(['aggregate_id'],
102
+                                ['aggregate.id']),
103
+        mysql_ENGINE='InnoDB',
104
+        mysql_DEFAULT_CHARSET='UTF8'
105
+    )
106
+
107
+REST API impact
108
+---------------
109
+
110
+- To create a new aggregate, a user will ::
111
+
112
+    POST /v1/aggregates
113
+
114
+  With a body containing the JSON description of the aggregate.
115
+
116
+  JSON Schema::
117
+
118
+    {
119
+        "type": "object",
120
+        "properties": {
121
+            "name": {"type": "string", "minLength": 1, "maxLength": 255},
122
+            "metadata": {
123
+                'type': 'object',
124
+                'patternProperties': {
125
+                    '^[a-zA-Z0-9-_:. ]{1,255}$': {
126
+                        'type': 'string', 'maxLength': 255
127
+                    }
128
+                },
129
+                'additionalProperties': False
130
+            },
131
+        },
132
+        "required": ["name"],
133
+        "additionalProperties": False,
134
+    }
135
+
136
+- To list aggregates, a user will ::
137
+
138
+    GET /v1/aggregates
139
+
140
+- To show aggregate details, a user will ::
141
+
142
+    GET /v1/aggregates/{aggregate_id}
143
+
144
+- To update aggregate, a user will ::
145
+
146
+    PATCH /v1/aggregates/{aggregate_id}
147
+
148
+  With a body containing the JSON description of the fileds to be updated.
149
+
150
+  Example Update Aggregate: JSON request::
151
+
152
+  [
153
+      {
154
+          "op": "replace",
155
+          "path": "/name",
156
+          "value": "foo"
157
+      },
158
+      {
159
+          "op": "add",
160
+          "path": "/metadata/k1",
161
+          "value": "v1"
162
+      }
163
+  ]
164
+
165
+- To delete an aggregate, a user will ::
166
+
167
+    DELETE /v1/aggregates/{aggregate_id}
168
+
169
+- To add nodes to an aggregate, a user will ::
170
+
171
+    POST /v1/aggregates/{aggregate_id}/nodes
172
+
173
+  With a body containing a list of node uuid to be added to the aggregate.
174
+
175
+- To remove node from an aggregate, a user will ::
176
+
177
+    DELETE /v1/aggregates/{aggregate_id}/nodes/{node}
178
+
179
+- To get nodes from an aggregate, a user will ::
180
+
181
+    GET /v1/aggregates/{aggregate_id}/nodes
182
+
183
+Security impact
184
+---------------
185
+
186
+None
187
+
188
+Notifications impact
189
+--------------------
190
+
191
+None
192
+
193
+Other end user impact
194
+---------------------
195
+
196
+None
197
+
198
+Performance Impact
199
+------------------
200
+
201
+None
202
+
203
+Other deployer impact
204
+---------------------
205
+
206
+None
207
+
208
+Developer impact
209
+----------------
210
+
211
+None
212
+
213
+Implementation
214
+==============
215
+
216
+Assignee(s)
217
+-----------
218
+
219
+Primary assignee:
220
+  <niu-zglinux>
221
+
222
+Work Items
223
+----------
224
+
225
+* Add aggregate object.
226
+* Add APIs that allows an admin to add, remove, and list node aggregates.
227
+* Add APIs that allows an admin to add/remove nodes to an aggregate.
228
+* Add new CLIs to manage node aggregates.
229
+
230
+Dependencies
231
+============
232
+
233
+None
234
+
235
+Testing
236
+=======
237
+
238
+Unit Testing will be added.
239
+
240
+Documentation Impact
241
+====================
242
+
243
+Docs about node aggregates will be added.
244
+
245
+References
246
+==========
247
+
248
+None

Loading…
Cancel
Save