oracle-terraform-modules / terraform-oci-compute-instance

Terraform Module for creating Oracle Cloud Infrastructure compute instances
https://registry.terraform.io/modules/oracle-terraform-modules/compute-instance/oci/latest
Other
46 stars 62 forks source link

provisioning error when bustable instance parameter `baseline_ocpu_utilization` is used with incompatible shapes #90

Open kral2 opened 2 years ago

kral2 commented 2 years ago

Community Note

Terraform Version and Provider Version

Terraform v1.1.4
+ provider registry.terraform.io/hashicorp/oci v4.61.0

Affected Resource(s)

oci_core_instance

When setting baseline_ocpu_utilization value to something different than "BASELINE_1_1", if the shape designated by var.shape is not comaptible with subcore feature, it produce an error.

Currently, only E3 shapes are compatible with this feature.

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.

Debug Output

 Error: 404-NotAuthorizedOrNotFound
β”‚ Provider version: 4.61.0, released on 2022-01-26.
β”‚ Service: Core Instance
β”‚ Error Message: shape VM.Standard.E4.Flex not found
β”‚ OPC request ID: 24459ddc9f9a6078...
β”‚ Suggestion: Either the resource has been deleted or service Core Instance need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm
β”‚
β”‚
β”‚   with module.instance_compute.oci_core_instance.instance[1],
β”‚   on .terraform/modules/instance_compute/main.tf line 67, in resource "oci_core_instance" "instance":
β”‚   67: resource "oci_core_instance" "instance" {

Panic Output

N/A

Expected Behavior

update compute instance baseline_ocpu_utilization

Actual Behavior

error preventing to update the shape to the desired state.

Steps to Reproduce

  1. set baseline_ocpu_utilization to "BASELINE_1_2" or "BASELINE_1_8" with var.shape="VM.Standard.E4.Flex"
  2. terraform apply

Important Factoids

As this feature is only supported for specific shapes, and the error message produced by the provider is not clear enough, we should test the shape compatibility and prevent its misuse.

References