Skip to content

Commit 6f5ea44

Browse files
Shrey KapoorNagendraNigade
authored andcommitted
Bug Fix - Support for New Compute Shapes (VM.DenseIO.E4.Flex)
1 parent 7f5a3fd commit 6f5ea44

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

examples/big_data_service/main.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ variable "bds_instance_nodes_shape" {
8383
}
8484

8585
variable "bds_instance_worker_node_shape" {
86-
default = "VM.Standard2.4"
86+
default = "VM.DenseIO.E4.Flex"
8787
}
8888

8989
variable "bds_instance_compute_only_worker_node_shape" {
@@ -229,8 +229,12 @@ resource "oci_bds_bds_instance" "test_bds_instance" {
229229
shape = var.bds_instance_worker_node_shape
230230

231231
subnet_id = var.subnet_id
232-
block_volume_size_in_gbs = var.bds_instance_worker_nodes_block_volume_size_in_gbs
233232
number_of_nodes = 4
233+
shape_config {
234+
memory_in_gbs = 128
235+
ocpus = 8
236+
nvmes = 1
237+
}
234238
}
235239

236240
edge_node {

internal/integrationtest/bds_odh_instance_resource_test.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var (
6565
"kerberos_realm_name": acctest.Representation{RepType: acctest.Optional, Create: `BDSCLOUDSERVICE.ORACLE.COM`},
6666
"master_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodeFlexShapeRepresentation},
6767
"util_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodeFlexShapeRepresentation},
68-
"worker_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesOdhWorkerRepresentation},
68+
"worker_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodeDenseShapeRepresentation},
6969
"bootstrap_script_url": acctest.Representation{RepType: acctest.Optional, Create: `${var.bootstrap_script_url}`, Update: `${var.bootstrap_script_urlU}`},
7070
"compute_only_worker_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodeFlexShapeRepresentation},
7171
"edge_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodeFlexShapeRepresentation},
@@ -126,6 +126,12 @@ var (
126126
"number_of_nodes": acctest.Representation{RepType: acctest.Required, Create: `2`},
127127
"shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesShapeConfigRepresentation},
128128
}
129+
bdsInstanceNodeDenseShapeRepresentation = map[string]interface{}{
130+
"shape": acctest.Representation{RepType: acctest.Required, Create: `VM.DenseIO.E4.Flex`},
131+
"subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_id}`},
132+
"number_of_nodes": acctest.Representation{RepType: acctest.Required, Create: `3`, Update: `4`},
133+
"shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesDenseShapeConfigRepresentation},
134+
}
129135
bdsInstanceNodeFlex3ShapeRepresentation = map[string]interface{}{
130136
"shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard3.Flex`},
131137
"subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_id}`},
@@ -137,6 +143,12 @@ var (
137143
"memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `32`},
138144
"ocpus": acctest.Representation{RepType: acctest.Required, Create: `3`},
139145
}
146+
147+
bdsInstanceNodesDenseShapeConfigRepresentation = map[string]interface{}{
148+
"memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `128`},
149+
"ocpus": acctest.Representation{RepType: acctest.Required, Create: `8`},
150+
"nvmes": acctest.Representation{RepType: acctest.Required, Create: `1`},
151+
}
140152
bdsInstanceOdhWithAddMasterUtilRepresentation = acctest.RepresentationCopyWithNewProperties(bdsInstanceOdhRepresentation,
141153
map[string]interface{}{
142154
// Master & Util shape should be same
@@ -355,7 +367,6 @@ func TestResourceBdsOdhInstance(t *testing.T) {
355367
"is_kafka_configured": acctest.Representation{RepType: acctest.Required, Create: `false`, Update: `false`},
356368
"cluster_profile": acctest.Representation{RepType: acctest.Optional, Create: `HADOOP_EXTENDED`, Update: `HADOOP_EXTENDED`},
357369
"display_name": acctest.Representation{RepType: acctest.Required, Create: `hadext1`, Update: `hadext1`},
358-
"kafka_broker_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceKafkaBrokerNodeFlexShapeRepresentation},
359370
})),
360371
Check: resource.ComposeAggregateTestCheckFunc(
361372
resource.TestCheckResourceAttr(resourceName, "cluster_admin_password", "T3JhY2xlVGVhbVVTQSExMjM="),

internal/service/bds/bds_bds_instance_resource.go

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ func BdsBdsInstanceResource() *schema.Resource {
127127
Type: schema.TypeInt,
128128
Optional: true,
129129
Computed: true,
130-
ForceNew: true,
131130
},
132131
},
133132
},
@@ -190,7 +189,6 @@ func BdsBdsInstanceResource() *schema.Resource {
190189
Type: schema.TypeInt,
191190
Optional: true,
192191
Computed: true,
193-
ForceNew: true,
194192
},
195193
},
196194
},
@@ -217,8 +215,9 @@ func BdsBdsInstanceResource() *schema.Resource {
217215
},
218216

219217
"block_volume_size_in_gbs": {
220-
Type: schema.TypeString,
221-
Optional: true,
218+
Type: schema.TypeString,
219+
Optional: true,
220+
//Computed: true,
222221
ValidateFunc: tfresource.ValidateInt64TypeString,
223222
DiffSuppressFunc: tfresource.Int64StringDiffSuppressFunction,
224223
},
@@ -251,7 +250,6 @@ func BdsBdsInstanceResource() *schema.Resource {
251250
Type: schema.TypeInt,
252251
Optional: true,
253252
Computed: true,
254-
ForceNew: true,
255253
},
256254

257255
// Computed
@@ -315,7 +313,6 @@ func BdsBdsInstanceResource() *schema.Resource {
315313
Type: schema.TypeInt,
316314
Optional: true,
317315
Computed: true,
318-
ForceNew: true,
319316
},
320317

321318
// Computed
@@ -380,7 +377,6 @@ func BdsBdsInstanceResource() *schema.Resource {
380377
Type: schema.TypeInt,
381378
Optional: true,
382379
Computed: true,
383-
ForceNew: true,
384380
},
385381

386382
// Computed
@@ -443,7 +439,6 @@ func BdsBdsInstanceResource() *schema.Resource {
443439
Type: schema.TypeInt,
444440
Optional: true,
445441
Computed: true,
446-
ForceNew: true,
447442
},
448443

449444
// Computed
@@ -763,6 +758,10 @@ func BdsBdsInstanceResource() *schema.Resource {
763758
Type: schema.TypeInt,
764759
Computed: true,
765760
},
761+
"nvmes": {
762+
Type: schema.TypeInt,
763+
Computed: true,
764+
},
766765
"memory_in_gbs": {
767766
Type: schema.TypeInt,
768767
Computed: true,
@@ -2684,8 +2683,9 @@ func BdsNodeToTemplateMap(obj oci_bds.Node) map[string]interface{} {
26842683
totalSize += *item.VolumeSizeInGBs
26852684
}
26862685
}
2687-
result["block_volume_size_in_gbs"] = strconv.FormatInt(totalSize, 10)
2688-
2686+
if totalSize != 0 {
2687+
result["block_volume_size_in_gbs"] = strconv.FormatInt(totalSize, 10)
2688+
}
26892689
if obj.Shape != nil {
26902690
result["shape"] = string(*obj.Shape)
26912691
}
@@ -2700,6 +2700,9 @@ func BdsNodeToTemplateMap(obj oci_bds.Node) map[string]interface{} {
27002700
shapeConfigMap := map[string]interface{}{}
27012701
shapeConfigMap["ocpus"] = int(*obj.Ocpus)
27022702
shapeConfigMap["memory_in_gbs"] = int(*obj.MemoryInGBs)
2703+
if result["shape"] == "VM.DenseIO.E4.Flex" {
2704+
shapeConfigMap["nvmes"] = int(*obj.Nvmes)
2705+
}
27032706
result["shape_config"] = []interface{}{shapeConfigMap}
27042707
}
27052708

0 commit comments

Comments
 (0)