Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / rbd / rbd-replay.rst
1 ===================
2  RBD Replay
3 ===================
4
5 .. index:: Ceph Block Device; RBD Replay
6
7 RBD Replay is a set of tools for capturing and replaying Rados Block Device
8 (RBD) workloads. To capture an RBD workload, ``lttng-tools`` must be installed
9 on the client, and ``librbd`` on the client must be the v0.87 (Giant) release 
10 or later. To replay an RBD workload, ``librbd`` on the client must be the Giant
11 release or later.
12
13 Capture and replay takes three steps:
14
15 #. Capture the trace.  Make sure to capture ``pthread_id`` context::
16
17     mkdir -p traces
18     lttng create -o traces librbd
19     lttng enable-event -u 'librbd:*'
20     lttng add-context -u -t pthread_id
21     lttng start
22     # run RBD workload here
23     lttng stop
24
25 #. Process the trace with `rbd-replay-prep`_::
26
27     rbd-replay-prep traces/ust/uid/*/* replay.bin
28
29 #. Replay the trace with `rbd-replay`_. Use read-only until you know 
30    it's doing what you want::
31
32     rbd-replay --read-only replay.bin
33
34 .. important:: ``rbd-replay`` will destroy data by default.  Do not use against 
35    an image you wish to keep, unless you use the ``--read-only`` option.
36
37 The replayed workload does not have to be against the same RBD image or even the
38 same cluster as the captured workload. To account for differences, you may need
39 to use the ``--pool`` and ``--map-image`` options of ``rbd-replay``.
40
41 .. _rbd-replay: ../../man/8/rbd-replay
42 .. _rbd-replay-prep: ../../man/8/rbd-replay-prep