Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / qa / qa_scripts / openstack / execs / ceph-pool-create.sh
1 #!/bin/bash -f
2 #
3 # On the ceph site, make the pools required for Openstack
4 #
5
6 #
7 # Make a pool, if it does not already exist.
8 #
9 function make_pool {
10     if [[ -z `sudo ceph osd lspools | grep " $1,"` ]]; then
11         echo "making $1"
12         sudo ceph osd pool create $1 128
13     fi
14 }
15
16 #
17 # Make sure the pg_num and pgp_num values are good.
18 #
19 count=`sudo ceph osd pool get rbd pg_num | sed 's/pg_num: //'`
20 while [ $count -lt 128 ]; do
21     sudo ceph osd pool set rbd pg_num $count
22     count=`expr $count + 32`
23     sleep 30
24 done
25 sudo ceph osd pool set rbd pg_num 128
26 sleep 30
27 sudo ceph osd pool set rbd pgp_num 128
28 sleep 30
29 make_pool volumes
30 make_pool images
31 make_pool backups
32 make_pool vms