summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-08-15 03:30:02 +0000
committerGerrit Code Review <review@openstack.org>2017-08-15 03:30:02 +0000
commit3a4e6dc638f715f0a47229cbbc492e02b5f640ac (patch)
tree8cc806c1419f04d08422a9d1f86bf8fde5ae4c9f
parent5fed727f7c2da05f9daf822f94b477ae36293393 (diff)
parenta533d362313bf0fbe87549e80fd682dabd28b628 (diff)
Merge "Node aggregates"
-rw-r--r--specs/pike/approved/node-aggregate.rst248
1 files changed, 248 insertions, 0 deletions
diff --git a/specs/pike/approved/node-aggregate.rst b/specs/pike/approved/node-aggregate.rst
new file mode 100644
index 0000000..3ce1d0c
--- /dev/null
+++ b/specs/pike/approved/node-aggregate.rst
@@ -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===============
8Node Aggregates
9===============
10
11https://blueprints.launchpad.net/mogan/+spec/node-aggregate
12
13This introduces the concept of aggregate into Mogan, which is quite like Nova
14host aggregate, but we are based on baremetal nodes. Node aggregate allows the
15partition of baremetal nodes into logical groups for server distribution.
16
17
18Problem description
19===================
20
21Currently Mogan only have a concept of availability zones which is for
22providing isolation and redundancy from other availability zones. We need a
23mechanism to further partitioning baremetal nodes.
24
25Use 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
35Proposed change
36===============
37
38* A new mogan.objects.aggregate.Aggregate object would be added to the object
39model.
40
41* Add a set of API that only allow admins to create, delete, and list
42aggregates, also admins should be able to add nodes to the specific aggregate
43and remove nodes from it.
44
45* When do resources update we will cache the resource providers and the map of
46aggregates with resource providers. Add a node list API for admins which will
47derive resource providers from the cache.
48
49* Before scheduling, mogan will handle the flavor resource_aggregates matching
50with node aggregate metadata, then got a list of aggregates, and pass it to
51placement with `member_of` parameter when listing resource providers::
52
53 /resource_providers?member_of=in:{agg1_uuid},{agg2_uuid},{agg3_uuid}
54
55Alternatives
56------------
57
58None
59
60Data model impact
61-----------------
62
63The proposed change will be adding the following fields to the aggregate
64object 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
78For 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
107REST 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
183Security impact
184---------------
185
186None
187
188Notifications impact
189--------------------
190
191None
192
193Other end user impact
194---------------------
195
196None
197
198Performance Impact
199------------------
200
201None
202
203Other deployer impact
204---------------------
205
206None
207
208Developer impact
209----------------
210
211None
212
213Implementation
214==============
215
216Assignee(s)
217-----------
218
219Primary assignee:
220 <niu-zglinux>
221
222Work 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
230Dependencies
231============
232
233None
234
235Testing
236=======
237
238Unit Testing will be added.
239
240Documentation Impact
241====================
242
243Docs about node aggregates will be added.
244
245References
246==========
247
248None