Browse Source

User Guide: 'Automate with Mistral' added

Change-Id: I04c7f83ac6a4b818c6eee062da79c26a33dc0f57
master
Taras Kostyuk 2 years ago
parent
commit
77f15c3bbb
2 changed files with 245 additions and 0 deletions
  1. 1
    0
      doc/user_guide/index.rst
  2. 244
    0
      doc/user_guide/mistral.rst

+ 1
- 0
doc/user_guide/index.rst View File

@@ -32,4 +32,5 @@ Use GCS Fuel Plugin
32 32
 .. toctree::
33 33
    :maxdepth: 2
34 34
 
35
+   mistral
35 36
    troubleshooting

+ 244
- 0
doc/user_guide/mistral.rst View File

@@ -0,0 +1,244 @@
1
+Automate with Mistral
2
+---------------------
3
+
4
+Many backup strategies require taking backups on regular basis
5
+and it's good to have these repeatable actions automated.
6
+
7
+Taking a drive backup is often considered as a single action but
8
+usually requires taking a snapshot, taking a backup of the snapshot and
9
+then deleting the snapshot. So taking a drive backup is actually a workflow.
10
+
11
+Mistral is a workflow service for OpenStack cloud and the plugin provides a
12
+sample Mistral workbook.
13
+
14
+The workflow provided by the sample basicly does:
15
+
16
+* Create a list of Cinder volumes to backup
17
+* Create snapshots for the volumes
18
+* Create backups for the snapshots
19
+* Wait until backups are created
20
+* Remove the snapshots
21
+* Send a report(optional)
22
+
23
+After the plugin is installed on Fuel master the sample can be found in
24
+``/var/www/nailgun/plugins/fuel-plugin-cinder-gcs-1.0/examples/mistral_workbook.yaml``
25
+on Fuel master node.
26
+
27
+To use the sample it's required to have Mistral service installed and running.
28
+
29
+
30
+Copying Mistral workbook to an Openstack controller
31
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
+
33
+#. Copy the sample from Fuel master to an OpenStack controller::
34
+
35
+  root@fuel-master# scp /var/www/nailgun/plugins/fuel-plugin-cinder-gcs-1.0/examples/mistral_workbook.yaml root@<CONTROLLER_NAME_OR_IP>:~
36
+
37
+Customizing the sample workbook
38
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
+
40
+Mistral has a possibility to send e-mails via an MTA, which support SSL/TLS and authentication.
41
+It's not possible to use a MTA without SSL/TLS and authentication support.
42
+
43
+Proper MTA credentials should be set in the sample file before creating Mistral
44
+workbook to sample.
45
+
46
+#. Login to the controller and edit the sample file
47
+
48
+::
49
+
50
+  root@controller:~# vi mistral_workbook.yaml
51
+  ...
52
+        from_addr: '<USERNAME>@<DOMAIN>'
53
+        smtp_server: '<MTA_HOSTNAME_OR_IP>'
54
+        smtp_password: '<PASSWORD>'
55
+
56
+*Note:* The step can be skipped if sending e-mails by the workflow if not
57
+supposed.
58
+
59
+Creating Mistral workbook from the sample
60
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61
+
62
+#. Verify Mistral CLI works
63
+
64
+::
65
+
66
+  root@controller:~# openstack workbook list
67
+  +------------------------+--------+---------------------+------------+
68
+  | Name                   | Tags   | Created at          | Updated at |
69
+  +------------------------+--------+---------------------+------------+
70
+  +------------------------+--------+---------------------+------------+
71
+
72
+  root@controller:~# openstack workflow list -c Name
73
+  +---------------------+
74
+  | Name                |
75
+  +---------------------+
76
+  | std.create_instance |
77
+  | std.delete_instance |
78
+  +---------------------+
79
+
80
+*Note:* It may be required to source the approriate *openrc* file to get the
81
+command working.
82
+
83
+#. Create Mistral workbook from the sample
84
+
85
+::
86
+
87
+  root@controller:~# openstack workbook create mistral_workbook.yaml
88
+  +------------+----------------------------+
89
+  | Field      | Value                      |
90
+  +------------+----------------------------+
91
+  | Name       | sample_backup_workbook     |
92
+  | Tags       | <none>                     |
93
+  | Created at | 2016-09-08 13:59:10.306180 |
94
+  | Updated at | None                       |
95
+  +------------+----------------------------+
96
+
97
+#. Verify the workbook and the workflow are added
98
+
99
+::
100
+
101
+  root@controller:~# openstack workbook list
102
+  +------------------------+--------+---------------------+------------+
103
+  | Name                   | Tags   | Created at          | Updated at |
104
+  +------------------------+--------+---------------------+------------+
105
+  | sample_backup_workbook | <none> | 2016-09-08 13:59:10 | None       |
106
+  +------------------------+--------+---------------------+------------+
107
+
108
+  root@controller:~# openstack workflow list -c Name
109
+  +------------------------------------------------+
110
+  | Name                                           |
111
+  +------------------------------------------------+
112
+  | std.create_instance                            |
113
+  | std.delete_instance                            |
114
+  | sample_backup_workbook.create_backups_workflow |   <---
115
+  +------------------------------------------------+
116
+
117
+Using workflow
118
+^^^^^^^^^^^^^^
119
+
120
+The workflow accepts the following parameters:
121
+
122
+* *projects_id_list*
123
+
124
+  * Optional
125
+  * Default: null
126
+  * Mutual exclusive with *volumes_id_list*
127
+  * Comment: Mutual exclusive with *volumes_id_list*. If *projects_id_list* is
128
+    provided all volumes of the projects are backued up. If *volumes_id_list* is
129
+    provided only volumes from the list are backud up. If neither
130
+    *projects_id_list* nor *volumes_id_list* is provided all volumes of all
131
+    projects will be backed up.
132
+
133
+* *volumes_id_list*
134
+
135
+  * Optional
136
+  * Default: null
137
+  * Comment: Mutual exclusive with *volumes_id_list*. If *projects_id_list* is
138
+    provided all volumes of the projects are backued up. If *volumes_id_list* is
139
+    provided only volumes from the list are backud up. If neither
140
+    *projects_id_list* nor *volumes_id_list* is provided all volumes of all
141
+    projects will be backed up.
142
+
143
+* *incremental*
144
+
145
+  * Optional
146
+  * Default: false
147
+  * Comment: Full backups are created is not provided.
148
+
149
+* *report_to_list*
150
+
151
+  * Optional
152
+  * Default: null
153
+  * Comment: E-mails are not sent if not provided.
154
+
155
+* *snapshot_name*
156
+
157
+  * Optional
158
+  * Default: 'by_create_backups_workflow'
159
+  * Comment: It becomes a name for Cinder snaphots. Useful for detecting not
160
+    deleted Cinder snapshots.
161
+
162
+Executing workflow without parameters (test only)
163
+"""""""""""""""""""""""""""""""""""""""""""""""""
164
+
165
+*Note:* Executing the workflow without parameters will cause taking full backups
166
+of all volumes of all projects(tenants) what cat take a lot of time and
167
+resources.
168
+
169
+::
170
+
171
+  root@controller:~# openstack workflow execution create sample_backup_workbook.create_backups_workflow
172
+  +-------------------+------------------------------------------------+
173
+  | Field             | Value                                          |
174
+  +-------------------+------------------------------------------------+
175
+  | ID                | 93fc32a1-d285-4934-9b14-9a58b395e5d1           | <---ID
176
+  | Workflow ID       | c5816326-ae05-43cc-8732-943ace7b5947           |
177
+  | Workflow name     | sample_backup_workbook.create_backups_workflow |
178
+  | Description       |                                                |
179
+  | Task Execution ID | <none>                                         |
180
+  | State             | RUNNING                                        |
181
+  | State info        | None                                           |
182
+  | Created at        | 2016-09-09 13:06:27                            |
183
+  | Updated at        | 2016-09-09 13:06:26.626167                     |
184
+  +-------------------+------------------------------------------------+
185
+
186
+Executing workflow with parameters
187
+""""""""""""""""""""""""""""""""""
188
+
189
+The next example shows providing *volumes_id_list* parameter
190
+while creating an execution.
191
+
192
+::
193
+
194
+  root@controller:~# openstack workflow execution create sample_backup_workbook.create_backups_workflow '{"volumes_id_list": ["0774de3c-092a-4eb3-a25f-04c0790f51c6"]}'
195
+  +-------------------+------------------------------------------------+
196
+  | Field             | Value                                          |
197
+  +-------------------+------------------------------------------------+
198
+  | ID                | ec017763-11c6-421f-b7e9-7774bc2a7fa3           |
199
+  | Workflow ID       | c5816326-ae05-43cc-8732-943ace7b5947           |
200
+  | Workflow name     | sample_backup_workbook.create_backups_workflow |
201
+  | Description       |                                                |
202
+  | Task Execution ID | <none>                                         |
203
+  | State             | RUNNING                                        |
204
+  | State info        | None                                           |
205
+  | Created at        | 2016-09-09 13:18:14                            |
206
+  | Updated at        | 2016-09-09 13:18:14.044925                     |
207
+  +-------------------+------------------------------------------------+
208
+
209
+Checking execution and execution tasks status
210
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211
+
212
+To check an execution status the execution ID is required. The ID can be found
213
+in ``openstack workflow execution create`` command output.::
214
+
215
+  root@node-1:~# openstack workflow execution show 9822a1c0-bd79-4bb2-9c91-c0accf96e60e
216
+  +-------------------+------------------------------------------------+
217
+  | Field             | Value                                          |
218
+  +-------------------+------------------------------------------------+
219
+  | ID                | 9822a1c0-bd79-4bb2-9c91-c0accf96e60e           |
220
+  | Workflow ID       | c5816326-ae05-43cc-8732-943ace7b5947           |
221
+  | Workflow name     | sample_backup_workbook.create_backups_workflow |
222
+  | Description       |                                                |
223
+  | Task Execution ID | <none>                                         |
224
+  | State             | SUCCESS                                        |
225
+  | State info        | None                                           |
226
+  | Created at        | 2016-09-09 12:54:03                            |
227
+  | Updated at        | 2016-09-09 12:55:23                            |
228
+  +-------------------+------------------------------------------------+
229
+
230
+To list the execution tasks run providing the execution ID::
231
+
232
+  root@node-1:~# openstack task execution list 9822a1c0-bd79-4bb2-9c91-c0accf96e60e
233
+  +-----..-+------..-+---------------..-+--------------..-+---------+------..-+
234
+  | ID  .. | Name .. | Workflow name .. | Execution ID .. | State   | State.. |
235
+  +-----..-+------..-+---------------..-+--------------..-+---------+------..-+
236
+  | c4c3.. | analy.. | sample_backup_.. | 9822a1c0-bd79.. | SUCCESS | None .. |
237
+  | c1e0.. | analy.. | sample_backup_.. | 9822a1c0-bd79.. | SUCCESS | None .. |
238
+  | 81de.. | get_a.. | sample_backup_.. | 9822a1c0-bd79.. | SUCCESS | None .. |
239
+  | cd74.. | creat.. | sample_backup_.. | 9822a1c0-bd79.. | SUCCESS | None .. |
240
+  | df6f.. | creat.. | sample_backup_.. | 9822a1c0-bd79.. | SUCCESS | None .. |
241
+  | 8513.. | wait_.. | sample_backup_.. | 9822a1c0-bd79.. | SUCCESS | None .. |
242
+  | fc62.. | delet.. | sample_backup_.. | 9822a1c0-bd79.. | SUCCESS | None .. |
243
+  +-----..-+------..-+---------------..-+--------------..-+---------+------..-+
244
+

Loading…
Cancel
Save