| 1 |
// FIXME: Original design document needs a lot of rework |
| 2 |
|
| 3 |
= Design concepts |
| 4 |
Schlomo Schapiro, Gratien D'haese, Dag Wieers |
| 5 |
|
| 6 |
== The Workflow System |
| 7 |
Relax-and-Recover is built as a modular framework. A call of +rear <command>+ |
| 8 |
will invoke the following general workflow: |
| 9 |
|
| 10 |
1. *Configuration:* Collect system information to assemble a correct |
| 11 |
configuration (default, arch, OS, OS_ARCH, OS_VER, site, local). |
| 12 |
See the output of +rear dump+ for an example. |
| 13 |
+ |
| 14 |
Read config files for the combination of system attributes. Always |
| 15 |
read 'default.conf' first and 'site.conf', 'local.conf' last. |
| 16 |
|
| 17 |
2. Create work area in '/tmp/rear.$$/' and start logging to |
| 18 |
'/var/log/rear/rear-hostname.log' |
| 19 |
|
| 20 |
3. Run the workflow script for the specified command: |
| 21 |
'/usr/share/rear/lib/<command>-workflow.sh' |
| 22 |
|
| 23 |
4. Cleanup work area |
| 24 |
|
| 25 |
== Workflow - Make Rescue Media |
| 26 |
The application will have the following general workflow which is represented |
| 27 |
by appropriately named scripts in various subdirectories: |
| 28 |
|
| 29 |
1. *Prep:* Prepare the build area by copying a skeleton filesystem layout. |
| 30 |
This can also come from various sources (FS layout for arch, OS, OS_VER, |
| 31 |
Backup-SW, Output, ...) |
| 32 |
|
| 33 |
2. *Analyse disklayout*: Analyse the system disklayout to create the '/var/lib/rear/layout/' data |
| 34 |
|
| 35 |
3. *Analyse (Rescue):* Analyse the system to create the rescue system |
| 36 |
(network, binary dependencies, ...) |
| 37 |
|
| 38 |
4. *Build:* Build the rescue image by copying together everything required |
| 39 |
|
| 40 |
5. *Pack:* Package the kernel and initrd image together |
| 41 |
|
| 42 |
6. *Backup:* (Optionally) run the backup software to create a current backup |
| 43 |
|
| 44 |
7. *Output:* Copy / Install the rescue system (kernel+initrd+(optionally) |
| 45 |
backups) into the target environment (e.g. PXE boot, write on tape, |
| 46 |
write on CD/DVD) |
| 47 |
|
| 48 |
8. *Cleanup:* Cleanup the build area from temporary files |
| 49 |
|
| 50 |
The configuration must define the +BACKUP+ and +OUTPUT+ methods. Valid choices are: |
| 51 |
|
| 52 |
|==== |
| 53 |
|NAME | TYPE | Description | Implement in Phase |
| 54 |
|AVA | BACKUP | Dell EMC Avamar / EMC Avamar | done |
| 55 |
|BACULA | BACKUP | Bacula | done |
| 56 |
|BAREOS | BACKUP | Bareos | done |
| 57 |
|BLOCKCLONE | BACKUP | Block device cloning via dd | done |
| 58 |
|BORG | BACKUP | Borg Backup | done |
| 59 |
|CDM | BACKUP | Rubrik Cloud Data Management | done |
| 60 |
|DP | BACKUP | OpenText Data Protector | done |
| 61 |
|DUPLICITY | BACKUP | Duplicity / Duply | done |
| 62 |
|EXTERNAL | BACKUP | External custom restore method | done |
| 63 |
|FDRUPSTREAM | BACKUP | FDR/Upstream | done |
| 64 |
|GALAXY11 | BACKUP | Commvault Galaxy 11 / Commvault Simpana | done |
| 65 |
|NBKDC | BACKUP | NovaStor DataCenter | done |
| 66 |
|NBU | BACKUP | Veritas NetBackup / Symantec NetBackup | done |
| 67 |
|NETFS | BACKUP | ReaR built-in backup and restore via rsync or tar to a network file system or to a locally attached backup disk (USB, eSATA, ...)| done |
| 68 |
|NFS4SERVER | BACKUP | NFS4 server to push data to the rescue system| done |
| 69 |
|NSR | BACKUP | Dell EMC NetWorker / EMC NetWorker / Legato NetWorker| done |
| 70 |
|OBDR | BACKUP | One Button Disaster Recovery via tape | done |
| 71 |
|PPDM | BACKUP | Dell PowerProtect Data Manager | done |
| 72 |
|RBME | BACKUP | Rsync Backup Made Easy | done |
| 73 |
|REQUESTRESTORE| BACKUP| Request restore from a human operator | done |
| 74 |
|RSYNC | BACKUP | ReaR built-in backup using rsync via rsync or ssh protocol| done |
| 75 |
|SESAM | BACKUP | SEP Sesam | done |
| 76 |
|TSM | BACKUP | IBM Storage Protect / Tivoli Storage Manager / IBM Spectrum Protect| done |
| 77 |
|VEEAM | BACKUP | Veeam Backup | done |
| 78 |
| | | | |
| 79 |
|ISO | OUTPUT | Write result to ISO9660 image | done |
| 80 |
|OBDR | OUTPUT | Create OBDR Tape | done |
| 81 |
|PXE | OUTPUT | Create PXE bootable files on TFTP server | done |
| 82 |
|USB | OUTPUT | Create bootable USB device | done |
| 83 |
|==== |
| 84 |
|
| 85 |
== Workflow - Recovery |
| 86 |
The result of the analysis is written into configuration files under |
| 87 |
'/etc/rear/recovery/'. This directory is copied together with the other |
| 88 |
Relax-and-Recover directories onto the rescue system where the same |
| 89 |
framework runs a different workflow - the recovery workflow. |
| 90 |
|
| 91 |
The recovery workflow consists of these parts (identically named modules |
| 92 |
are indeed the same): |
| 93 |
|
| 94 |
1. *Config:* By utilizing the same configuration module, the same |
| 95 |
configuration variable are available for the recovery, too. |
| 96 |
This makes writing pairs of backup/restore modules much easier. |
| 97 |
|
| 98 |
2. *Verify:* Verify the integrity and sanity of the recovery data and |
| 99 |
check the hardware found to determine, whether a recovery will be |
| 100 |
likely to succeed. If not, then we abort the workflow so as not to |
| 101 |
touch the hard disks if we don't believe that we would manage to |
| 102 |
successfully recover the system on this hardware. |
| 103 |
|
| 104 |
3. *Recreate:* Recreate the FS layout (partitioning, LVM, raid, |
| 105 |
filesystems, ...) and mount it under /mnt/local |
| 106 |
|
| 107 |
4. *Restore:* Restore files and directories from the backup to '/mnt/local/'. |
| 108 |
This module is the analog to the Backup module |
| 109 |
|
| 110 |
5. *Finalize:* Install boot loader, finalize system, dump recovery log |
| 111 |
onto '/var/log/rear/' in the recovered system. |
| 112 |
|
| 113 |
== FS layout |
| 114 |
Relax-and-Recover tries to be as much LSB compliant as possible. Therefore ReaR will be |
| 115 |
installed into the usual locations: |
| 116 |
|
| 117 |
/etc/rear/:: |
| 118 |
Configurations |
| 119 |
|
| 120 |
/usr/sbin/rear:: |
| 121 |
Main program |
| 122 |
|
| 123 |
/usr/share/rear/:: |
| 124 |
Internal scripts |
| 125 |
|
| 126 |
/tmp/rear.$$/:: |
| 127 |
Build area |
| 128 |
|
| 129 |
=== Layout of /etc/rear |
| 130 |
default.conf:: |
| 131 |
Default configuration - will define EVERY variable with a sane default |
| 132 |
setting. Serves also as a reference for the available variables 'site.conf' |
| 133 |
site wide configuration (optional) |
| 134 |
|
| 135 |
local.conf:: |
| 136 |
local machine configuration (optional) |
| 137 |
|
| 138 |
$(uname -s)-$(uname -i).conf:: |
| 139 |
architecture specific configuration (optional) |
| 140 |
|
| 141 |
$(uname -o).conf:: |
| 142 |
OS system (e.g. GNU/Linux.conf) (optional) |
| 143 |
|
| 144 |
$OS/$OS_VER.conf:: |
| 145 |
OS and OS Version specific configuration (optional) |
| 146 |
|
| 147 |
templates/:: |
| 148 |
Directory to keep user-changeable templates for various files used |
| 149 |
or generated |
| 150 |
|
| 151 |
templates/PXE_per_node_config:: |
| 152 |
template for pxelinux.cfg per-node configurations |
| 153 |
|
| 154 |
templates/CDROM_isolinux.cfg:: |
| 155 |
isolinux.cfg template |
| 156 |
|
| 157 |
templates/...:: |
| 158 |
other templates as the need arises |
| 159 |
|
| 160 |
recovery/...:: |
| 161 |
Recovery information |
| 162 |
|
| 163 |
=== Layout of /usr/share/rear |
| 164 |
skel/default/:: |
| 165 |
default rescue FS skeleton |
| 166 |
|
| 167 |
skel/$(uname -i)/:: |
| 168 |
arch specific rescue FS skeleton (optional) |
| 169 |
|
| 170 |
skel/$OS_$OS_VER/:: |
| 171 |
OS-specific rescue FS skeleton (optional) |
| 172 |
|
| 173 |
skel/$BACKUP/:: |
| 174 |
Backup-SW specific rescue FS skeleton (optional) |
| 175 |
|
| 176 |
skel/$OUTPUT/:: |
| 177 |
Output-Method specific rescue FS skeleton (optional) |
| 178 |
|
| 179 |
lib/*.sh:: |
| 180 |
function definitions, split into files by their topic |
| 181 |
|
| 182 |
prep/default/*.sh:: |
| 183 |
prep/$(uname -i)/*.sh:: |
| 184 |
prep/$OS_$OS_VER/*.sh:: |
| 185 |
prep/$BACKUP/*.sh:: |
| 186 |
prep/$OUTPUT/*.sh:: |
| 187 |
Prep scripts. The scripts get merged from the applicable directories |
| 188 |
and executed in their alphabetical order. Naming conventions are: |
| 189 |
+ |
| 190 |
##_name.sh |
| 191 |
+ |
| 192 |
where 00 < ## < 99 |
| 193 |
|
| 194 |
layout/compare/default/:: |
| 195 |
layout/compare/$OS_$OS_VER/:: |
| 196 |
Scripts to compare the saved layout (under /var/lib/rear/layout/) with the actual situation. This is used by workflow *rear checklayout* and may trigger a new run of *rear mkrescue* or *rear mkbackup* |
| 197 |
|
| 198 |
layout/precompare/default/:: |
| 199 |
layout/precompare/$OS_$OS_VER/:: |
| 200 |
|
| 201 |
layout/prepare/default/:: |
| 202 |
layout/prepare/$OS_$OS_VER/:: |
| 203 |
|
| 204 |
layout/recreate/default/:: |
| 205 |
layout/recreate/$OS_$OS_VER/:: |
| 206 |
|
| 207 |
layout/save/default/:: |
| 208 |
layout/save/$OS_$OS_VER/:: |
| 209 |
Scripts to capture the disk layout and write it into /var/lib/rear/layout/ directory |
| 210 |
|
| 211 |
rescue/...:: |
| 212 |
Analyse-Rescue scripts: ... |
| 213 |
|
| 214 |
build/...:: |
| 215 |
Build scripts: ... |
| 216 |
|
| 217 |
pack/...:: |
| 218 |
Pack scripts: ... |
| 219 |
|
| 220 |
backup/$BACKUP/*.sh:: |
| 221 |
Backup scripts: ... |
| 222 |
|
| 223 |
output/$OUTPUT/*.sh:: |
| 224 |
Output scripts: ... |
| 225 |
|
| 226 |
verify/...:: |
| 227 |
Verify the recovery data against the hardware found, whether we can |
| 228 |
successfully recover the system |
| 229 |
|
| 230 |
recreate/...:: |
| 231 |
Recreate file systems and their dependencies |
| 232 |
|
| 233 |
restore/$BACKUP/...:: |
| 234 |
Restore data from backup media |
| 235 |
|
| 236 |
finalize/...:: |
| 237 |
Finalization scripts |
| 238 |
|
| 239 |
== Inter-module communication |
| 240 |
The various stages and modules communicate via standardized environment variables: |
| 241 |
|
| 242 |
|==== |
| 243 |
|NAME |TYPE |Descriptions |Example |
| 244 |
|CONFIG_DIR |STRING (RO) |Configuration dir |'/etc/rear/' |
| 245 |
|SHARE_DIR |STRING (RO) |Shared data dir |'/usr/share/rear/' |
| 246 |
|BUILD_DIR |STRING (RO) |Build directory |'/tmp/rear.$$/' |
| 247 |
|ROOTFS_DIR |STRING (RO) |Root FS directory for rescue system |'/tmp/rear.$$/initrd/' |
| 248 |
|TARGET_FS_ROOT |STRING (RO) |Directory for restore |'/mnt/local' |
| 249 |
|PROGS |LIST |Program files to copy |+bash ip route grep ls+ ... |
| 250 |
|MODULES |LIST |Modules to copy |+af_unix e1000 ide-cd+ ... |
| 251 |
|COPY_AS_IS |LIST |Files (with path) to copy as-is |'/etc/localtime' ... |
| •252 |
||||.... |
| 253 |
|==== |
| 254 |
|
| 255 |
RO means that the framework manages this variable and modules and methods shouldn't change it. |
| 256 |
|
| 257 |
== Major changes compared with mkCDrec |
| 258 |
|
| 259 |
- No Makefiles |
| 260 |
- Major script called xxx that arranges all |
| 261 |
- Simplify the testing and configuration |
| 262 |
- Being less verbose |
| 263 |
- Better control over echo to screen, log file or debugging |
| 264 |
- Less color |
| 265 |
- Easier integration with third party software (GPL or commercial) |
| 266 |
- Modular and plug-ins should be easy for end-users |
| 267 |
- Better documentation for developers |
| 268 |
- Cut the overhead - less is better |
| 269 |
- Less choices (=> less errors) |
| 270 |
|
| 271 |
- **mkCDrec project is obsolete** |
| 272 |
|