Created
October 21, 2015 01:52
-
-
Save megahall/fa3ba7ba18cdb43c5a76 to your computer and use it in GitHub Desktop.
deploys OVA files onto ESXi with high performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e -x | |
images=$(ls some_directories/*.ova) | |
suffix="test_A" | |
for image in ${images}; do | |
image_name=$(basename "${image}" ".ova") | |
count=1 | |
if [[ $image =~ something_that_uses_clustering ]]; then | |
count=2 | |
fi | |
for ((i=0; $i < $count; ++i)); do | |
id=$(printf "%02d" "${count}") | |
name="${image_name}_${suffix}_${id}" | |
ovftool \ | |
--lax \ | |
--X:logFile=ovftool.log \ | |
--X:logLevel=verbose \ | |
--acceptAllEulas \ | |
--compress=9 \ | |
--diskMode=thick \ | |
--ipAllocationPolicy=dhcpPolicy \ | |
--fencedMode=bridged \ | |
--powerOffSource \ | |
--sourceType=OVA \ | |
--name="${name}" \ | |
--datastore=Speedy \ | |
"${image}" \ | |
vi://root:password@ESXI_IP_ADDRESS | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment