What IBM Classic package and process keys do I need?
Find IBM Cloud Classic Infrastructure packages and processes related to Terraform deployments.
Overview
This is a quick guide to finding the package and process keys for IBM Cloud Classic Infrastructure Terraform deployments. Due to the numerous options available, it can be difficult to find the correct package and process keys that the IBM Terraform provider requires.
If you don’t have the IBM Cloud CLI installed locally, you can use IBM Cloud Shell to run the commands. Cloud Shell is preconfigured with the full IBM Cloud CLI and numerous plug-ins and tools so that you can work in IBM Cloud without having to install anything locally.
If running these commands locally, ensure you have
jq
installed.
Find available Bare Metal packages
ibmcloud sl order package-list --output json | jq -r '.[] | select(.type.keyName=="BARE_METAL_CPU") | .keyName,.id'
This should return all normal bare metal packages (aka not preset configs). Unfortunately you have to sift a little bit, but looking for things like 2U
or DUAL
will steer you in the right direction.
Find package_key_name
Once you have the package ID, in this case I am using package 839, you can get the package_key_name with the following call:
ibmcloud sl order package-list --output json | jq -r '.[] | select(.type.keyName=="BARE_METAL_CPU") | select(.id==839) | .keyName'
2U_DUAL_INTEL_XEON_PROCESSOR_SCALABLE_FAMILY_12_DRIVES
Find os_reference_code
From there you can find available Operating systems for the package:
ibmcloud sl call-api Product_Package getItems --init 839 --mask "prices[id,categories[id,name,categoryCode],capacityRestrictionType,capacityRestrictionMinimum,capacityRestrictionMaximum,locationGroupId]" | jq -r '.[] | select(.itemCategory.categoryCode=="os") .keyName'
Example output
ibmcloud sl call-api Product_Package getItems --init 839 --mask "prices[id,categories[id,name,categoryCode],capacityRestrictionType,capacityRestrictionMinimum,capacityRestrictionMaximum,locationGroupId]" | jq -r '.[] | select(.itemCategory.categoryCode=="os") .keyName'
...
OS_NO_OPERATING_SYSTEM
OS_WINDOWS_SERVER_2016_DATACENTER_EDITION_64_BIT
OS_VIRTUOZZO_7_5_VMS
OS_WINDOWS_2012_R2_FULL_STD_64_BIT
OS_WINDOWS_SERVER_2019_DATACENTER_EDITION_WITH_HYPERV_64_BIT
QUANTASTOR_5_X_48_TB_MEDIUM_TIER
OS_ROCKY_LINUX_8_X_64_BIT
OS_CENTOS_STREAM_8_X_64_BIT
OS_CENTOS_7_X_64_BIT
OS_WINDOWS_SERVER_2016_DATACENTER_EDITION_WITH_HYPERV_64_BIT
OS_WINDOWS_SERVER_2012_DATACENTER_EDITION_64_BIT
OS_DEBIAN_9_X_STRETCH_64_BIT
OS_WINDOWS_2012_R2_FULL_DC_64_BIT_2
OS_QUANTASTOR_5_X_4_TB_QUANTASTOR_EXTRA_SMALL_TIER
OS_QUANTASTOR_5_X_16_TB_QUANTASTOR_SMALL_TIER
OS_QUANTASTOR_5_X_48_TB_QUANTASTOR_MEDIUM_TIER
OS_WINDOWS_2012_FULL_DC_64_BIT
OS_CITRIX_HYPERVISOR_8_2_0
OS_UBUNTU_22_04_LTS_JAMMY_JELLYFISH_64_BIT
Find process_key_name
Finally, you can find the process_key_name:
ibmcloud sl call-api Product_Package getItems --init 839 --mask "prices[id,categories[id,name,categoryCode],capacityRestrictionType,capacityRestrictionMinimum,capacityRestrictionMaximum,locationGroupId]" | jq -r '.[] | select(.itemCategory.categoryCode=="server") .keyName'
Example output for process_key_name
ibmcloud sl call-api Product_Package getItems --init 839 --mask "prices[id,categories[id,name,categoryCode],capacityRestrictionType,capacityRestrictionMinimum,capacityRestrictionMaximum,locationGroupId]" | jq -r '.[] | select(.itemCategory.categoryCode=="server") .keyName'
INTEL_INTEL_XEON_6140_2_30
INTEL_INTEL_XEON_5120_2_20
INTEL_INTEL_XEON_4110_2_10
Example Terraform configuration
The fully contstucted Terraform configuration would look something like this:
resource "ibm_compute_bare_metal" "monthly_bm1" {
package_key_name = "2U_DUAL_INTEL_XEON_PROCESSOR_SCALABLE_FAMILY_12_DRIVES"
process_key_name = "INTEL_INTEL_XEON_5120_2_20"
memory = 384
os_key_name = "OS_UBUNTU_22_04_LTS_JAMMY_JELLYFISH_64_BIT"
hostname = var.hostname
domain = var.domain
datacenter = var.datacenter
network_speed = 10000
public_bandwidth = 500
disk_key_names = ["HARD_DRIVE_960GB_SSD", "HARD_DRIVE_960GB_SSD"]
hourly_billing = false
ssh_key_ids = [var.ssh_key_ids]
private_network_only = false
unbonded_network = true
public_vlan_id = var.public_vlan_id
private_vlan_id = var.private_vlan_id
tags = var.tags
redundant_power_supply = true
storage_groups {
# RAID 1
array_type_id = 2
# Use the first two disks
hard_drives = [0, 1]
array_size = 960
}
}