Browse Source

Add tags for baremetal servers

Describe how to add tags support for baremetal servers.

Change-Id: Ieb0170b374f1018550aa808c001d2dbfed7added
Implements: bp server-tags-support
Tao Li 1 year ago
parent
commit
9c47b0bff1
1 changed files with 224 additions and 0 deletions
  1. 224
    0
      specs/queens/approved/servers-tagging.rst

+ 224
- 0
specs/queens/approved/servers-tagging.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
+Server tagging
9
+==============
10
+
11
+https://blueprints.launchpad.net/mogan/+spec/server-tags-support
12
+
13
+This aims to add support for tagging servers.
14
+
15
+Problem description
16
+===================
17
+
18
+Mogan should support adding tags for servers, which can be used to divide the
19
+servers into different categories. Then we can do list by tags to get a group
20
+of servers with same properties like managed servers. BTW, unlike server
21
+groups, tags are not used to schedule servers.
22
+
23
+Use Cases
24
+---------
25
+
26
+* As a user, I want to classify bare metal servers based on some properties
27
+  such as os type. e.g., we can add a tag called `centos7.2` for
28
+  bare metal servers with centos7.2 operating system, so we can easily obtain
29
+  these bare metal servers by this tag later.
30
+
31
+* As a user, I want to classify bare metal servers based on their usages
32
+  such as database servers.
33
+
34
+Proposed change
35
+===============
36
+
37
+* Add APIs that allow a user to add, remove, and list tags for a server.
38
+
39
+* Add tag filter parameters to server list API to allow searching for servers
40
+  based on one or more string tags.
41
+
42
+* Update the `Create Server` API to support specifying tags when creating
43
+  servers.
44
+
45
+Alternatives
46
+------------
47
+
48
+None
49
+
50
+Data model impact
51
+-----------------
52
+
53
+New `mogan.objects.tag.ServerTag` and `mogan.objects.tag.ServerTagList` object
54
+would be added to the object model.
55
+
56
+The `mogan.objects.tag.ServerTagList` field in the python object model
57
+will be populated on-demand (i.e. not eager-loaded).
58
+
59
+A tag should be defined as a Unicode string no longer than 255 characters
60
+in length, with an index on this field.
61
+
62
+Tags are strings attached to an entity with the purpose of classification
63
+into groups. To simplify requests that specify lists of tags, the comma
64
+character is not allowed to be in a tag name.
65
+
66
+The proposed change will be adding the following fields to the ServerTag
67
+object with their data type and default value for migrations.
68
+
69
++-----------------------+--------------+
70
+| Field Name            | Field Type   |
71
++=======================+==============+
72
+| server_id             | Integer      |
73
++-----------------------+--------------+
74
+| tag                   | String       |
75
++-----------------------+--------------+
76
+
77
+For the database schema, the following table constructs would suffice ::
78
+
79
+    op.create_table(
80
+        'server_tags',
81
+        sa.Column('created_at', sa.DateTime(), nullable=True),
82
+        sa.Column('updated_at', sa.DateTime(), nullable=True),
83
+        sa.Column('server_id', sa.Integer(), nullable=False),
84
+        sa.Column('tag', sa.String(length=255), nullable=False),
85
+        sa.PrimaryKeyConstraint('server_id', 'tag'),
86
+        sa.ForeignKeyConstraint(['server_id'],
87
+                                ['servers.id']),
88
+        sa.Index('server_tags_tag_idx', 'tag'),
89
+        mysql_ENGINE='InnoDB',
90
+        mysql_DEFAULT_CHARSET='UTF8'
91
+    )
92
+
93
+REST API impact
94
+---------------
95
+
96
+We will follow the `API Working Group's specification for tagging`_, rather
97
+than invent our own.
98
+
99
+.. _API Working Group's specification for tagging: http://specs.openstack.org/openstack/api-wg/guidelines/tags.html
100
+
101
+Will support addressing individual tags.
102
+
103
+
104
+RPC API impact
105
+--------------
106
+
107
+None
108
+
109
+State Machine Impact
110
+--------------------
111
+
112
+None
113
+
114
+Client (CLI) impact
115
+-------------------
116
+
117
+Add tags CRUD operations commands:
118
+
119
+* openstack baremetalcompute server tag list <server_uuid>
120
+* openstack baremetalcompute server tag update <server_uuid> <op> <tags>
121
+
122
+<op> Operation: 'add' or 'remove'
123
+
124
+For individual tag:
125
+* openstack baremetalcompute server tag add <server_uuid> <tag>
126
+* openstack baremetalcompute server tag remove <server_uuid> <tag>
127
+
128
+Add tag-list filtering support to node-list command:
129
+
130
+* openstack baremetalcompute server list --tag tag1 --tag tag2
131
+* openstack baremetalcompute server list --tag-any tag1 --tag-any tag2
132
+* openstack baremetalcompute server list --not-tag tag3
133
+
134
+Multiple --tag will be used to filter results in an AND expression, and
135
+--tag-any for OR expression, allowing for exclusionary tags via the
136
+--not-tag option.
137
+
138
+Driver API impact
139
+-----------------
140
+
141
+None
142
+
143
+Security impact
144
+---------------
145
+
146
+None
147
+
148
+Notifications impact
149
+--------------------
150
+
151
+None
152
+
153
+Other end user impact
154
+---------------------
155
+
156
+None
157
+
158
+Scalability impact
159
+------------------
160
+
161
+None
162
+
163
+Performance Impact
164
+------------------
165
+
166
+None
167
+
168
+Other deployer impact
169
+---------------------
170
+
171
+None
172
+
173
+Developer impact
174
+----------------
175
+
176
+None
177
+
178
+Implementation
179
+==============
180
+
181
+Assignee(s)
182
+-----------
183
+
184
+Primary assignee:
185
+  Tao Li <litao3721@126.com>
186
+
187
+Work Items
188
+----------
189
+
190
+* Update api-ref document to describe tag information.
191
+* Add `server_tags` table with a migration.
192
+* Add DB API layer for CRUD operations on server tags.
193
+* Added DB API layer for server tag list filtering support.
194
+* Add ServerTag, ServerTagList objects and a new tags field to Server object.
195
+* Add REST API for CRUD operations on server tags.
196
+* Add REST API for server tag list filtering support.
197
+* Add tags support for creating servers.
198
+* python-moganclient additions and modifications.
199
+
200
+
201
+Dependencies
202
+============
203
+
204
+None
205
+
206
+
207
+Testing
208
+=======
209
+
210
+Add unit tests.
211
+Add tempest API tests.
212
+
213
+
214
+Documentation Impact
215
+====================
216
+
217
+Mogan API and python-moganclient will need to be updated to accompany
218
+this change.
219
+
220
+
221
+References
222
+==========
223
+
224
+1. http://specs.openstack.org/openstack/api-wg/guidelines/tags.html

Loading…
Cancel
Save