summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/ceph-deploy/files
diff options
context:
space:
mode:
authorgrakiss <grakiss.wanglei@huawei.com>2015-09-30 11:11:43 +0800
committergrakiss <grakiss.wanglei@huawei.com>2015-09-30 11:11:43 +0800
commit9a95593b0c8cdefb6ad4a3c836b699f42b1f7323 (patch)
tree4ef72242c4010289a03b168dd6ab0530bc2957c4 /deploy/adapters/ansible/roles/ceph-deploy/files
parent26cf98c381bbfc4980ff7041617cf64849bc9df4 (diff)
Safe check for volume create during ceph deploy
JIRA: COMPASS-84 - prevent from commands hanging during last deploy Change-Id: I2553f91ab6948dfb1841768b2f40533fe09fc45e Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/ceph-deploy/files')
-rw-r--r--deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh b/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh
index 7a6cc1e2..b5c9da3b 100644
--- a/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh
+++ b/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh
@@ -17,6 +17,13 @@ dd if=/dev/zero of=/ceph/images/ceph-volumes.img bs=1M seek=12288 count=0 oflag=
sgdisk -g --clear /ceph/images/ceph-volumes.img
fi
+#safe check
+ps -ef |grep create_osd.sh |awk '{print $2}' |xargs kill -9
+ps -ef |grep lvremove |awk '{print $2}' |xargs kill -9
+ps -ef |grep vgremove |awk '{print $2}' |xargs kill -9
+ps -ef |grep vgcreate |awk '{print $2}' |xargs kill -9
+ps -ef |grep lvcreate |awk '{print $2}' |xargs kill -9
+
if [ -L "/dev/ceph-volumes/ceph0" ]; then
echo "remove lv vg"
lvremove -f /dev/ceph-volumes/ceph0