This aims to add support for tagging nodes.
Ironic should have tags field for every node, which can be used to divide the nodes to some groups. then we can do list by tag to get a group of nodes with same properties like hardware specs.
Current chassis object is kind of an alternative for grouping nodes.
A new ironic.objects.tags.NodeTagList object would be added to the object model.
The ironic.objects.tags.NodeTagList field in the python object model will be populated on-demand (i.e. not eager-loaded).
A tag should be defined as a Unicode string no longer than 255 characters in length, with an index on this field.
Tags are strings attached to an entity with the purpose of classification into groups. To simplify requests that specify lists of tags, the comma character is not allowed to be in a tag name.
For the database schema, the following table constructs would suffice
CREATE TABLE node_tags ( node_id INT(11) NOT NULL, tag VARCHAR(255) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (node_id, tag), KEY (tag), FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE, )
We will follow the API Working Group’s specification for tagging, rather than invent our own.
Will support addressing individual tags.
Add tags CRUD operations commands:
<op> Operation: ‘add’ or ‘remove’
For individual tag: * ironic node-tag-add <node uuid> <tag> * ironic node-tag-remove <node uuid> <tag>
Add tag-list filtering support to node-list command:
Multiple –tag will be used to filter results in an AND expression, and –tag-any for OR expression, allowing for exclusionary tags via the –not-tag option.
The tags information can be used for nova but it’s not being considered as part of this spec, and may be addressed at a later time.
Add unit tests. Add tempest API tests.
Add a migration script for DB.
Ironic API and python-ironicclient will need to be updated to accompany this change.