Skip to content
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

400-InvalidParameter, Shape is not valid for image #2103

Open
ngochieu642 opened this issue May 1, 2024 · 0 comments
Open

400-InvalidParameter, Shape is not valid for image #2103

ngochieu642 opened this issue May 1, 2024 · 0 comments
Labels

Comments

@ngochieu642
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request

Terraform Version and Provider Version

terraform -v
Terraform v1.5.7
on linux_amd64
+ provider registry.terraform.io/oracle/oci v5.38.0

Affected Resource(s)

  • oci_core_instance

Terraform Configuration Files

  • The source Id I got from inspect another existing instance using the default Ubuntu 22.04
variable "ubuntu_22_04" {
  description = "OS image for Ubuntu 22.04"
  default     = "ocid1.image.oc1.uk-london-1.aaaaaaaaah4o6bubxrmqgocs6fdj3bxlnkb4wqqaruffaaodk2eigubu6g4q"
}

resource "oci_core_instance" "my_vm" {
  availability_domain = local.ad
  compartment_id      = local.compartment_id
  shape               = var.vm_shape["shape"]

  shape_config {
    ocpus         = var.vm_shape["ocpus"]
    memory_in_gbs = var.vm_shape["memory"]
  }

  source_details {
    source_type             = "image"
    boot_volume_size_in_gbs = var.vm_shape["boot_volume_size"]
    source_id = var.ubuntu_22_04
  }

  # Optional
  create_vnic_details {
    assign_public_ip = false
    subnet_id        = oci_core_subnet.my_private_subnet.id
  }
  metadata = {
    ssh_authorized_keys = join("\n", local.authorized_keys)
  }
}

Debug Output

  • No output related since this is API level

Panic Output

  • None

Expected Behavior

  • Create the instance successfully

Actual Behavior

╷
│ Error: 400-InvalidParameter, Shape BM.Standard.E5.192 is not valid for image ocid1.image.oc1.uk-london-1.aaaaaaaaah4o6bubxrmqgocs6fdj3bxlnkb4wqqaruffaaodk2eigubu6g4q.
│ Suggestion: Please update the parameter(s) in the Terraform config as per error message Shape BM.Standard.E5.192 is not valid for image ocid1.image.oc1.uk-london-1.aaaaaaaaah4o6bubxrmqgocs6fdj3bxlnkb4wqqaruffaaodk2eigubu6g4q.
│ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_instance 
│ API Reference: https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Instance/LaunchInstance 
│ Request Target: POST https://iaas.uk-london-1.oraclecloud.com/20160918/instances 
│ Provider version: 5.38.0, released on 2024-04-21. This provider is 1 Update(s) behind to current. 
│ Service: Core Instance 
│ Operation Name: LaunchInstance 
│ OPC request ID: a7858b681070854fa11c5f36f30df90c/29250AC99FCD75D10C401DD84B215807/66C78334E2F1BB12ED1551C323670A6D 
│ 
│ 
│   with module.sam_3TB.oci_core_instance.my_vm,
│   on sam_3TB/compute.tf line 202, in resource "oci_core_instance" "my_vm":
│  202: resource "oci_core_instance" "my_vm" {
│ 

Steps to Reproduce

  1. terraform apply

Important Factoids

References

https://docs.oracle.com/en-us/iaas/Content/Compute/known-issues.htm#a1-image-name-terraform

  • This issue has a workaround but I can not understand the details
@ngochieu642 ngochieu642 added the bug label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant