@@ -19,6 +19,17 @@ func main() {
1919 matrixRows := []cloudops.StorageDecisionMatrixRow {}
2020 for vpu := 0 ; vpu <= 120 ; vpu = vpu + 10 {
2121 matrixRows = append (matrixRows , getMatrixRows (vpu )... )
22+ row := getCommonRow (0 )
23+ iopsPerGB , maxIopsPerVol , err := getIOPSdetails (vpu )
24+ if err != nil {
25+ panic (err )
26+ }
27+ row .DriveType = fmt .Sprintf ("%s%d" , vpusPrefix , vpu )
28+ row .MinIOPS = uint64 (maxIopsPerVol )
29+ row .MaxIOPS = uint64 (maxIopsPerVol )
30+ row .MinSize = uint64 (math .Ceil (float64 (row .MaxIOPS ) / float64 (iopsPerGB )))
31+ row .MaxSize = uint64 (32768 )
32+ matrixRows = append (matrixRows , row )
2233 }
2334 matrix := cloudops.StorageDecisionMatrix {Rows : matrixRows }
2435 if err := parser .NewStorageDecisionMatrixParser ().MarshalToYaml (& matrix , oracleYamlPath ); err != nil {
@@ -29,9 +40,8 @@ func main() {
2940
3041}
3142
32- func getMatrixRows (vpu int ) []cloudops. StorageDecisionMatrixRow {
43+ func getIOPSdetails (vpu int ) ( int64 , int64 , error ) {
3344 var iopsPerGB , maxIopsPerVol int64
34- rows := []cloudops.StorageDecisionMatrixRow {}
3545 switch vpu {
3646 case 0 :
3747 iopsPerGB = 2
@@ -72,6 +82,17 @@ func getMatrixRows(vpu int) []cloudops.StorageDecisionMatrixRow {
7282 case 120 :
7383 iopsPerGB = 225
7484 maxIopsPerVol = 300000
85+ default :
86+ return 0 , 0 , fmt .Errorf ("invalid vpu value [%d]" , vpu )
87+ }
88+ return iopsPerGB , maxIopsPerVol , nil
89+ }
90+
91+ func getMatrixRows (vpu int ) []cloudops.StorageDecisionMatrixRow {
92+ rows := []cloudops.StorageDecisionMatrixRow {}
93+ iopsPerGB , maxIopsPerVol , err := getIOPSdetails (vpu )
94+ if err != nil {
95+ panic (err )
7596 }
7697 row := getCommonRow (0 )
7798
0 commit comments