summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-30 12:11:27 +0000
committerGerrit Code Review <review@openstack.org>2016-09-30 12:11:27 +0000
commitfa90f9cbf5b845b06c69533c2395161ae63e1dba (patch)
tree1e0be5af9c4422df0bc0bed26a4c7fc3c84e13f3
parentf0836ad32a633bf1f16da82baef507ef7862d795 (diff)
parent77f15c3bbba12fde678ceb07f0a3e20ffe35e220 (diff)
Merge "User Guide: 'Automate with Mistral' added"HEADmaster
-rw-r--r--doc/user_guide/index.rst1
-rw-r--r--doc/user_guide/mistral.rst244
2 files changed, 245 insertions, 0 deletions
diff --git a/doc/user_guide/index.rst b/doc/user_guide/index.rst
index 1b7ca12..8942c42 100644
--- a/doc/user_guide/index.rst
+++ b/doc/user_guide/index.rst
@@ -32,4 +32,5 @@ Use GCS Fuel Plugin
32.. toctree:: 32.. toctree::
33 :maxdepth: 2 33 :maxdepth: 2
34 34
35 mistral
35 troubleshooting 36 troubleshooting
diff --git a/doc/user_guide/mistral.rst b/doc/user_guide/mistral.rst
new file mode 100644
index 0000000..659d543
--- /dev/null
+++ b/doc/user_guide/mistral.rst
@@ -0,0 +1,244 @@
1Automate with Mistral
2---------------------
3
4Many backup strategies require taking backups on regular basis
5and it's good to have these repeatable actions automated.
6
7Taking a drive backup is often considered as a single action but
8usually requires taking a snapshot, taking a backup of the snapshot and
9then deleting the snapshot. So taking a drive backup is actually a workflow.
10
11Mistral is a workflow service for OpenStack cloud and the plugin provides a
12sample Mistral workbook.
13
14The 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
23After 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``
25on Fuel master node.
26
27To use the sample it's required to have Mistral service installed and running.
28
29
30Copying 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
37Customizing the sample workbook
38^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
40Mistral has a possibility to send e-mails via an MTA, which support SSL/TLS and authentication.
41It's not possible to use a MTA without SSL/TLS and authentication support.
42
43Proper MTA credentials should be set in the sample file before creating Mistral
44workbook 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
57supposed.
58
59Creating 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
81command 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
117Using workflow
118^^^^^^^^^^^^^^
119
120The 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
162Executing workflow without parameters (test only)
163"""""""""""""""""""""""""""""""""""""""""""""""""
164
165*Note:* Executing the workflow without parameters will cause taking full backups
166of all volumes of all projects(tenants) what cat take a lot of time and
167resources.
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
186Executing workflow with parameters
187""""""""""""""""""""""""""""""""""
188
189The next example shows providing *volumes_id_list* parameter
190while 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
209Checking execution and execution tasks status
210^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211
212To check an execution status the execution ID is required. The ID can be found
213in ``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
230To 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