summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdeploy/check_os_progress.sh12
-rwxr-xr-xtools/daisy-img-modify.sh14
2 files changed, 21 insertions, 5 deletions
diff --git a/deploy/check_os_progress.sh b/deploy/check_os_progress.sh
index b7b05700..30226844 100755
--- a/deploy/check_os_progress.sh
+++ b/deploy/check_os_progress.sh
@@ -40,13 +40,19 @@ hosts_id=`daisy host-list | awk -F "|" '{print $2}'| grep -o "[^ ]\+\( \+[^ ]\+\
skip=false
if [ $deploy_env == 0 ];then
skip=true
+ for host_id in $hosts_id
+ do
+ echo "detail info of host $host_id:"
+ daisy host-detail $host_id
+ done
+else
for host_id in $hosts_id;
do
- echo "update host $host_id ipmi user and passwd"
- daisy host-update $host_id --ipmi-user zteroot --ipmi-passwd superuser
+ echo "update host $host_id ipmi user and passwd"
+ daisy host-update $host_id --ipmi-user zteroot --ipmi-passwd superuser
done
+ echo "update all hosts ipmi user and passwd ok!"
fi
-echo "update all hosts ipmi user and passwd ok!"
echo "run daisy install command"
daisy install $cluster_id --skip-pxe-ipmi $skip
diff --git a/tools/daisy-img-modify.sh b/tools/daisy-img-modify.sh
index 60b60d26..8e025168 100755
--- a/tools/daisy-img-modify.sh
+++ b/tools/daisy-img-modify.sh
@@ -135,6 +135,16 @@ install_utils()
fi
}
+# Eliminate exceptions
+eliminate()
+{
+ if [ -b /dev/mapper/$loopdevice ]; then
+ umount /dev/mapper/$loopdevice || true
+ dmsetup remove $loopdevice || true
+ fi
+ return 0
+}
+
# resize image
resize() {
install_utils
@@ -149,7 +159,7 @@ resize() {
fdisk -l /dev/${loopdevice:0:5} || true
growpart /dev/${loopdevice:0:5} 1
dmsetup clear $loopdevice
- kpartx -dv $raw_imgfile
+ kpartx -dv $raw_imgfile || eliminate
}
# mount image
@@ -193,7 +203,7 @@ cleanup() {
mount | grep $mountdir/proc && umount $mountdir/proc
mount | grep $mountdir && umount $mountdir
if [ -f $raw_imgfile ]; then
- kpartx -dv $raw_imgfile || true
+ kpartx -dv $raw_imgfile || eliminate
fi
rm -f $raw_imgfile
rm -rf $mountdir