Skip to content

Commit

Permalink
Merge pull request #320 from IBM/ocdfix
Browse files Browse the repository at this point in the history
Ocdfix
  • Loading branch information
Catherine2019 authored Jun 4, 2021
2 parents 9999897 + ce609c9 commit 9724642
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 7 additions & 3 deletions scripts/zvm/launch_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ if [ $rc -ne 0 ]; then
fi

# add disk:
# note: frontend sends disk size counting in G now.
rc=$(curl -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}' | jq .rc)
if [ $rc -ne 0 ]; then
# note: frontend sends disk size counting in G now.
#rc=$(curl -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}' | jq .rc)
result=$(curl -w %{http_code} -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}')
httpRc=${result: -3}
zvmResult=${result%???}
rc=$(echo $zvmResult | jq .rc)
if [ $httpRc -eq 500 -o $rc -ne 0 ]; then
# remove user ?
echo "$vm_ID: Add disk failed!"
echo "|:-COMMAND-:| `basename $0` '$ID' '$vm_stat' '$SCI_CLIENT_ID' '$vm_ID: Add disk failed!'"
Expand Down
9 changes: 7 additions & 2 deletions scripts/zvm/oc_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ if [ $rc -ne 0 ]; then
fi

# add disk:
rc=$(curl -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}' | jq .rc)
if [ $rc -ne 0 ]; then
# note: frontend sends disk size counting in G now
#rc=$(curl -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}' | jq .rc)
result=$(curl -w %{http_code} -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}')
httpRc=${result: -3}
zvmResult=${result%???}
rc=$(echo $zvmResult | jq .rc)
if [ $httpRc -eq 500 -o $rc -ne 0 ]; then
# remove user ?
echo "$vm_ID: Add disk failed!"
echo "|:-COMMAND-:| launch_vm.sh '$ID' '$vm_stat' '$SCI_CLIENT_ID' '$vm_ID: Add disk failed!'"
Expand Down
2 changes: 1 addition & 1 deletion web/clui/public/misc/openshift/ocd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ sshKey: '$ssh_key'
$parts
EOF
sed -i "/^$/d" install-config.yaml
if [ "$virt_type" = 'kvm-s390x' ] || ["$virt_type" = 'zvm' ]; then
if [ "$virt_type" = 'kvm-s390x' ] || [ "$virt_type" = 'zvm' ]; then
sed -i "s/architecture.*$/architecture: s390x/" install-config.yaml
fi
echo "start to backup"
Expand Down

0 comments on commit 9724642

Please sign in to comment.