https://blueprints.launchpad.net/fuel/+spec/store-deployment-tasks-history
As Fuel user leveraging its LCM feature set I would like to have an opportunity to fetch history of all deployment tasks ever ran against any of my environments. This would allow me to perform configuration change and maintenance of my cluster with ability to do troubleshooting and audit of things happening in the cluster.
Currently, it is almost impossible for any Fuel user to understand the history of changes happened to his cluster. This puts a barrier onto adoption of Fuel as not only as an OpenStack installer, but also as a cloud management tool. This change proposes to store all the information about particular deployment tasks ever executed for each particular cluster.
This would allow for anyone to understand status of the cluster it is currently in, which tasks were ever ran and what could have possibly gone wrong.
Main changes are going to happen within Nailgun Data Model. This assumes creation of additional relation in Nailgun DB that will store history of deployment tasks with relation to particular global Nailgun tasks.
The other part that is going to be changed is Nailgun receiver module code that is going to update deployment tasks status.
None
Modules to be changed:
Add new table deployment_history with the following scheme:
Add new time field for tasks table deleted_at. Change deletion behavior for tasks: instead of deletion from DB Nailgun should write deleted_at time and stay it in DB.
Old API endpoint /api/tasks return only tasks with deleted_at is null column in order to keep backward compatibility with UI. Also /api/tasks endpoint has mark as deprecated because it superseded by /api/transactions.
Add new unique constraint for such fields: task_id, node_id, deployment_graph_task_name.
Add index for such fields combination to support API calls:
There will be a REST API handler allowing to get a list of tasks and (tentatively) particular task details in case of failure
method | URL | action | auth exempt |
---|---|---|---|
GET | /api/transactions/:transaction_id/deployment_history | get list of all deployment tasks of a nailgun task | false |
GET | /api/transactions/ | get list of all nailgun tasks including deleted | false |
The methods should return the following statuses in case of errors:
GET method should also support filters by node or/and by history tasks statuses:
GET method returns JSON of the following format:
[
{
'id': 13,
'task_id': 12,
'node_id': '5',
'deployment_graph_task_name': 'swift-keystone',
'time_start': 1457362146,
'time_end': 1457362276,
'status': 'ready',
},
{
'id': 15,
'task_id': 12,
'node_id': 'master',
'deployment_graph_task_name': 'generate_keys',
'time_start': 1457362143,
'time_end': 1457362273,
'status': 'ready'
}
...
]
Fuel Client have to show task statuses for particular Nailgun task. New command should be added:
fuel deployment-tasks --task-id 1
fuel deployment-tasks --task-id 1 --node-id 5,6
fuel deployment-tasks --task-id 1 --status error,ready
fuel deployment-tasks --task-id 1 --node-id 5,6 --status error,ready
Also, appropriate commands should be added to fuel2 client:
fuel2 task history show 1
fuel2 task history show 1 --nodes node_id_1,[node_id_2 ...]
fuel2 task history show 1 --statuses task_status_1 [task_status_2 ...]
fuel2 task history show 1 --nodes 1,2 --statuses pending skipped
None
None
None
Should be disabled for pre-9.0 clusters
None so far
None
Ability to easier troubleshoot and perform maintenance and day-2 operations
Insignificant
None
None
None
None except for generic feature documentation