Browse Source

Add ftp(s) support for freezer

Currently, freezer can only support local, ssh(support ssh_key_path),
swift, s3 as backup data storage, so we should increase support for
ftp, ftps(support password).

Story: #2004332
Task: #27917

Change-Id: I83f108b998673921d001bef71b247c5906ab2c83
gengchc2 5 months ago
parent
commit
14d4bc18f4
1 changed files with 244 additions and 0 deletions
  1. 244
    0
      specs/stein/approved/add-ftp-support-for-freezer.rst

+ 244
- 0
specs/stein/approved/add-ftp-support-for-freezer.rst View File

@@ -0,0 +1,244 @@
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
+Add FTP,SFTP and FTPS support for freezer
9
+=========================================
10
+
11
+* https://storyboard.openstack.org/#!/story/2004332
12
+
13
+Provide FTPS, FTP, SFTP options for users to store backup data.
14
+
15
+Problem description
16
+===================
17
+
18
+Currently, freezer can only support local, ssh(support ssh_key_path), swift, s3
19
+ as backup data storage, so we should increase support for FTP, FTPS(support
20
+ password).
21
+
22
+Use Cases
23
+---------
24
+
25
+* Users that want to backup data to FTP, FTPS, SFTP server.
26
+
27
+Proposed change
28
+===============
29
+
30
+Implement in the freezer new storages.
31
+
32
+With specifying the storage as FTP, FTPS or SFTP,
33
+the backup data will be stored on FTP, FTPS or SFTP server.
34
+
35
+For all these new added storage type, no Database models changes
36
+will happen. As matter of fact, we use python FTP class to implement
37
+details of FTP Client-server communication and authentication.
38
+
39
+For FTP storage, we will use class ftplib.FTP. The class of ftplib.FTP_TLS
40
+will be used to implement FTPS storage. And for SFTP storage, the python
41
+module paramiko is a suitable choice.
42
+
43
+Alternatives
44
+------------
45
+
46
+None
47
+
48
+Technical details
49
+-----------------
50
+
51
+Related docs:
52
+-------------
53
+None
54
+
55
+Data model impact
56
+-----------------
57
+None
58
+
59
+REST API impact
60
+---------------
61
+* Specifying the storage as ftps, the request Example
62
+  in creating job as follows::
63
+
64
+    {
65
+        "description": "Test-0001",
66
+        "job_schedule": {
67
+            "schedule_interval": "5 minutes",
68
+            "status": "scheduled",
69
+            "event": "start"
70
+        },
71
+        "job_actions": [
72
+            {
73
+                "max_retries": 5,
74
+                "max_retries_interval": 6,
75
+                "freezer_action": {
76
+                    "backup_name": "test0001_backup",
77
+                    "storage": "ftps",
78
+                    "ftp_host": "192.177.10.44",
79
+                    "ftp_username": "ftpstest",
80
+                    "ftp_password": "pass_test",
81
+                    "ftp_port": 21,
82
+                    "container": "/home/ftpstest",
83
+                    "no_incremental": true,
84
+                    "path_to_backup": "/etc/",
85
+                    "log_file": "/home/ftp_data/job0001.log",
86
+                    "snapshot": true,
87
+                    "action": "backup",
88
+                    "remove_older_than": 10,
89
+                }
90
+            }
91
+        ]
92
+    }
93
+
94
+* Specifying the storage as ftp, the request Example
95
+  in creating job as follows::
96
+
97
+    {
98
+        "description": "Test-0001",
99
+        "job_schedule": {
100
+            "schedule_interval": "5 minutes",
101
+            "status": "scheduled",
102
+            "event": "start"
103
+        },
104
+        "job_actions": [
105
+            {
106
+                "max_retries": 5,
107
+                "max_retries_interval": 6,
108
+                "freezer_action": {
109
+                    "backup_name": "test0002_backup",
110
+                    "storage": "ftp",
111
+                    "ftp_host": "192.177.10.44",
112
+                    "ftp_username": "ftptest",
113
+                    "ftp_password": "pass_test",
114
+                    "ftp_port": 21,
115
+                    "container": "/home/ftptest",
116
+                    "no_incremental": true,
117
+                    "path_to_backup": "/etc/",
118
+                    "log_file": "/home/ftp_data/job0002.log",
119
+                    "snapshot": true,
120
+                    "action": "backup",
121
+                    "remove_older_than": 10,
122
+                }
123
+            }
124
+        ]
125
+    }
126
+
127
+* Specifying the storage as ftps, the request Example
128
+  in creating job as follows::
129
+
130
+    {
131
+        "description": "Test-0001",
132
+        "job_schedule": {
133
+            "schedule_interval": "5 minutes",
134
+            "status": "scheduled",
135
+            "event": "start"
136
+        },
137
+        "job_actions": [
138
+            {
139
+                "max_retries": 5,
140
+                "max_retries_interval": 6,
141
+                "freezer_action": {
142
+                    "backup_name": "test0003_backup",
143
+                    "storage": "sftp",
144
+                    "ftp_host": "192.177.10.44",
145
+                    "ftp_username": "ftptest",
146
+                    "ftp_password": "pass_test",
147
+                    "ftp_port": 22,
148
+                    "container": "/home/sftptest",
149
+                    "no_incremental": true,
150
+                    "path_to_backup": "/etc/",
151
+                    "log_file": "/home/ftp_data/job0003.log",
152
+                    "snapshot": true,
153
+                    "action": "backup",
154
+                    "remove_older_than": 10,
155
+                }
156
+            }
157
+        ]
158
+    }
159
+
160
+Security impact
161
+---------------
162
+None
163
+
164
+Notifications impact
165
+--------------------
166
+Some message log will be added.
167
+
168
+Other end user impact
169
+---------------------
170
+* Add these parammeters as follows in freezer-agent::
171
+  ftp_host
172
+  ftp_username
173
+  ftp_password
174
+  ftp_port
175
+
176
+* usecase in freezer-agent using ftp as storage::
177
+   sudo freezer-agent --path-to-backup /data/dir/to/backup
178
+   --container /remote-machine-path/ --backup-name my-backup-name
179
+   --storage ftp --ftp-username ftpuser --ftp-password passwd_test
180
+   --ftp-host 8.8.8.8 --ftp-port 82
181
+
182
+* usecase in freezer-agent using ftps as storage::
183
+   sudo freezer-agent --path-to-backup /data/dir/to/backup
184
+   --container /remote-machine-path/ --backup-name my-backup-name
185
+   --storage ftps --ftp-username ftpuser --ftp-password passwd_test
186
+   --ftp-host 8.8.8.8 --ftp-port 82
187
+
188
+* usecase in freezer-agent using sftp as storage::
189
+   sudo freezer-agent --path-to-backup /data/dir/to/backup
190
+   --container /remote-machine-path/ --backup-name my-backup-name
191
+   --storage sftp --ftp-username ftpuser --ftp-password passwd_test
192
+   --ftp-host 8.8.8.8 --ftp-port 82
193
+
194
+Performance Impact
195
+------------------
196
+None
197
+
198
+Other deployer impact
199
+---------------------
200
+
201
+Developer impact
202
+----------------
203
+None
204
+
205
+Implementation
206
+==============
207
+Assignee(s)
208
+-----------
209
+
210
+Primary assignee:
211
+  gengchc2<geng.changcai2@zte.com.cn>
212
+  gecong <ge.cong@zte.com.cn>
213
+
214
+Work Items
215
+----------
216
+
217
+* Implementing ftp storage in freezer
218
+
219
+* Implementing ftps storage in freezer
220
+
221
+* Implementing sftp storage in freezer
222
+
223
+* Adding these parameters ftp_host, ftp_username, ftp_password, ftp_port in
224
+freezer-agent
225
+
226
+Dependencies
227
+============
228
+None
229
+
230
+Testing
231
+=======
232
+add unit test
233
+
234
+Documentation Impact
235
+====================
236
+Some instructions should be added.
237
+
238
+References
239
+==========
240
+None
241
+
242
+History
243
+=======
244
+None

Loading…
Cancel
Save