Changes

Jump to: navigation, search

stoney conductor: VM Backup

1,784 bytes added, 14:37, 22 October 2013
/* Backup multiple machines at the same time */
== Backup multiple machines at the same time ==
For each When backing up multiple machines at the same time, we need to make sure that the downtime for the machines are as close together as possible. Therefore the control instance should call first the snapshot process for all machines. After every machine has been snapshotted, the control instance can call the merge and retain process for every machine. The most important part here is, that the control instance somehow remembers, if the snapshotfor a given machine was successful or not. Because if the snapshot failed, it must not call the merge and retain process. So the control instance needs a little bit more logic:
For each machine call merge -<source lang="c"> retain object machines[] = args[0];object successful_snapshots[];
...# Snapshot all machinesfor( int i = 0; i < sizeof(machines) / sizeof*(object) ; i++ ){ # If the snapshot was successful, put the machine into the # successful_snapshots array if ( snapshot( machines[i] ) ) { successful_snapshots[machines[i]]; } else { printf("Error while snapshotting machine %s: %s\n, machines[i],error); }} # Merge and reatin all successful_snapshot machinesfor ( int i = 0; i < sizeof(successful_snapshots) / sizeof*(object) ; i++ ) ){ # Check if the element at this position is not null, then the snapshot # for this machine was successful if ( successful_snapshots[i] ) { if ( merge( successful_snapshots[i] ) ) { if ( retain( successful_snapshots[i] ) ) { printf("Successfully backed-up machine %s", sucessful_snapshots[i]); } else { printf("Error while retaining machine %s: %s\n, sucessful_snapshots[i],error); }  } else { printf("Error while merging machine %s: %s\n, sucessful_snapshots[i],error); } }}</source>
== Sub-Processes ==
486
edits