1 |
dpavlin |
262 |
#!/bin/sh -xe |
2 |
|
|
|
3 |
|
|
lxc-ls | xargs -i sh -c "lxc-stop -n {} ; lxc-destroy -n {}" |
4 |
|
|
|
5 |
|
|
echo "lxc.network.type = empty" > blkio.conf |
6 |
|
|
|
7 |
|
|
PATH=$(pwd):$PATH lxc-create -f blkio.conf -t busybox -n disk1 |
8 |
|
|
PATH=$(pwd):$PATH lxc-create -f blkio.conf -t busybox -n disk2 |
9 |
|
|
PATH=$(pwd):$PATH lxc-create -f blkio.conf -t busybox -n disk3 |
10 |
|
|
|
11 |
|
|
lxc-ls | xargs -i dd if=/dev/zero of=/var/lib/lxc/{}/rootfs/tmp/zero bs=1M count=100 |
12 |
|
|
|
13 |
|
|
cat > /tmp/speed.sh <<EOF |
14 |
|
|
#!/bin/sh |
15 |
|
|
while true ; do |
16 |
|
|
sync ; echo 3 > /proc/sys/vm/drop_caches |
17 |
|
|
dd if=/tmp/zero of=/dev/null 2>&1 |
18 |
|
|
done | grep MB |
19 |
|
|
EOF |
20 |
|
|
|
21 |
|
|
chmod +x /tmp/speed.sh |
22 |
|
|
|
23 |
|
|
lxc-ls | xargs -i cp /tmp/speed.sh /var/lib/lxc/{}/rootfs/tmp/speed.sh |
24 |
|
|
|
25 |
|
|
lxc-ls | xargs -i lxc-start -d -n {} |
26 |
|
|
|