Skip to content

Commit

Permalink
Merge pull request #1251 from seokho-son/main
Browse files Browse the repository at this point in the history
Enhance error handling for DataDiskIds in mcis provision
  • Loading branch information
seokho-son authored Nov 5, 2022
2 parents 0e4ad83 + b297ead commit 3bb0132
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 8 additions & 6 deletions src/core/mcis/provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -1619,13 +1619,15 @@ func CreateVm(nsId string, mcisId string, vmInfoData *TbVmInfo, option string) e

var DataDiskIdsTmp []string
for _, v := range vmInfoData.DataDiskIds {
CspDataDiskId, err := common.GetCspResourceId(nsId, common.StrDataDisk, v)
if CspDataDiskId == "" {
common.CBLog.Error(err)
return err
// ignore DataDiskIds == "", assume it is ignorable mistake
if v != "" {
CspDataDiskId, err := common.GetCspResourceId(nsId, common.StrDataDisk, v)
if err != nil || CspDataDiskId == "" {
common.CBLog.Error(err)
return err
}
DataDiskIdsTmp = append(DataDiskIdsTmp, CspDataDiskId)
}

DataDiskIdsTmp = append(DataDiskIdsTmp, CspDataDiskId)
}
tempReq.ReqInfo.DataDiskNames = DataDiskIdsTmp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ EOF

echo
echo "mcisName: $mcisName specId: $specId image: $image connectionName: $connectionName rootDiskType: $rootDiskType rootDiskSize: $rootDiskSize subGroupSize: $subGroupSize "
sleepDuration=$((1 + RANDOM % 600))
sleepDuration=$((1 + $RANDOM% 1000))
echo "sleepDuration: $sleepDuration"
sleep $sleepDuration
#sleep $sleepDuration

startTime=$SECONDS

Expand Down Expand Up @@ -198,10 +198,10 @@ EOF
echo "[$i] Elapsed time: $elapsedTime s"
((i++))
fi
} &
} #&

done
wait
#wait


fi
Expand Down

0 comments on commit 3bb0132

Please sign in to comment.