ceph/qa/workunits/rbd/verify_pool.sh
Mykola Golub fcaffe7e01 qa/workunits/rbd: pool create may fail for small cluster
ceph osd pool create test 100
Error ERANGE:  pg_num 100 size 3 would mean 648 total pgs, which exceeds max 600 (mon_max_pg_per_osd 200 * num_in_osds 3)

Signed-off-by: Mykola Golub <to.my.trociny@gmail.com>
2017-10-01 16:36:17 +02:00

28 lines
605 B
Bash
Executable File

#!/bin/sh -ex
POOL_NAME=rbd_test_validate_pool
PG_NUM=32
tear_down () {
ceph osd pool delete $POOL_NAME $POOL_NAME --yes-i-really-really-mean-it || true
}
set_up () {
tear_down
ceph osd pool create $POOL_NAME $PG_NUM
ceph osd pool mksnap $POOL_NAME snap
rbd pool init $POOL_NAME
}
trap tear_down EXIT HUP INT
set_up
# creating an image in a pool-managed snapshot pool should fail
rbd create --pool $POOL_NAME --size 1 foo && exit 1 || true
# should succeed if images already exist in the pool
rados --pool $POOL_NAME create rbd_directory
rbd create --pool $POOL_NAME --size 1 foo
echo OK