Safe check for volume create during ceph deploy 21/2121/1
authorgrakiss <grakiss.wanglei@huawei.com>
Wed, 30 Sep 2015 03:11:43 +0000 (11:11 +0800)
committergrakiss <grakiss.wanglei@huawei.com>
Wed, 30 Sep 2015 03:11:43 +0000 (11:11 +0800)
JIRA: COMPASS-84

- prevent from commands hanging during last deploy

Change-Id: I2553f91ab6948dfb1841768b2f40533fe09fc45e
Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh

index 7a6cc1e..b5c9da3 100644 (file)
@@ -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