Hi Jan,
if you want to save some money and don't need LPAR 100% time, just from time to time, I would propose to deploy your LPAR using Terraform. It makes it easier for you to deploy it when you need it and then destroy it when you don't need it anymore.
All you need are:
- Terraform (https://developer.hashicorp.com/terraform/install)
- API key for your account (https://cloud.ibm.com/iam/apikeys)
Now you need to create a single configuration file or you can create multiple files in one directory.
First you must define the Terraform providers to use:
terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
}
local = {
source = "hashicorp/local"
}
null = {
source = "hashicorp/null"
}
}
}
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_apikey
region = var.ibmcloud_region
zone = var.ibmcloud_zone
}
The next step is to create variables:
variable "ibmcloud_apikey" {
type = string
description = "API key to use for IBM Cloud"
default = "your-api-key"
sensitive = true
}
variable "ibmcloud_region" {
type = string
description = "Region in IBM Cloud"
default = "mad"
}
variable "ibmcloud_zone" {
type = string
description = "Zone in IBM Cloud"
default = "mad02"
}
Paste your API key into the variable, and set the region. As you see, I use Madrid.
To create an LPAR in PowerVS you need a workspace:
data "ibm_resource_group" "cloudrg" {
name = "Default"
}
resource "ibm_pi_workspace" "jan_power_ws" {
pi_name = "Jan Power workspace"
pi_datacenter = var.ibmcloud_zone
pi_resource_group_id = data.ibm_resource_group.cloudrg.id
pi_plan = "public"
}
The workspace must be in some resource group. The Default resource group is the standard.
You need a network for your LPAR. I think you want to access the LPAR from your home. In this case you need a public network:
resource "ibm_pi_network" "pubnet" {
pi_network_name = "public-net"
pi_network_type = "pub-vlan"
pi_dns = [ "8.8.8.8" ]
pi_network_mtu = "1450"
pi_cloud_instance_id = ibm_pi_workspace.jan_power_ws.id
}
To access the LPAR you must upload your SSH key to PowerVS:
resource "ibm_pi_key" "jan_ssh" {
pi_key_name = "jan_ssh_key"
pi_ssh_key = file("~/.ssh/id_rsa.pub")
pi_cloud_instance_id = ibm_pi_workspace.jan_power_ws.id
}
Of course, you need a specific AIX version. AFAIU you want to have AIX 7.1 TL5 SP9. We can search for it in IBM's catalog and if it is found, we create a local copy of the image:
data "ibm_pi_catalog_images" "pvs_catalog" {
pi_cloud_instance_id = ibm_pi_workspace.jan_power_ws.id
}
locals {
img_index = index(data.ibm_pi_catalog_images.pvs_catalog.images[*].name, "7100-05-09")
pvs_image = data.ibm_pi_catalog_images.pvs_catalog.images[local.img_index]
}
resource "ibm_pi_image" "aix710509" {
pi_image_id = local.pvs_image.image_id
pi_cloud_instance_id = ibm_pi_workspace.jan_power_ws.id
}
If you wish additional storage you can define it too:
resource "ibm_pi_volume" "datavg" {
pi_volume_size = 20
pi_volume_name = "datavg"
pi_volume_type = "tier1"
pi_volume_shareable = true
pi_cloud_instance_id = ibm_pi_workspace.jan_power_ws.id
}
resource "ibm_pi_volume_attach" "datavg_lpar_attach" {
pi_volume_id = ibm_pi_volume.datavg.volume_id
pi_instance_id = ibm_pi_instance.lpar.instance_id
pi_cloud_instance_id = ibm_pi_workspace.jan_power_ws.id
}
The storage must be attached to an LPAR.
resource "ibm_pi_instance" "lpar" {
pi_instance_name = "jan-aix"
pi_memory = 2
pi_processors = 0.25
pi_proc_type = "shared"
pi_image_id = ibm_pi_image.aix710509.image_id
pi_key_pair_name = ibm_pi_key.jan_ssh.ssh_key_id
pi_sys_type = "s922"
pi_cloud_instance_id = ibm_pi_workspace.jan_power_ws.id
pi_health_status = "WARNING"
pi_storage_type = "tier1"
pi_network {
network_id = ibm_pi_network.pubnet.network_id
}
}
After the LPAR is deployed, we must check the SSH connection and do some initial configuration like installing DNF:
resource "null_resource" "configure_lpar" {
connection {
host = ibm_pi_instance.lpar.pi_network[0].external_ip
user = "root"
private_key = file("~/.ssh/id_rsa")
agent = "false"
timeout = "10m"
}
provisioner "file" {
source = "openssl-3.0.15.1001.tar.Z"
destination = "/tmp/openssl.tar.Z"
}
provisioner "remote-exec" {
inline = [
"set -v",
"set -o errexit",
"chdev -l en0 -a mtu=1476",
"chfs -a size=1G /tmp",
"chfs -a size=2G /opt",
"chfs -a size=2G /var",
"mkdir /tmp/openssl",
"while [[ ! -f /tmp/openssl.tar.Z ]] ; do sleep 1 ; done",
"cd /tmp/openssl",
"uncompress -c /tmp/openssl.tar.Z | tar xf -",
"installp -acgXYd . all",
"cd /",
"rm -rf /tmp/openssl*",
"updtvpkg",
"/usr/opt/perl5/bin/lwp-download https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_aixtoolbox.sh",
"chmod +x dnf_aixtoolbox.sh",
"./dnf_aixtoolbox.sh -y",
"/opt/freeware/bin/dnf -y update",
"ln -s /opt/freeware/bin/dnf /usr/bin/dnf",
"echo 'done!'",
]
}
}
I hope I didn't forget to post something important. At this point you can provision your LPAR in PowerVS:
terraform init
terraform plan
terraform apply
If you don't need it anymore, or some problems occurred, you can destroy all deployed resources:
terraform destroy
------------------------------
Andrey Klyachkin
https://www.power-devops.com------------------------------
Original Message:
Sent: Tue August 05, 2025 01:32 PM
From: Jan Harris
Subject: Has anyone setup a "Test AIX LPAR" on IBM Cloud?
Although I was "ended" by IBM in 2024, I want to keep my AIX skills updated, as I'm still looking for a new position. It seems I can get a Virtual server instance with AIX for $118/month, with storage Tier 3 (3 IOPs / GB), 200GB at $20/month. I've never setup an LPAR on the cloud, and am hoping others have done so, and can advise of any gotchas I should think of. I don't want to get over $150/month, as it is likely that I'll never recoup this cost :-)
Thanks, in advance for any input!
------------------------------
Jan Harris
AIX & Security Support Engineer | Escalations, KCS & Technical Writing | Driving Process Improvement
Austin, TX
------------------------------