-
Notifications
You must be signed in to change notification settings - Fork 3
/
run_migration.sh
executable file
·60 lines (57 loc) · 1.15 KB
/
run_migration.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
set -euo pipefail
# defaults
STAGE="false"
SRC_MIGCLUSTER_REF="benchmark-src"
MIGSTORAGE_REF="benchmark-storage"
ACTION="copy"
COPY_METHOD="filesystem"
while [ -n "${1-}" ]
do
case "$1" in
--scenario)
SCENARIO="$2"
shift
;;
--source)
SRC_MIGCLUSTER_REF="$2"
shift
;;
--src-sc)
SRC_STORAGE_CLASS="$2"
shift
;;
--dest-sc)
DEST_STORAGE_CLASS="$2"
shift
;;
--storage)
MIGSTORAGE_REF="$2"
shift
;;
--copy-method)
COPY_METHOD="$2"
shift
;;
--action)
ACTION="$2"
shift
;;
--size)
SIZE="$2"
shift
;;
--stage)
STAGE="true"
;;
*) break;;
esac
shift
done
oc project openshift-migration
oc process -f templates/migration_resources.json -p BENCHMARK_NAME=mig-pv-benchmark-$SCENARIO-$SRC_STORAGE_CLASS-${SIZE,,} \
SRC_MIGCLUSTER_REF=$SRC_MIGCLUSTER_REF DEST_MIGCLUSTER_REF=host \
MIGSTORAGE_REF=$MIGSTORAGE_REF VOLUME_CAPACITY=$SIZE \
SRC_STORAGE_CLASS=$SRC_STORAGE_CLASS DEST_STORAGE_CLASS=$DEST_STORAGE_CLASS \
VOLUME_ACTION=$ACTION COPY_METHOD=$COPY_METHOD STAGE=$STAGE \
| oc create -f -