From 9a95593b0c8cdefb6ad4a3c836b699f42b1f7323 Mon Sep 17 00:00:00 2001 From: grakiss Date: Wed, 30 Sep 2015 11:11:43 +0800 Subject: 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 --- deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'deploy') 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 -- cgit 1.2.3-korg