Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PowerVS Quick Deploy for Developers

A simple Terraform configuration to quickly deploy IBM PowerVS instances for development and experimentation.

Prerequisites

  • Terraform >= 1.0
  • IBM Cloud account with PowerVS service access
  • IBM Cloud API Key (Create one here)
  • SSH key pair for instance access

Quick Start

1. Generate SSH Keys

ssh-keygen -t ed25519 -f ./power_vs

This creates two files:

  • power_vs (private key - keep secure!)
  • power_vs.pub (public key - used by Terraform)

2. Configure Variables

Copy the example configuration:

cp terraform.tfvars.example terraform.tfvars

Edit terraform.tfvars and set your values:

ibm_cloud_api_key = "your-api-key-here"
pi_ssh_key_path   = "./power_vs.pub"
pi_instance_name  = "my-dev-instance"

3. Deploy

Initialize Terraform:

terraform init

Review the deployment plan:

terraform plan

Deploy the infrastructure:

terraform apply

Type yes when prompted to confirm.

4. Connect to Your Instance

After deployment completes, Terraform will output connection details:

# View all outputs
terraform output

# Get SSH command
terraform output ssh_command

Connect using:

ssh -i ./power_vs root@<instance-ip>

Configuration Options

Instance Sizing

Variable Description Default Options
pi_memory Memory in GB 8 Min: 2, Max: depends on system type
pi_processors vCPUs 0.25 0.25, 0.5, 1, 2, 4, 8, etc.

System Types

See IBM PowerVS Compute options for more information on the available system types.

Type Description Use Case
s922 POWER9 (9009-22A) Great for testing (default)
s1022 POWER10 (9105-22A) General purpose
s1122 POWER11 (9824-22A) Latest generation
e980 Enterprise POWER9 (9080-M9S) Enterprise workloads
e1050 Enterprise POWER10 (9043-MRX) Enterprise mid-range
e1080 Enterprise POWER10 (9080-HEX) Maximum performance

Processor Types

Type Description Best For
shared Shared processors (default) Development, testing, cost-effective
dedicated Dedicated processors Production workloads
capped Capped shared processors Predictable performance

Storage Tiers

Tier Description IOPS Cost
tier3 Standard (default) 3 IOPS/GB Lower
tier1 High performance 10 IOPS/GB Higher

Secondary Volumes

You can optionally attach an additional data volume to your instance for extra storage:

Variable Description Default Options
pi_create_secondary_volume Enable secondary volume false true or false
pi_secondary_volume_size Volume size in GB 100 Min: 10
pi_secondary_volume_type Storage tier for volume tier3 tier1, tier3

Example configuration:

pi_create_secondary_volume = true
pi_secondary_volume_size   = 200
pi_secondary_volume_type   = "tier3"

After deployment, the volume is automatically attached to your instance; you'll still need to rescan, format, and mount it from within the OS.

Volume outputs are available after deployment:

terraform output secondary_volume_id
terraform output secondary_volume_size

Image Import from IBM Cloud Catalog

This configuration automatically imports images from the IBM Cloud catalog into your PowerVS workspace. You need to provide the pi_image_id - the catalog image ID to import.

Finding Catalog Image IDs

List available images in the IBM Cloud catalog:

# List all catalog images for PowerVS
ibmcloud pi image list-catalog

Common Catalog Image IDs

AIX Images:

  • AIX 7.4 (7300-04-01): 627a4b93-e631-41b8-90b3-cf00553fbe76

Linux Images:

  • CentOS-Stream-10: 5d543226-04c0-4ca2-bbe2-337cfe18bae7
  • RHEL/CentOS-Stream/SLES: Check catalog for latest IDs

IBM i Images:

  • Check catalog for latest IBM i image IDs

Example Configuration

pi_image_id = "5d543226-04c0-4ca2-bbe2-337cfe18bae7"

The image will be imported into your workspace on first terraform apply and reused for subsequent deployments.

Managing Your Instance

View Instance Status

terraform show

Update Configuration

  1. Edit terraform.tfvars
  2. Run terraform plan to preview changes
  3. Run terraform apply to apply changes

Destroy Resources

When you're done experimenting:

terraform destroy

Type yes to confirm deletion of all resources.

Troubleshooting

Authentication Issues

If you get authentication errors:

# Verify your API key is valid
ibmcloud login --apikey YOUR_API_KEY

# Check your account has PowerVS access
ibmcloud resource service-instances --service-name power-iaas

SSH Connection Issues

If you can't connect via SSH:

  1. Verify the instance is running: terraform output instance_status
  2. Check the external IP: terraform output instance_external_ip
  3. Ensure your SSH key permissions: chmod 600 ./power_vs
  4. Wait 2-3 minutes after deployment for the instance to fully boot

Image Not Found

If the image ID is invalid:

# List available images
ibmcloud pi workspace target WORKSPACE_ID
ibmcloud pi images

Project Structure

.
├── main.tf                    # Main Terraform configuration
├── vars.tf                    # Variable definitions
├── outputs.tf                 # Output definitions
├── terraform.tfvars.example   # Example configuration
├── terraform.tfvars           # Your configuration (gitignored)
└── README.md                  # This file

Security Best Practices

  1. Never commit terraform.tfvars or SSH private keys to version control
  2. Rotate your IBM Cloud API keys regularly
  3. Use dedicated API keys for automation (not your personal key)
  4. Restrict SSH access using security groups (add to configuration as needed)
  5. Delete resources when not in use to avoid unnecessary costs

Additional Resources

Support

For issues with:

License

This project is provided as-is for educational and development purposes.

About

Terraform configuration for easily deploying PowerVS instances to the IBM Cloud for development, testing and hobbying purposed

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages