This is my sixth #DaysOfArm article that tracks some of the experiences that I’ve had so far. And just to recap from the first post (here) on June 12 2021.
It’s been just over 2 weeks since the launch of Ampere Arm deployed in Oracle Cloud Infrastructure (OCI). Check this article out to learn more (here). And it’s been about one week since I started looking into the new architecture and deployment, since I started provisioning the VM.Standard.A1.Flex Compute Shape on OCI and since I started migrating a specific application that has many different variations to it to test it all out.
This is my next learning.
I’ve been on the automation side of Oracle Cloud Infrastructure and working with Ansible and Terraform. To provision compute images, you need to know the specific image you want to use. A documented catalog of the images can be found (here).
In the README sections of each of these images you can find further details including the important OCID which is used to identify the image in the Ansible and Terraform. Note that the OCID are different for each region.
This is great for a once off. And in Oracle Resource Manager, this isn’t an issue because you can use the tooling to create a better user experience by selecting the image itself.
BUT … if you are doing this externally on a build server and you want to be more dynamic, then using the OCI SDK is the way you can get this information. Here are a couple of examples that I used:
To get the full of images (in JSON format) for the Melbourne region.
oci --region MEL compute image list --compartment-id ocid1.tenancy.oc1..TENANCY_ID --all
The result looked like this:
To get this same list but in a concise CSV format using jq.
oci --region MEL compute image list --compartment-id ocid1.tenancy.oc1..TENANCY_ID --all | jq -r ".data | [.\"display-name\", .id] | @csv"
This result looked like this:
If I want a subset, then I can filter this list. I wanted to just have a look at the Arm images.
oci --region MEL compute image list --compartment-id ocid1.tenancy.oc1..TENANCY_ID --all | jq -r ".data | select(.\"display-name\" | contains(\"arch\")) | [.\"display-name\", .id] | @csv"
And the result was this.
These calls are region-specific so you will need to repeat this command for the different regions you have access. If you try to run this command in a region that you are not subscribed to, it will return saying that you are not authorised.
There are different ways that you can get access to the right compute images that I need to use to provision your Compute VM on OCI.
If you want to try this out yourself or work on your own application, sign-up (here) for the free Oracle Cloud Trial. I’d be interested to hear your experiences and learn from others as well. Leave a comment or contact me at firstname.lastname@example.org if you want to collaborate.
There’s plenty of work to make this more achievable for everyone. And hence sharing this knowledge is the reason why I’m writing this series – #XDaysOfArm. I’ll keep documenting as long as I keep learning.