Hello,
Since recently, I had to introduce changes to the packer code, so that it creates images from a base image, using the "base_image_filter" option.
This part of source "oracle-oci", and the code could potentially use two types of images, which are both in the same compartment. The code I use for finding both the images looks like this:
base_image_filter {
compartment_id = "ocid1.compartment.oc1..EXAMPLE"
display_name_search = "^img_oci_oel_8\\.4.*"
operating_system = "Oracle Linux"
operating_system_version = "8.4"
}
The two base images at my disposal have the following names:
img_oci_oel_8.4_123456_1.11.22.3333
img_oci_oel_7.9_123456_1.11.22.3333
Now, when I try this with 7.9:
display_name_search = "^img_oci_oel_7\\.9.*"
operating_system_version = "7.9"
packer manages to find the image and I can proceed.
However, if I try the first piece of code, it errors out with message:
==> oracle-oci.custom-db-dev-image: Using existing SSH private key
==> oracle-oci.custom-db-dev-image: Pausing after run of step 'StepKeyPair'. Press enter to continue.
==> oracle-oci.custom-db-dev-image: Creating instance...
==> oracle-oci.custom-db-dev-image: Problem creating instance: base_image_filter returned no images
==> oracle-oci.custom-db-dev-image: Problem creating instance: base_image_filter returned no images
==> oracle-oci.custom-db-dev-image: Step "stepCreateInstance" failed
I tried different combinations for operating_system_version and operating_system, and the only thing that really did work was if I change the regexp for display_name_search to "^img_oci_oel_8.*", but I lose the minor version part, so it doesn't really work for me, as I have to comply with specific minor versions (part of the name).
When I started an instance from the Linux 8 image, I get the following in the /etc/os-release:
NAME="Oracle Linux Server"
VERSION="8.4"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.4"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:4:server"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.4
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.4
With 7.9 I get the same, just that "8" is "7" and "4" is "9".
Please tell me if there's something wrong I am doing, or if there's some sort of a problem with Packer itself.
Packer version: 1.7.2
OCI version: 3.0.1
Thanks