Skip to content

Oracle update exadata infra to support X11M shape #29801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mihretkidane-OCI
Copy link
Contributor

@mihretkidane-OCI mihretkidane-OCI commented Jun 4, 2025

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

The following changes have been made to the Oracle provider to support the new Oracle Cloud Infrastructure Exadata Infrastructure X11M shape.

oracle_exadata_infrastructure_resource , oracle_exadata_infrastructure_data_source

Added new Optional Arguments

  • database_server_type: The database server mo del type of the cloud Exadata infrastructure resource.
  • storage_server_type: The storage server model type of the cloud Exadata infrastructure resource.

New Attributes:

  • compute_model: The compute model of the Exadata Infrastructure was added to the following resource

oracle_db_system_shapes_data_source

New Optional argument

  • zone : the availability zone filter added

New attributes

  • are_server_types_supported: Indicates if the shape supports database and storage server types
  • display_name: The display name of the shape used for the DB system
  • compute_model: The compute model of the Exadata Infrastructure was added to the following resource

oracle_cloud_vm_cluster_data_source, oracle_cloud_vm_cluster_resource

New attributes

  • compute_model: The compute model of the Exadata Infrastructure was added to the following resource

oracle_db_servers_data_source

New attributes

  • compute_model: The compute model of the Exadata Infrastructure was added to the following resource

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)
  • [ ]
    20250604-202436-screenshot
    20250604-185740-screenshot
    20250604-181900-screenshot
    20250604-180435-screenshot
    20250604-171159-screenshot
    20250606-141242-screenshot

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_resource - support for the thing1 property [GH-00000]

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #29820

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the provider.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@mihretkidane-OCI mihretkidane-OCI requested a review from a team as a code owner June 4, 2025 16:38
@evgen-work evgen-work force-pushed the oracle-update-exadata-infra branch from 126bd5a to 331811d Compare June 4, 2025 16:38
@evgen-work evgen-work force-pushed the oracle-update-exadata-infra branch 2 times, most recently from 8107220 to 7dc06e5 Compare June 6, 2025 14:54
@v-ehua v-ehua mentioned this pull request Jun 10, 2025
14 tasks
@mybayern1974
Copy link
Collaborator

@mihretkidane-OCI , thank you for composing this PR. To add a new feature that resides in a new Azure service API version, the best practice recommended in AzureRM is to split them into several PRs for better fine granularity mgmt. Take this PR as example, it does two actions: 1) introduce the new version of Hashicorp Azure SDK to this repo + Have related services consume the new service API version 2) business code update. These two actions are expected to be split into 2 PRs, separately, and we can imagine the first PR could be reviewed and merged quickly.

With the current state, we can see another Azure Oracle PR 29833 would have to rebase to this PR, or vice versa.

Another suggestion is to use the same API version to manage all resources in a Resource Provider though using multiple API versions in parallel is not forbidden. To use the latter way as this PR does that co-uses 2024-06-01 and 2025-03-01, it’s recommended to comment why the latter new API version cannot solely cover all needed functionalities.

I’m sharing here a previous PR 28825 as a reference that embodies the above 2 suggested practices.

@mihretkidane-OCI
Copy link
Contributor Author

mihretkidane-OCI commented Jun 18, 2025

@mybayern1974 I have another PR to upgrade the client to the new version , however I couldn't merge it because it will introduce a breaking change if merged right away. For that reason we are working on a fix to our service so we wont introduce a breaking change , However with the timeline that we have and business requirement we are requesting to keep both clients in this PR and merge it. The other PRs like oracle 29833 will rebase once this PR is merged or vice versa.

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mihretkidane-OCI - There's a few review comments to check below if you can take a look. Thanks!

@@ -466,6 +472,7 @@ func (d CloudVmClusterDataSource) Read() sdk.ResourceFunc {
state.CloudExadataInfrastructureId = props.CloudExadataInfrastructureId
state.ClusterName = pointer.From(props.ClusterName)
state.CompartmentId = pointer.From(props.CompartmentId)
state.ComputeModel = string(pointer.From(props.ComputeModel))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a helper for this

Suggested change
state.ComputeModel = string(pointer.From(props.ComputeModel))
state.ComputeModel = pointer.FromEnum(props.ComputeModel)

@@ -192,7 +220,9 @@ func (d DbSystemShapesDataSource) Read() sdk.ResourceFunc {
AvailableDbNodeStorageInGbs: pointer.From(props.AvailableDbNodeStorageInGbs),
AvailableMemoryInGbs: pointer.From(props.AvailableMemoryInGbs),
AvailableMemoryPerNodeInGbs: pointer.From(props.AvailableMemoryPerNodeInGbs),
ComputeModel: string(pointer.From(props.ComputeModel)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

Suggested change
ComputeModel: string(pointer.From(props.ComputeModel)),
ComputeModel: pointer.FromEnum(props.ComputeModel),

Comment on lines 56 to 58
check.That(data.ResourceName).Key("shape").HasValue("Exadata.X11M"),
check.That(data.ResourceName).Key("database_server_type").HasValue("X11M"),
check.That(data.ResourceName).Key("storage_server_type").HasValue("X11M-HC"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be unnecessary as the import check will validate that all values match those in the config on read.

Suggested change
check.That(data.ResourceName).Key("shape").HasValue("Exadata.X11M"),
check.That(data.ResourceName).Key("database_server_type").HasValue("X11M"),
check.That(data.ResourceName).Key("storage_server_type").HasValue("X11M-HC"),

}

if len(v) < 1 || len(v) > 255 {
errors = append(errors, fmt.Errorf("databse_server_type must be %d to %d characters", 1, 255))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
errors = append(errors, fmt.Errorf("databse_server_type must be %d to %d characters", 1, 255))
errors = append(errors, fmt.Errorf("%s must be %d to %d characters", k, 1, 255))

}

if len(v) < 1 || len(v) > 255 {
errors = append(errors, fmt.Errorf("storage_server_type must be %d to %d characters", 1, 255))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
errors = append(errors, fmt.Errorf("storage_server_type must be %d to %d characters", 1, 255))
errors = append(errors, fmt.Errorf("%s must be %d to %d characters", k, 1, 255))

Comment on lines 248 to 253
if len(model.DatabaseServerType) > 0 {
param.Properties.DatabaseServerType = pointer.To(model.DatabaseServerType)
}
if len(model.StorageServerType) > 0 {
param.Properties.StorageServerType = pointer.To(model.StorageServerType)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checks should be type specific:

Suggested change
if len(model.DatabaseServerType) > 0 {
param.Properties.DatabaseServerType = pointer.To(model.DatabaseServerType)
}
if len(model.StorageServerType) > 0 {
param.Properties.StorageServerType = pointer.To(model.StorageServerType)
}
if model.DatabaseServerType != "" {
param.Properties.DatabaseServerType = pointer.To(model.DatabaseServerType)
}
if model.StorageServerType != "" {
param.Properties.StorageServerType = pointer.To(model.StorageServerType)
}

@evgen-work evgen-work force-pushed the oracle-update-exadata-infra branch from 176b252 to 79915b2 Compare July 3, 2025 15:57
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mihretkidane-OCI - Just a couple of items to take a look at below, but this should be fine after those are addressed.

@mihretkidane-OCI
Copy link
Contributor Author

@jackofallops please help review the PR

@evgen-work evgen-work force-pushed the oracle-update-exadata-infra branch from e2ec5ad to ef5e626 Compare July 4, 2025 16:44
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @mihretkidane-OCI - This LGTM now 👍

@jackofallops jackofallops merged commit bdaa0bf into hashicorp:main Jul 7, 2025
33 checks passed
@github-actions github-actions bot added this to the v4.36.0 milestone Jul 7, 2025
jackofallops added a commit that referenced this pull request Jul 7, 2025
mbfrahry pushed a commit that referenced this pull request Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Oracle Exadata X11M shape
4 participants