Bug #59728
Updated by Christopher Hoffman 10 months ago
Initially just an integration test for https://tracker.ceph.com/issues/59393. Might be expanded in the future to vary injected latency, take measurements and assert on results according to the model.
Script to apply latency to NIC+destination IP
NIC=enp1s0
function apply() {
tc qdisc add dev ${NIC} root handle 1: prio priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
tc qdisc add dev ${NIC} parent 1:2 handle 20: netem delay 0ms
tc filter add dev ${NIC} parent 1:0 protocol ip u32 match ip src `hostname -I` flowid 1:2
tc qdisc add dev ${NIC} parent 1:1 handle 10: netem delay 151ms
#NODES should be IPs of remote cluster you want to
#inject latency to. Include IPs for Mgr, Mon, Osd, etc
NODES=( 8.8.8.8 184.50.33.11 )
for i in ${NODES[@]}
do
tc filter add dev ${NIC} parent 1:0 protocol ip prio 1 u32 match ip dst ${i} flowid 1:1
done
}
function cleanup() {
tc qdisc del dev ${NIC} root
}
cleanup
apply