Skip to content

Commit bdaa0bf

Browse files
Oracle update exadata infra to support X11M shape (#29801)
* Update oracle exadata/vmcluster/db-system-shapes to follow oracledatabase 2025-03-01 * Comment resolution, update documentation and small refactoring * Oracle - remove unused old vendor files --------- Co-authored-by: Evgen Rusakov <[email protected]>
1 parent 805daac commit bdaa0bf

File tree

106 files changed

+127
-6378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+127
-6378
lines changed

internal/services/oracle/oracle_autonomous_database_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ func (AutonomousDatabaseRegularResource) Read() sdk.ResourceFunc {
434434
state.AutoScalingForStorageEnabled = pointer.From(props.IsAutoScalingForStorageEnabled)
435435
state.CharacterSet = pointer.From(props.CharacterSet)
436436
state.ComputeCount = pointer.From(props.ComputeCount)
437-
state.ComputeModel = string(pointer.From(props.ComputeModel))
437+
state.ComputeModel = pointer.FromEnum(props.ComputeModel)
438438
state.CustomerContacts = flattenAdbsCustomerContacts(props.CustomerContacts)
439439
state.DataStorageSizeInTbs = pointer.From(props.DataStorageSizeInTbs)
440440
state.DbWorkload = string(pointer.From(props.DbWorkload))

internal/services/oracle/oracle_cloud_vm_cluster_data_source.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type CloudVmClusterDataModel struct {
2929
CloudExadataInfrastructureId string `tfschema:"cloud_exadata_infrastructure_id"`
3030
ClusterName string `tfschema:"cluster_name"`
3131
CompartmentId string `tfschema:"compartment_id"`
32+
ComputeModel string `tfschema:"compute_model"`
3233
ComputeNodes []string `tfschema:"compute_nodes"`
3334
CpuCoreCount int64 `tfschema:"cpu_core_count"`
3435
DataCollectionOptions []DataCollectionOptionsModel `tfschema:"data_collection_options"`
@@ -131,6 +132,11 @@ func (d CloudVmClusterDataSource) Attributes() map[string]*pluginsdk.Schema {
131132
Computed: true,
132133
},
133134

135+
"compute_model": {
136+
Type: pluginsdk.TypeString,
137+
Computed: true,
138+
},
139+
134140
"compute_nodes": {
135141
Type: pluginsdk.TypeList,
136142
Computed: true,
@@ -466,6 +472,7 @@ func (d CloudVmClusterDataSource) Read() sdk.ResourceFunc {
466472
state.CloudExadataInfrastructureId = props.CloudExadataInfrastructureId
467473
state.ClusterName = pointer.From(props.ClusterName)
468474
state.CompartmentId = pointer.From(props.CompartmentId)
475+
state.ComputeModel = pointer.FromEnum(props.ComputeModel)
469476
state.ComputeNodes = pointer.From(props.ComputeNodes)
470477
state.CpuCoreCount = props.CpuCoreCount
471478
state.DataStoragePercentage = pointer.From(props.DataStoragePercentage)

internal/services/oracle/oracle_cloud_vm_cluster_resource_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ resource "azurerm_oracle_cloud_vm_cluster" "test" {
134134
db_node_storage_size_in_gbs = 120
135135
db_servers = [for obj in data.azurerm_oracle_db_servers.test.db_servers : obj.ocid]
136136
display_name = "OFakeVmacctest%[2]d"
137-
domain = "ociofakeacctes.com"
138137
gi_version = "23.0.0.0"
139138
local_backup_enabled = true
140139
sparse_diskgroup_enabled = true
@@ -150,7 +149,6 @@ resource "azurerm_oracle_cloud_vm_cluster" "test" {
150149
test = "testTag1"
151150
}
152151
time_zone = "UTC"
153-
zone_id = "ocid1.dns-zone.oc1.iad.aaaaaaaac7lyw74bnybmlek7nrsd5h3v5kjfv3aiw62menpuuwoder7yhmpa"
154152
virtual_network_id = azurerm_virtual_network.virtual_network.id
155153
}`, a.template(data), data.RandomInteger, data.Locations.Primary)
156154
}
@@ -253,7 +251,7 @@ resource "azurerm_oracle_exadata_infrastructure" "test" {
253251
display_name = "OFakeacctest%[1]d"
254252
shape = "Exadata.X9M"
255253
storage_count = "3"
256-
zones = ["3"]
254+
zones = ["2"]
257255
}
258256
259257
data "azurerm_oracle_db_servers" "test" {

internal/services/oracle/oracle_db_servers_data_source.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type DBServerDataModel struct {
2828
AutonomousVMClusterIds []string `tfschema:"autonomous_vm_cluster_ids"`
2929
AutonomousVirtualMachineIds []string `tfschema:"autonomous_virtual_machine_ds"`
3030
CompartmentId string `tfschema:"compartment_id"`
31+
ComputeModel string `tfschema:"compute_model"`
3132
CpuCoreCount int64 `tfschema:"cpu_core_count"`
3233
DbNodeIds []string `tfschema:"db_node_ids"`
3334
DbNodeStorageSizeInGbs int64 `tfschema:"db_node_storage_size_in_gbs"`
@@ -85,6 +86,11 @@ func (d DBServersDataSource) Attributes() map[string]*pluginsdk.Schema {
8586
Computed: true,
8687
},
8788

89+
"compute_model": {
90+
Type: pluginsdk.TypeString,
91+
Computed: true,
92+
},
93+
8894
"cpu_core_count": {
8995
Type: pluginsdk.TypeInt,
9096
Computed: true,
@@ -212,6 +218,7 @@ func (d DBServersDataSource) Read() sdk.ResourceFunc {
212218
AutonomousVMClusterIds: pointer.From(props.AutonomousVMClusterIds),
213219
AutonomousVirtualMachineIds: pointer.From(props.AutonomousVirtualMachineIds),
214220
CompartmentId: pointer.From(props.CompartmentId),
221+
ComputeModel: pointer.FromEnum(props.ComputeModel),
215222
CpuCoreCount: pointer.From(props.CpuCoreCount),
216223
DbNodeIds: pointer.From(props.DbNodeIds),
217224
DbNodeStorageSizeInGbs: pointer.From(props.DbNodeStorageSizeInGbs),

internal/services/oracle/oracle_db_system_shapes_data_source.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type DbSystemShapesModel struct {
2323
}
2424

2525
type DbSystemShapeModel struct {
26+
AreServerTypesSupported bool `tfschema:"are_server_types_supported"`
2627
AvailableCoreCount int64 `tfschema:"available_core_count"`
2728
AvailableCoreCountPerNode int64 `tfschema:"available_core_count_per_node"`
2829
AvailableDataStorageInTbs int64 `tfschema:"available_data_storage_in_tbs"`
@@ -31,7 +32,9 @@ type DbSystemShapeModel struct {
3132
AvailableDbNodeStorageInGbs int64 `tfschema:"available_db_node_storage_in_gbs"`
3233
AvailableMemoryInGbs int64 `tfschema:"available_memory_in_gbs"`
3334
AvailableMemoryPerNodeInGbs int64 `tfschema:"available_memory_per_node_in_gbs"`
35+
ComputeModel string `tfschema:"compute_model"`
3436
CoreCountIncrement int64 `tfschema:"core_count_increment"`
37+
DisplayName string `tfschema:"display_name"`
3538
MaxStorageCount int64 `tfschema:"maximum_storage_count"`
3639
MaximumNodeCount int64 `tfschema:"maximum_node_count"`
3740
MinCoreCountPerNode int64 `tfschema:"minimum_core_count_per_node"`
@@ -58,6 +61,10 @@ func (d DbSystemShapesDataSource) Attributes() map[string]*pluginsdk.Schema {
5861
Computed: true,
5962
Elem: &pluginsdk.Resource{
6063
Schema: map[string]*pluginsdk.Schema{
64+
"are_server_types_supported": {
65+
Type: pluginsdk.TypeBool,
66+
Computed: true,
67+
},
6168
"available_core_count": {
6269
Type: pluginsdk.TypeInt,
6370
Computed: true,
@@ -90,10 +97,18 @@ func (d DbSystemShapesDataSource) Attributes() map[string]*pluginsdk.Schema {
9097
Type: pluginsdk.TypeInt,
9198
Computed: true,
9299
},
100+
"compute_model": {
101+
Type: pluginsdk.TypeString,
102+
Computed: true,
103+
},
93104
"core_count_increment": {
94105
Type: pluginsdk.TypeInt,
95106
Computed: true,
96107
},
108+
"display_name": {
109+
Type: pluginsdk.TypeString,
110+
Computed: true,
111+
},
97112
"maximum_storage_count": {
98113
Type: pluginsdk.TypeInt,
99114
Computed: true,
@@ -184,6 +199,7 @@ func (d DbSystemShapesDataSource) Read() sdk.ResourceFunc {
184199
for _, element := range *model {
185200
if props := element.Properties; props != nil {
186201
state.DbSystemShapes = append(state.DbSystemShapes, DbSystemShapeModel{
202+
AreServerTypesSupported: pointer.From(props.AreServerTypesSupported),
187203
AvailableCoreCount: props.AvailableCoreCount,
188204
AvailableCoreCountPerNode: pointer.From(props.AvailableCoreCountPerNode),
189205
AvailableDataStorageInTbs: pointer.From(props.AvailableDataStorageInTbs),
@@ -192,7 +208,9 @@ func (d DbSystemShapesDataSource) Read() sdk.ResourceFunc {
192208
AvailableDbNodeStorageInGbs: pointer.From(props.AvailableDbNodeStorageInGbs),
193209
AvailableMemoryInGbs: pointer.From(props.AvailableMemoryInGbs),
194210
AvailableMemoryPerNodeInGbs: pointer.From(props.AvailableMemoryPerNodeInGbs),
211+
ComputeModel: pointer.FromEnum(props.ComputeModel),
195212
CoreCountIncrement: pointer.From(props.CoreCountIncrement),
213+
DisplayName: pointer.From(props.DisplayName),
196214
MaxStorageCount: pointer.From(props.MaxStorageCount),
197215
MaximumNodeCount: pointer.From(props.MaximumNodeCount),
198216
MinCoreCountPerNode: pointer.From(props.MinCoreCountPerNode),

internal/services/oracle/oracle_db_system_shapes_data_source_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ provider "azurerm" {
3333
3434
data "azurerm_oracle_db_system_shapes" "test" {
3535
location = "eastus"
36+
zone = "2"
3637
}
3738
`
3839
}

internal/services/oracle/oracle_exadata_infrastructure_data_source.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ type ExadataInfraDataModel struct {
3232
AdditionalStorageCount int64 `tfschema:"additional_storage_count"`
3333
AvailableStorageSizeInGbs int64 `tfschema:"available_storage_size_in_gbs"`
3434
ComputeCount int64 `tfschema:"compute_count"`
35+
ComputeModel string `tfschema:"compute_model"`
3536
CpuCount int64 `tfschema:"cpu_count"`
3637
CustomerContacts []string `tfschema:"customer_contacts"`
38+
DatabaseServerType string `tfschema:"database_server_type"`
3739
DataStorageSizeInTbs float64 `tfschema:"data_storage_size_in_tbs"`
3840
DbNodeStorageSizeInGbs int64 `tfschema:"db_node_storage_size_in_gbs"`
3941
DbServerVersion string `tfschema:"db_server_version"`
@@ -55,6 +57,7 @@ type ExadataInfraDataModel struct {
5557
Ocid string `tfschema:"ocid"`
5658
Shape string `tfschema:"shape"`
5759
StorageCount int64 `tfschema:"storage_count"`
60+
StorageServerType string `tfschema:"storage_server_type"`
5861
StorageServerVersion string `tfschema:"storage_server_version"`
5962
TimeCreated string `tfschema:"time_created"`
6063
TotalStorageSizeInGbs int64 `tfschema:"total_storage_size_in_gbs"`
@@ -114,6 +117,11 @@ func (d ExadataInfraDataSource) Attributes() map[string]*pluginsdk.Schema {
114117
Computed: true,
115118
},
116119

120+
"compute_model": {
121+
Type: pluginsdk.TypeString,
122+
Computed: true,
123+
},
124+
117125
"cpu_count": {
118126
Type: pluginsdk.TypeInt,
119127
Computed: true,
@@ -127,6 +135,11 @@ func (d ExadataInfraDataSource) Attributes() map[string]*pluginsdk.Schema {
127135
},
128136
},
129137

138+
"database_server_type": {
139+
Type: pluginsdk.TypeString,
140+
Computed: true,
141+
},
142+
130143
"data_storage_size_in_tbs": {
131144
Type: pluginsdk.TypeFloat,
132145
Computed: true,
@@ -320,6 +333,11 @@ func (d ExadataInfraDataSource) Attributes() map[string]*pluginsdk.Schema {
320333
Computed: true,
321334
},
322335

336+
"storage_server_type": {
337+
Type: pluginsdk.TypeString,
338+
Computed: true,
339+
},
340+
323341
"storage_server_version": {
324342
Type: pluginsdk.TypeString,
325343
Computed: true,
@@ -410,6 +428,9 @@ func (d ExadataInfraDataSource) Read() sdk.ResourceFunc {
410428
state.StorageServerVersion = pointer.From(props.StorageServerVersion)
411429
state.TimeCreated = pointer.From(props.TimeCreated)
412430
state.TotalStorageSizeInGbs = pointer.From(props.TotalStorageSizeInGbs)
431+
state.ComputeModel = pointer.FromEnum(props.ComputeModel)
432+
state.DatabaseServerType = pointer.From(props.DatabaseServerType)
433+
state.StorageServerType = pointer.From(props.StorageServerType)
413434
}
414435
}
415436

internal/services/oracle/oracle_exadata_infrastructure_resource.go

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
1717
"github.com/hashicorp/terraform-provider-azurerm/internal/services/oracle/validate"
1818
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
19+
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
1920
)
2021

2122
var _ sdk.Resource = ExadataInfraResource{}
@@ -37,8 +38,10 @@ type ExadataInfraResourceModel struct {
3738
StorageCount int64 `tfschema:"storage_count"`
3839

3940
// Optional
40-
CustomerContacts []string `tfschema:"customer_contacts"`
41-
MaintenanceWindow []MaintenanceWindowModel `tfschema:"maintenance_window"`
41+
DatabaseServerType string `tfschema:"database_server_type"`
42+
StorageServerType string `tfschema:"storage_server_type"`
43+
CustomerContacts []string `tfschema:"customer_contacts"`
44+
MaintenanceWindow []MaintenanceWindowModel `tfschema:"maintenance_window"`
4245
}
4346

4447
func (ExadataInfraResource) Arguments() map[string]*pluginsdk.Schema {
@@ -63,6 +66,14 @@ func (ExadataInfraResource) Arguments() map[string]*pluginsdk.Schema {
6366
ForceNew: true,
6467
},
6568

69+
"database_server_type": {
70+
Type: pluginsdk.TypeString,
71+
Optional: true,
72+
Computed: true,
73+
ForceNew: true,
74+
ValidateFunc: validation.StringLenBetween(1, 255),
75+
},
76+
6677
"display_name": {
6778
Type: pluginsdk.TypeString,
6879
Required: true,
@@ -172,6 +183,14 @@ func (ExadataInfraResource) Arguments() map[string]*pluginsdk.Schema {
172183
},
173184
},
174185

186+
"storage_server_type": {
187+
Type: pluginsdk.TypeString,
188+
Optional: true,
189+
Computed: true,
190+
ForceNew: true,
191+
ValidateFunc: validation.StringLenBetween(1, 255),
192+
},
193+
175194
"tags": commonschema.Tags(),
176195

177196
"zones": commonschema.ZonesMultipleRequiredForceNew(),
@@ -227,7 +246,12 @@ func (r ExadataInfraResource) Create() sdk.ResourceFunc {
227246
CustomerContacts: pointer.To(ExpandCustomerContacts(model.CustomerContacts)),
228247
},
229248
}
230-
249+
if model.DatabaseServerType != "" {
250+
param.Properties.DatabaseServerType = pointer.To(model.DatabaseServerType)
251+
}
252+
if model.StorageServerType != "" {
253+
param.Properties.StorageServerType = pointer.To(model.StorageServerType)
254+
}
231255
if len(model.MaintenanceWindow) > 0 {
232256
param.Properties.MaintenanceWindow = &cloudexadatainfrastructures.MaintenanceWindow{
233257
DaysOfWeek: pointer.To(ExpandDayOfWeekTo(model.MaintenanceWindow[0].DaysOfWeek)),
@@ -324,6 +348,8 @@ func (ExadataInfraResource) Read() sdk.ResourceFunc {
324348
state.StorageCount = pointer.From(props.StorageCount)
325349
state.Shape = props.Shape
326350
state.MaintenanceWindow = FlattenMaintenanceWindow(props.MaintenanceWindow)
351+
state.DatabaseServerType = pointer.From(props.DatabaseServerType)
352+
state.StorageServerType = pointer.From(props.StorageServerType)
327353
}
328354
}
329355

internal/services/oracle/oracle_exadata_infrastructure_resource_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ resource "azurerm_oracle_exadata_infrastructure" "test" {
110110
display_name = "OFakeacctest%[2]d"
111111
shape = "Exadata.X9M"
112112
storage_count = "3"
113-
zones = ["3"]
113+
zones = ["2"]
114114
}
115115
`, a.template(data), data.RandomInteger, data.Locations.Primary)
116116
}
@@ -129,11 +129,14 @@ resource "azurerm_oracle_exadata_infrastructure" "test" {
129129
resource_group_name = azurerm_resource_group.test.name
130130
compute_count = "2"
131131
display_name = "OFakeacctest%[2]d"
132-
shape = "Exadata.X9M"
132+
shape = "Exadata.X11M"
133133
storage_count = "3"
134-
zones = ["3"]
134+
zones = ["2"]
135135
customer_contacts = ["[email protected]"]
136136
137+
database_server_type = "X11M"
138+
storage_server_type = "X11M-HC"
139+
137140
maintenance_window {
138141
days_of_week = ["Monday"]
139142
hours_of_day = [4]
@@ -167,7 +170,7 @@ resource "azurerm_oracle_exadata_infrastructure" "test" {
167170
display_name = "OFakeacctest%[2]d"
168171
shape = "Exadata.X9M"
169172
storage_count = "3"
170-
zones = ["3"]
173+
zones = ["2"]
171174
tags = {
172175
test = "testTag1"
173176
}

internal/services/oracle/validate/autonomous_database_regular.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"unicode"
1111
"unicode/utf8"
1212

13-
"github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases"
13+
"github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2025-03-01/autonomousdatabases"
1414
)
1515

1616
func AutonomousDatabaseName(i interface{}, k string) (warnings []string, errors []error) {

0 commit comments

Comments
 (0)