oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
758 stars 681 forks source link

issue while updating/deleting ExaCC VM Cluster - oci_database_vm_cluster #2183

Open praseedmc-oracle opened 2 months ago

praseedmc-oracle commented 2 months ago

Community Note

Terraform Version and Provider Version

Terraform version: 1.5.5 Provider: 6.9.0

Affected Resource(s)

oci_database_vm_cluster https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/database_vm_cluster

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. 
# Please remove any sensitive information from configuration files before sharing them. 

############################

Resource Block - Database

Create ExaVMClusters

############################

resource "oci_database_vm_cluster" "test_vm_cluster" {

Required

compartment_id = var.compartment_id
cpu_core_count = var.vm_cluster_cpu_core_count
display_name = var.vm_cluster_display_name
exadata_infrastructure_id = var.exadata_infrastructure_id
gi_version = var.vm_cluster_gi_version
ssh_public_keys = var.vm_cluster_ssh_public_keys
vm_cluster_network_id = var.vm_cluster_network_id

#Optional
data_collection_options {

    #Optional
    is_diagnostics_events_enabled = var.is_diagnostics_events_enabled
    is_health_monitoring_enabled = var.is_health_monitoring_enabled
    is_incident_logs_enabled = var.is_incident_logs_enabled
}
data_storage_size_in_tbs = var.data_storage_size_in_tbs
db_node_storage_size_in_gbs = var.db_node_storage_size_in_gbs
db_servers = var.db_servers
defined_tags = var.defined_tags
freeform_tags = var.freeform_tags
is_local_backup_enabled = var.is_local_backup_enabled
is_sparse_diskgroup_enabled = var.is_sparse_diskgroup_enabled
license_model = var.license_model
memory_size_in_gbs = var.memory_size_in_gbs
system_version = var.system_version
timeouts {
create = "12h"
update = "2h"
delete = "3h"

} time_zone = var.time_zone

}

Debug Output

Terraform plan/Error:

│ Error: Unsupported argument │ │ on .terraform/modules/exa-vmclusters-exacc/Modules/modules/database/ExaCC/exa-vmcluster/main.tf line 44, in resource "oci_database_vm_cluster" "test_vm_cluster": │ 44: update = "2h" │ │ An argument named "update" is not expected here. ╵ ╷ │ Error: Unsupported argument │ │ on .terraform/modules/exa-vmclusters-exacc/Modules/modules/database/ExaCC/exa-vmcluster/main.tf line 45, in resource "oci_database_vm_cluster" "test_vm_cluster": │ 45: delete = "3h" │ │ An argument named "delete" is not expected here.

Panic Output

Expected Behavior

We are trying destroy ExaCC vmcluster using terraform . Though destruction was successful from console, terraform was throwing timeout error (Attached screenshot) To fix it we have introduced timeouts parameter as below.

timeouts {
create = "12h"
update = "2h"
delete = "3h"

}

But terraform plan is throwing an error stating "Unsupported argument .An argument named "delete" is not expected here". "Unsupported argument .An argument named "update" is not expected here".

Attached error screenshots

Expected behavior was updated and delete timeout should be supported by "oci_database_vm_cluster" resource.



### Actual Behavior

<!--- What actually happened? --->

The default timeouts are much lesser EXaCC VM cluster resource(oci_database_vm_cluster-->20min) and terraform plan is giving below error.

"Unsupported argument .An argument named "delete" is not expected here". 
"Unsupported argument .An argument named "update" is not expected here". 

Where in  ExaDB-'D the default timeouts are much higher (oci_database_cloud_vm_cluster-->12hr)  and we don't have any issue there.

### Steps to Reproduce

<!--- Please list the steps required to reproduce the issue. --->

1. `terraform apply`

### Important Factoids

<!--- Is there anything atypical about your environment that we should know? For example: Is the issue specific to a region? --->

### References

<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests

Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor documentation? For example:
--->

Terraform plan/Error:

│ Error: Unsupported argument
│
│ on .terraform/modules/exa-vmclusters-exacc/Modules/modules/database/ExaCC/exa-vmcluster/main.tf line 44, in resource "oci_database_vm_cluster" "test_vm_cluster":
│ 44: update = "2h"
│
│ An argument named "update" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│ on .terraform/modules/exa-vmclusters-exacc/Modules/modules/database/ExaCC/exa-vmcluster/main.tf line 45, in resource "oci_database_vm_cluster" "test_vm_cluster":
│ 45: delete = "3h"
│
│ An argument named "delete" is not expected here.
albertyckwok commented 2 months ago

Just in case it help, I notice this problem on Feb 13, 2024. I check my change log on my terraform create VM cluster resource block. I added the delete time out on Jan 24, 2024 and remove it on Feb 13, 2024. This means that it is likely something changes between Jan 24 and Feb 13.

slevey commented 2 months ago

File: internal/service/database/database_vm_cluster_resource.go Commit: cc9d5b0 Support was added for declaring a custom Timeout for Create at 30m. This did not include Delete or Update.

This is not consistent with the documented Timeout behavior: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/database_vm_cluster

The timeouts block allows you to specify timeouts for certain operations: create - (Defaults to 20 minutes), when creating the Vm Cluster update - (Defaults to 20 minutes), when updating the Vm Cluster * delete - (Defaults to 20 minutes), when destroying the Vm Cluster

Custom Timeouts appear to be included for: internal/service/database/database_cloud_vm_cluster_resource.go

tf-oci-pub commented 2 months ago

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.

praseedmc-oracle commented 2 months ago

Any ETA for fix?

praseedmc-oracle commented 2 months ago

Hi Team,

Can you provide an ETA on this?

Thanks Praseed M C

praseedmc-oracle commented 1 month ago

Hi Team,

Can you provide an ETA on this?

Thanks Praseed M C