Skip to content

oci_core_images returns incompatible GPU image as the first available Oracle Linux 7.4 #345

@jlamillan

Description

@jlamillan

Description:

It looks like oci_core_images is now returning a GPU image as the first image in the list, which will cause an error unless the user is using the BM.GPU2.2 shape.

IMO, this is a problem since a lot of the example code sets up their oci_core_images data source like:

data "oci_core_images" "ImageOCID" {
  compartment_id           = "${var.compartment_ocid}"
  operating_system         = "${var.os}"
  operating_system_version = "${var.version}"
}

and use it like:

resource "oci_core_instance" "TFInstance" {
  ...
  image               = "${lookup(data.oci_core_images.ImageOCID.images[0], "id")}"
  shape               = ANY SHAPE BESIDES BM.GPU2.2
  ...
}

However, when var.os=Oracle Linux and var.version=7.4 and you try and create an instance, you'll get an error:

Terraform Plan

``` * oci_core_instance.TFInstanceK8sMaster: Status: 400; Code: InvalidParameter; OPC Request ID: /XXXXX; Message: Shape VM.Standard1.8 is not valid for image ocid1.image.oc1.iad.aaaaaaaaflaxipg2k4l7mjudowij5vic76jjnqgzktw46pga4knjpqcrxw6a. ```

Assuming the image ordering for Oracle Linux 7.4 is here to stay, users would be better off passing the image name in directly in the data source like so:

data "baremetal_core_images" "ImageOCID" {
    compartment_id = "${var.compartment_ocid}"
    display_name = "Oracle-Linux-7.4-2017.08.25-0"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions