#!/bin/bash # Copyright 2010-2012 Thomas Schoebel-Theuer / 1&1 Internet AG # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. ##################################################################### ## defaults for module create_lv ## ## create_lv: before filling all devices with random data, (re)create your LVs ## ## ATTENTION! Always use this module when running benchmarks on ## virtualized storage! ## ## Read the section about "Pitfalls from Storage Virtualization" ## in https://github.com/schoebel/blkreplay/raw/master/doc/blkreplay.pdf ## ## You *MUST* delete and re-create your LVs at every run on commercial ## storage boxes as well as other virtualized storage! ## enable_create_lv ## ## Set to 0 or 1. Enable / disable this module. enable_create_lv=0 # implement the next function such that it can be called twice # (even when no LVs exist any more) without causing errors. # # However, in case of errors just "return 1" to signal it! function delete_lv { echo "$FUNCNAME deleting all your LVs" # ensure that nothing can go wrong any more... replay_host_list="" # put in your code here # ... if (( failure )); then echo "Sorry. Some devices are left over. Remove them by hand!" return 1 fi # success return 0 } # this should also signal success by the return code. function create_lv { echo "$FUNCNAME creating all your LVs" # put in your code here # ... if (( failure )); then echo "Sorry. Setup failed." return 1 fi # upon success: tell which devices can be used. replay_host_list="yourhost1:/dev/device1 yourhost2:/dev/device2" echo "replay_host_list='$replay_host_list'" return 0 }