Skip to content

Commit a96afa5

Browse files
ankitrmahaleNagendraNigade
authored andcommitted
Added - Support for EXACC | LACP for client/backup networks (post MVP)
1 parent 145ab9b commit a96afa5

8 files changed

+223
-48
lines changed

examples/database/exadata_cc/exadata-infrastructure.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ resource "oci_database_exadata_infrastructure" "test_exadata_infrastructure" {
5050
is_cps_offline_report_enabled = false
5151
is_multi_rack_deployment = false
5252

53+
#Optional
54+
network_bonding_mode_details {
55+
backup_network_bonding_mode = "ACTIVE_BACKUP"
56+
client_network_bonding_mode = "ACTIVE_BACKUP"
57+
}
58+
5359
#Optional
5460
contacts {
5561
email = "testuser2@testdomain.com"

internal/integrationtest/database_exadata_infrastructure_test.go

Lines changed: 105 additions & 47 deletions
Large diffs are not rendered by default.

internal/service/database/database_exadata_infrastructure_data_source.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ func (s *DatabaseExadataInfrastructureDataSourceCrud) SetData() error {
204204
s.D.Set("netmask", *s.Res.Netmask)
205205
}
206206

207+
if s.Res.NetworkBondingModeDetails != nil {
208+
s.D.Set("network_bonding_mode_details", []interface{}{NetworkBondingModeDetailsToMap(s.Res.NetworkBondingModeDetails)})
209+
} else {
210+
s.D.Set("network_bonding_mode_details", nil)
211+
}
212+
207213
s.D.Set("ntp_server", s.Res.NtpServer)
208214

209215
if s.Res.RackSerialNumber != nil {

internal/service/database/database_exadata_infrastructure_resource.go

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,32 @@ func DatabaseExadataInfrastructureResource() *schema.Resource {
266266
},
267267
},
268268
},
269+
"network_bonding_mode_details": {
270+
Type: schema.TypeList,
271+
Optional: true,
272+
Computed: true,
273+
MaxItems: 1,
274+
MinItems: 1,
275+
Elem: &schema.Resource{
276+
Schema: map[string]*schema.Schema{
277+
// Required
278+
279+
// Optional
280+
"backup_network_bonding_mode": {
281+
Type: schema.TypeString,
282+
Optional: true,
283+
Computed: true,
284+
},
285+
"client_network_bonding_mode": {
286+
Type: schema.TypeString,
287+
Optional: true,
288+
Computed: true,
289+
},
290+
291+
// Computed
292+
},
293+
},
294+
},
269295
"multi_rack_configuration_file": {
270296
Type: schema.TypeString,
271297
Optional: true,
@@ -598,6 +624,17 @@ func (s *DatabaseExadataInfrastructureResourceCrud) Create() error {
598624
request.Netmask = &tmp
599625
}
600626

627+
if networkBondingModeDetails, ok := s.D.GetOkExists("network_bonding_mode_details"); ok {
628+
if tmpList := networkBondingModeDetails.([]interface{}); len(tmpList) > 0 {
629+
fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "network_bonding_mode_details", 0)
630+
tmp, err := s.mapToNetworkBondingModeDetails(fieldKeyFormat)
631+
if err != nil {
632+
return err
633+
}
634+
request.NetworkBondingModeDetails = &tmp
635+
}
636+
}
637+
601638
if ntpServer, ok := s.D.GetOkExists("ntp_server"); ok {
602639
request.NtpServer = []string{}
603640
interfaces := ntpServer.([]interface{})
@@ -801,6 +838,20 @@ func (s *DatabaseExadataInfrastructureResourceCrud) Update() error {
801838
request.Netmask = &tmp
802839
}
803840

841+
if networkBondingModeDetails, ok := s.D.GetOkExists("network_bonding_mode_details"); ok && s.D.HasChange("network_bonding_mode_details") {
842+
843+
if tmpList := networkBondingModeDetails.([]interface{}); len(tmpList) > 0 {
844+
fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "network_bonding_mode_details", 0)
845+
tmp, err := s.mapToNetworkBondingModeDetails(fieldKeyFormat)
846+
if err != nil {
847+
return err
848+
}
849+
request.NetworkBondingModeDetails = &tmp
850+
} else {
851+
request.NetworkBondingModeDetails = nil
852+
}
853+
}
854+
804855
if ntpServer, ok := s.D.GetOkExists("ntp_server"); ok && s.D.HasChange("ntp_server") {
805856
request.NtpServer = []string{}
806857
interfaces := ntpServer.([]interface{})
@@ -999,6 +1050,12 @@ func (s *DatabaseExadataInfrastructureResourceCrud) SetData() error {
9991050
s.D.Set("netmask", *s.Res.Netmask)
10001051
}
10011052

1053+
if s.Res.NetworkBondingModeDetails != nil {
1054+
s.D.Set("network_bonding_mode_details", []interface{}{NetworkBondingModeDetailsToMap(s.Res.NetworkBondingModeDetails)})
1055+
} else {
1056+
s.D.Set("network_bonding_mode_details", nil)
1057+
}
1058+
10021059
s.D.Set("ntp_server", s.Res.NtpServer)
10031060

10041061
if s.Res.Shape != nil {
@@ -1261,6 +1318,30 @@ func ExadataInfrastructureMonthToMap(obj oci_database.Month) map[string]interfac
12611318
return result
12621319
}
12631320

1321+
func (s *DatabaseExadataInfrastructureResourceCrud) mapToNetworkBondingModeDetails(fieldKeyFormat string) (oci_database.NetworkBondingModeDetails, error) {
1322+
result := oci_database.NetworkBondingModeDetails{}
1323+
1324+
if backupNetworkBondingMode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_network_bonding_mode")); ok {
1325+
result.BackupNetworkBondingMode = oci_database.NetworkBondingModeDetailsBackupNetworkBondingModeEnum(backupNetworkBondingMode.(string))
1326+
}
1327+
1328+
if clientNetworkBondingMode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "client_network_bonding_mode")); ok {
1329+
result.ClientNetworkBondingMode = oci_database.NetworkBondingModeDetailsClientNetworkBondingModeEnum(clientNetworkBondingMode.(string))
1330+
}
1331+
1332+
return result, nil
1333+
}
1334+
1335+
func NetworkBondingModeDetailsToMap(obj *oci_database.NetworkBondingModeDetails) map[string]interface{} {
1336+
result := map[string]interface{}{}
1337+
1338+
result["backup_network_bonding_mode"] = string(obj.BackupNetworkBondingMode)
1339+
1340+
result["client_network_bonding_mode"] = string(obj.ClientNetworkBondingMode)
1341+
1342+
return result
1343+
}
1344+
12641345
func (s *DatabaseExadataInfrastructureResourceCrud) updateCompartment(compartment interface{}) error {
12651346
changeCompartmentRequest := oci_database.ChangeExadataInfrastructureCompartmentRequest{}
12661347

internal/service/database/database_exadata_infrastructures_data_source.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ func (s *DatabaseExadataInfrastructuresDataSourceCrud) SetData() error {
248248
exadataInfrastructure["netmask"] = *r.Netmask
249249
}
250250

251+
if r.NetworkBondingModeDetails != nil {
252+
exadataInfrastructure["network_bonding_mode_details"] = []interface{}{NetworkBondingModeDetailsToMap(r.NetworkBondingModeDetails)}
253+
} else {
254+
exadataInfrastructure["network_bonding_mode_details"] = nil
255+
}
256+
251257
exadataInfrastructure["ntp_server"] = r.NtpServer
252258

253259
if r.RackSerialNumber != nil {

website/docs/d/database_exadata_infrastructure.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ The following attributes are exported:
9494
* `monthly_db_server_version` - The monthly software version of the database servers (dom0) in the Exadata infrastructure.
9595
* `multi_rack_configuration_file` - The base64 encoded Multi-Rack configuration json file.
9696
* `netmask` - The netmask for the control plane network.
97+
* `network_bonding_mode_details` - Details of bonding mode for Client and Backup networks of an Exadata infrastructure.
98+
* `backup_network_bonding_mode` - The network bonding mode for the Exadata infrastructure.
99+
* `client_network_bonding_mode` - The network bonding mode for the Exadata infrastructure.
97100
* `ntp_server` - The list of NTP server IP addresses. Maximum of 3 allowed.
98101
* `rack_serial_number` - The serial number for the Exadata infrastructure.
99102
* `shape` - The shape of the Exadata infrastructure. The shape determines the amount of CPU, storage, and memory resources allocated to the instance.

website/docs/d/database_exadata_infrastructures.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ The following attributes are exported:
104104
* `monthly_db_server_version` - The monthly software version of the database servers (dom0) in the Exadata infrastructure.
105105
* `multi_rack_configuration_file` - The base64 encoded Multi-Rack configuration json file.
106106
* `netmask` - The netmask for the control plane network.
107+
* `network_bonding_mode_details` - Details of bonding mode for Client and Backup networks of an Exadata infrastructure.
108+
* `backup_network_bonding_mode` - The network bonding mode for the Exadata infrastructure.
109+
* `client_network_bonding_mode` - The network bonding mode for the Exadata infrastructure.
107110
* `ntp_server` - The list of NTP server IP addresses. Maximum of 3 allowed.
108111
* `rack_serial_number` - The serial number for the Exadata infrastructure.
109112
* `shape` - The shape of the Exadata infrastructure. The shape determines the amount of CPU, storage, and memory resources allocated to the instance.

website/docs/r/database_exadata_infrastructure.html.markdown

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ resource "oci_database_exadata_infrastructure" "test_exadata_infrastructure" {
7171
weeks_of_month = var.exadata_infrastructure_maintenance_window_weeks_of_month
7272
}
7373
multi_rack_configuration_file = var.exadata_infrastructure_multi_rack_configuration_file
74+
network_bonding_mode_details {
75+
76+
#Optional
77+
backup_network_bonding_mode = var.exadata_infrastructure_network_bonding_mode_details_backup_network_bonding_mode
78+
client_network_bonding_mode = var.exadata_infrastructure_network_bonding_mode_details_client_network_bonding_mode
79+
}
7480
storage_count = var.exadata_infrastructure_storage_count
7581
}
7682
```
@@ -100,7 +106,7 @@ The following arguments are supported:
100106
* `infini_band_network_cidr` - (Required) (Updatable) The CIDR block for the Exadata InfiniBand interconnect.
101107
* `is_cps_offline_report_enabled` - (Optional) (Updatable) Indicates whether cps offline diagnostic report is enabled for this Exadata infrastructure. This will allow a customer to quickly check status themselves and fix problems on their end, saving time and frustration for both Oracle and the customer when they find the CPS in a disconnected state.You can enable offline diagnostic report during Exadata infrastructure provisioning. You can also disable or enable it at any time using the UpdateExadatainfrastructure API.
102108
* `is_multi_rack_deployment` - (Optional) (Updatable) Indicates if deployment is Multi-Rack or not.
103-
* `maintenance_window` - (Optional) (Updatable) The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window.
109+
* `maintenance_window` - (Optional) (Updatable) The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window.
104110
* `custom_action_timeout_in_mins` - (Optional) (Updatable) Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive).
105111
* `days_of_week` - (Optional) (Updatable) Days during the week when maintenance should be performed.
106112
* `name` - (Required) (Updatable) Name of the day of the week.
@@ -118,6 +124,9 @@ The following arguments are supported:
118124
* `weeks_of_month` - (Optional) (Updatable) Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed.
119125
* `multi_rack_configuration_file` - (Optional) (Updatable) The base64 encoded Multi-Rack configuration json file.
120126
* `netmask` - (Required) (Updatable) The netmask for the control plane network.
127+
* `network_bonding_mode_details` - (Optional) (Updatable) Details of bonding mode for Client and Backup networks of an Exadata infrastructure.
128+
* `backup_network_bonding_mode` - (Optional) (Updatable) The network bonding mode for the Exadata infrastructure.
129+
* `client_network_bonding_mode` - (Optional) (Updatable) The network bonding mode for the Exadata infrastructure.
121130
* `ntp_server` - (Required) (Updatable) The list of NTP server IP addresses. Maximum of 3 allowed.
122131
* `shape` - (Required) The shape of the Exadata infrastructure. The shape determines the amount of CPU, storage, and memory resources allocated to the instance.
123132
* `storage_count` - (Optional) The number of storage servers for the Exadata infrastructure.
@@ -187,6 +196,9 @@ The following attributes are exported:
187196
* `monthly_db_server_version` - The monthly software version of the database servers (dom0) in the Exadata infrastructure.
188197
* `multi_rack_configuration_file` - The base64 encoded Multi-Rack configuration json file.
189198
* `netmask` - The netmask for the control plane network.
199+
* `network_bonding_mode_details` - Details of bonding mode for Client and Backup networks of an Exadata infrastructure.
200+
* `backup_network_bonding_mode` - The network bonding mode for the Exadata infrastructure.
201+
* `client_network_bonding_mode` - The network bonding mode for the Exadata infrastructure.
190202
* `ntp_server` - The list of NTP server IP addresses. Maximum of 3 allowed.
191203
* `rack_serial_number` - The serial number for the Exadata infrastructure.
192204
* `shape` - The shape of the Exadata infrastructure. The shape determines the amount of CPU, storage, and memory resources allocated to the instance.

0 commit comments

Comments
 (0)