mirror of https://github.com/apache/cloudstack.git
bug 10626: Modified install sys tmpl script to get templateId from DB using db.properties
status 10626: resolved fixed
This commit is contained in:
parent
4c7a4181c0
commit
d25a894089
|
|
@ -10,7 +10,7 @@ failed() {
|
|||
echo "Installation failed"
|
||||
exit $1
|
||||
}
|
||||
|
||||
#set -x
|
||||
mflag=
|
||||
fflag=
|
||||
ext="vhd"
|
||||
|
|
@ -60,18 +60,22 @@ then
|
|||
failed 3
|
||||
fi
|
||||
|
||||
dbHost=$(sed '/^\#/d' /etc/cloud/management/db.properties | grep 'db.cloud.host' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||
dbUser=$(sed '/^\#/d' /etc/cloud/management/db.properties | grep 'db.cloud.username' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||
dbPassword=$(sed '/^\#/d' /etc/cloud/management/db.properties | grep 'db.cloud.password' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||
|
||||
if [ "$hyper" == "kvm" ]
|
||||
then
|
||||
ext="qcow2"
|
||||
templateId=3
|
||||
templateId=(`mysql -h $dbHost --user=$dbUser --password=$dbPassword --skip-column-names -U cloud -e "select max(id) from cloud.vm_template where type = \"SYSTEM\" and hypervisor_type = \"KVM\" and removed is null"`)
|
||||
elif [ "$hyper" == "xenserver" ]
|
||||
then
|
||||
ext="vhd"
|
||||
templateId=${templateId:-1}
|
||||
templateId=(`mysql -h $dbHost --user=$dbUser --password=$dbPassword --skip-column-names -U cloud -e "select max(id) from cloud.vm_template where type = \"SYSTEM\" and hypervisor_type = \"XenServer\" and removed is null"`)
|
||||
elif [ "$hyper" == "vmware" ]
|
||||
then
|
||||
ext="ova"
|
||||
templateId=8
|
||||
templateId=(`mysql -h $dbHost --user=$dbUser --password=$dbPassword --skip-column-names -U cloud -e "select max(id) from cloud.vm_template where type = \"SYSTEM\" and hypervisor_type = \"VMware\" and removed is null"`)
|
||||
else
|
||||
usage
|
||||
failed 2
|
||||
|
|
|
|||
Loading…
Reference in New Issue