Updated Branches: refs/heads/hyperv 92a66dfdd -> 9cdf193d9
don't run vhd-util on templates which are present on CIFS. Hyperv uses cifs as secondary storage Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9cdf193d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9cdf193d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9cdf193d Branch: refs/heads/hyperv Commit: 9cdf193d9a2558b9315660113a74be2fb26b97c3 Parents: 92a66df Author: Rajesh Battala <[email protected]> Authored: Thu Oct 31 14:31:02 2013 +0530 Committer: Rajesh Battala <[email protected]> Committed: Thu Oct 31 14:32:09 2013 +0530 ---------------------------------------------------------------------- scripts/storage/secondary/createtmplt.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cdf193d/scripts/storage/secondary/createtmplt.sh ---------------------------------------------------------------------- diff --git a/scripts/storage/secondary/createtmplt.sh b/scripts/storage/secondary/createtmplt.sh index 3fa43e3..05874b4 100755 --- a/scripts/storage/secondary/createtmplt.sh +++ b/scripts/storage/secondary/createtmplt.sh @@ -169,6 +169,14 @@ do esac done +isCifs() { + #TO:DO incase of multiple zone where cifs and nfs exists, + #then check if the template file is from cifs using df -P filename + #Currently only cifs is supported in hyperv zone. + mount | grep "type cifs" > /dev/null + return $? +} + if [ "$tflag$nflag$fflag$sflag" != "1111" ] then usage @@ -196,12 +204,15 @@ rollback_if_needed $tmpltfs $? "tar archives not supported\n" if [ ${tmpltname%.vhd} != ${tmpltname} ] then - if which vhd-util &>/dev/null - then - vhd-util read -p -n ${tmpltimg2} > /dev/null - rollback_if_needed $tmpltfs $? "vhd check of $tmpltimg2 failed\n" - vhd-util set -n ${tmpltimg2} -f "hidden" -v "0" > /dev/null - rollback_if_needed $tmpltfs $? "vhd remove $tmpltimg2 hidden failed\n" + if [ isCifs -ne 0 ] ; + then + if which vhd-util &>/dev/null + then + vhd-util read -p -n ${tmpltimg2} > /dev/null + rollback_if_needed $tmpltfs $? "vhd check of $tmpltimg2 failed\n" + vhd-util set -n ${tmpltimg2} -f "hidden" -v "0" > /dev/null + rollback_if_needed $tmpltfs $? "vhd remove $tmpltimg2 hidden failed\n" + fi fi fi
