Skip to content

ppc64le-cloud/packer-plugin-powervs

Repository files navigation

Packer Plugin for IBM Cloud Power Virtual Server

Go Report Card License

The Packer Plugin for IBM Cloud Power Virtual Server (PowerVS) enables automated creation of custom images on IBM Cloud's Power Systems infrastructure. This plugin provides a builder, provisioner, post-processor, and data source for managing PowerVS resources through Packer.

Features

  • Automated Image Building: Create custom PowerVS images from stock images or Cloud Object Storage (COS) sources
  • Flexible Provisioning: Support for shell scripts, Ansible, and other Packer provisioners
  • Multiple Capture Options: Export images to Cloud Object Storage, Image Catalog, or both
  • Network Management: Automatic DHCP network creation or use existing subnets
  • SSH Support: Built-in SSH communicator for instance configuration
  • Multi-Architecture: Native support for ppc64le architecture

Table of Contents

Requirements

  • Packer >= 1.7.0
  • Go >= 1.18 (for building from source)
  • IBM Cloud Account with PowerVS service
  • IBM Cloud API Key with appropriate permissions

IBM Cloud Prerequisites

  1. PowerVS Service Instance: Create a PowerVS service instance in your desired region
  2. API Key: Generate an IBM Cloud API key with PowerVS access
  3. SSH Key: Upload your SSH public key to PowerVS
  4. Network: Either existing subnet IDs or enable DHCP network creation
  5. Cloud Object Storage (Optional): For importing/exporting images

Installation

Using packer init (Recommended)

Add the following to your Packer template:

packer {
  required_plugins {
    powervs = {
      version = ">= 0.0.1"
      source  = "github.com/ppc64le-cloud/powervs"
    }
  }
}

Then run:

packer init .

Manual Installation

  1. Download the latest release from GitHub Releases
  2. Extract the binary to your Packer plugins directory:
    • Linux/macOS: ~/.packer.d/plugins/
    • Windows: %APPDATA%\packer.d\plugins\

Building from Source

git clone https://github.com/ppc64le-cloud/packer-plugin-powervs.git
cd packer-plugin-powervs
make install

This will build the plugin and install it to your Packer plugins directory automatically.

Alternative: Development Installation

For development purposes, you can use:

make dev

This builds and copies the binary to ~/.packer.d/plugins/ for quick testing.

Quick Start

Create a template file template.pkr.hcl:

packer {
  required_plugins {
    powervs = {
      version = ">= 0.0.1"
      source  = "github.com/ppc64le-cloud/powervs"
    }
  }
}

source "powervs" "example" {
  api_key            = var.ibm_api_key
  service_instance_id = "your-service-instance-id"
  zone               = "lon04"

  source {
    stock_image {
      name = "CentOS-Stream-8"
    }
  }

  instance_name = "packer-${timestamp()}"
  key_pair_name = "your-ssh-key"
  dhcp_network  = true

  ssh_username         = "root"
  ssh_private_key_file = "~/.ssh/id_rsa"

  capture {
    name        = "my-image-${timestamp()}"
    destination = "image-catalog"
  }
}

build {
  sources = ["source.powervs.example"]

  provisioner "shell" {
    inline = ["yum update -y && yum install -y vim"]
  }
}

Initialize and build:

packer init .
packer build -var="ibm_api_key=YOUR_KEY" template.pkr.hcl

For detailed configuration options, see the User Guide and API Reference.

Examples

Documentation

Development

See CONTRIBUTING.md for complete development guide including:

  • Development setup and workflow
  • Building and testing
  • Code standards and best practices
  • Submitting contributions

Contributing

We welcome contributions! See CONTRIBUTING.md for the complete guide.

Quick start: Fork → Create branch → Make changes → Test → Submit PR

Troubleshooting

Having issues? Check the Troubleshooting Guide for solutions to common problems.

Support

Related Projects

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Maintainers

See OWNERS for the complete list of maintainers.

Acknowledgments

  • HashiCorp Packer team for the plugin SDK
  • IBM Cloud team for PowerVS APIs
  • Kubernetes SIG Cluster Lifecycle for image-builder integration
  • All contributors who have helped improve this plugin

Note: This plugin is community-maintained and not officially supported by IBM or HashiCorp.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors