forked from fultonj/tripleo-ceph-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsanity-check.sh
executable file
·59 lines (50 loc) · 1.7 KB
/
sanity-check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
OVERALL=1
CINDER=0
GLANCE=0
source ~/oooq/overcloudrc
if [ $OVERALL -eq 1 ]; then
echo " --------- ceph df --------- "
ansible mons -b -m shell -a "ceph df"
echo " --------- ceph health --------- "
ansible mons -b -m shell -a "ceph health"
echo " --------- ceph pg stat --------- "
ansible mons -b -m shell -a "ceph pg stat"
fi
if [ $CINDER -eq 1 ]; then
echo " --------- Ceph cinder volumes pool --------- "
ansible mons -b -m shell -a "rbd -p volumes ls -l"
openstack volume list
echo "Creating 20G Cinder volume"
openstack volume create --size 20 test-volume
sleep 30
echo "Listing Cinder Ceph Pool and Volume List"
openstack volume list
ansible $mon -b -m shell -a "rbd -p volumes ls -l"
fi
if [ $GLANCE -eq 1 ]; then
img=cirros-0.3.4-x86_64-disk.img
raw=$(echo $img | sed s/img/raw/g)
url=http://download.cirros-cloud.net/0.3.4/$img
if [ ! -f $raw ]; then
if [ ! -f $img ]; then
echo "Could not find qemu image $img; downloading a copy."
curl -# $url > $img
fi
echo "Could not find raw image $raw; converting."
qemu-img convert -f qcow2 -O raw $img $raw
fi
echo " --------- Ceph images pool --------- "
echo "Listing Glance Ceph Pool and Image List"
ansible mons -b -m shell -a "rbd -p images ls -l"
openstack image list
echo "Importing $raw image into Glance"
openstack image create cirros --disk-format=raw --container-format=bare < $raw
if [ ! $? -eq 0 ]; then
echo "Could not import $raw image. Aborting";
exit 1;
fi
echo "Listing Glance Ceph Pool and Image List"
ansible $mon -b -m shell -a "rbd -p images ls -l"
openstack image list
fi