Commit 5be1910
committed
refactor(backup): per-volume parent paths for incremental NAS backup
Address abh1sar's review at NASBackupProvider.java:340 — backup files on the
NAS are named after each volume's own UUID (root.<uuid>.qcow2 and
datadisk.<uuid>.qcow2), so a single parentPath shared across every disk in
the loop would have rebased every data disk's new qcow2 onto the *root*
parent file. Mirroring how RestoreBackupCommand passes a list of per-volume
backup files, TakeBackupCommand now carries a parentPaths list (one per VM
volume in deviceId order) and the script rebases each disk against the
matching entry.
Wire changes:
* TakeBackupCommand: replace parentPath:String with parentPaths:List<String>
* LibvirtTakeBackupCommandWrapper: pass --parent-paths <csv> (was --parent-path)
* nasbackup.sh: parse --parent-paths into an array, index by disk position
in the rebase loop, fail loudly if the list is shorter than DISK_PATHS
* NASBackupProvider: new composeParentBackupPaths(parent, vmId) reads the
parent's backedUpVolumes list (uuid order = deviceId order at parent time)
and emits the correctly-named file per position. Returns null when the
current VM's volume count differs from the parent — decideChain then
falls back to a fresh full rather than risk a misaligned rebase.
* ChainDecision: parentPath:String -> parentPaths:List<String>
All 14 unit tests still pass. The bash script's --parent-path arg is
renamed to --parent-paths (no orchestrator outside this PR ever populated
the old single-path arg, so no compatibility shim needed).1 parent 0bdcdb1 commit 5be1910
4 files changed
Lines changed: 112 additions & 42 deletions
File tree
- core/src/main/java/org/apache/cloudstack/backup
- plugins
- backup/nas/src/main/java/org/apache/cloudstack/backup
- hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper
- scripts/vm/hypervisor/kvm
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
136 | 142 | | |
137 | 143 | | |
138 | 144 | | |
139 | | - | |
140 | | - | |
| 145 | + | |
| 146 | + | |
141 | 147 | | |
142 | 148 | | |
143 | | - | |
144 | | - | |
| 149 | + | |
| 150 | + | |
145 | 151 | | |
146 | 152 | | |
147 | 153 | | |
| |||
Lines changed: 71 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
219 | | - | |
| 223 | + | |
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
| |||
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
229 | | - | |
| 233 | + | |
230 | 234 | | |
231 | 235 | | |
232 | | - | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
305 | 309 | | |
306 | 310 | | |
307 | 311 | | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
313 | 324 | | |
314 | 325 | | |
315 | 326 | | |
| |||
353 | 364 | | |
354 | 365 | | |
355 | 366 | | |
356 | | - | |
357 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
358 | 377 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
365 | 412 | | |
366 | 413 | | |
367 | 414 | | |
| |||
479 | 526 | | |
480 | 527 | | |
481 | 528 | | |
482 | | - | |
| 529 | + | |
483 | 530 | | |
484 | 531 | | |
485 | 532 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
131 | | - | |
132 | | - | |
| 135 | + | |
| 136 | + | |
133 | 137 | | |
134 | 138 | | |
135 | 139 | | |
| |||
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
281 | 292 | | |
282 | 293 | | |
283 | 294 | | |
284 | 295 | | |
285 | 296 | | |
286 | 297 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
292 | 308 | | |
293 | 309 | | |
294 | 310 | | |
| |||
302 | 318 | | |
303 | 319 | | |
304 | 320 | | |
| 321 | + | |
305 | 322 | | |
306 | 323 | | |
307 | 324 | | |
| |||
556 | 573 | | |
557 | 574 | | |
558 | 575 | | |
559 | | - | |
560 | | - | |
| 576 | + | |
| 577 | + | |
561 | 578 | | |
562 | 579 | | |
563 | 580 | | |
| |||
0 commit comments