You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/storage/secondary/cloud-install-sys-tmplt
+18-15Lines changed: 18 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ failed() {
33
33
mflag=
34
34
fflag=
35
35
ext="vhd"
36
-
templateId=1
36
+
templateId=
37
37
hyper=
38
38
msKey=password
39
39
DISKSPACE=5120000 #free disk space required in kilobytes
@@ -143,21 +143,24 @@ else
143
143
fi
144
144
fi
145
145
146
-
if [ "$hyper"=="kvm" ]
146
+
if [ "$templateId"=="" ]
147
147
then
148
-
ext="qcow2"
149
-
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"`)
150
-
elif [ "$hyper"=="xenserver" ]
151
-
then
152
-
ext="vhd"
153
-
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"`)
154
-
elif [ "$hyper"=="vmware" ]
155
-
then
156
-
ext="ova"
157
-
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"`)
158
-
else
159
-
usage
160
-
failed 2
148
+
if [ "$hyper"=="kvm" ]
149
+
then
150
+
ext="qcow2"
151
+
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"`)
152
+
elif [ "$hyper"=="xenserver" ]
153
+
then
154
+
ext="vhd"
155
+
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"`)
156
+
elif [ "$hyper"=="vmware" ]
157
+
then
158
+
ext="ova"
159
+
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"`)
0 commit comments