Terraform Icp Vmware
Terraform recipe to deploy IBM Cloud Private on VMware
Install / Use
npx skills add hassenius/terraform-icp-vmwareInstalls into whichever agent you are using.
README
Terraform ICP VMware HA
This Terraform example configurations uses the VMware vSphere provider to provision virtual machines on VMware and TerraForm Module ICP Deploy to prepare VMs and deploy IBM Cloud Private on them. This Terraform template automates best practices learned from installing ICP on VMware at numerous client sites in production.
This template provisions an HA cluster with ICP 3.1 enterprise edition.

Pre-requisites
- Working copy of Terraform
- The example assumes the VMs are provisioned from a template that has ssh public keys loaded in
${HOME}/.ssh/authorized_keys. After VM creation, terraform will SSH into the VM to prepare and start installation of ICP using the SSH private key provided. If your VM template uses a different user from root, update thessh_usersection in variables.tf - The template is tested on VM templates based on Ubuntu 16.04
VM Template image preparation
-
Create a VM image (RHEL or Ubuntu 16.04).
- The automation will create an additional block device at unit number 1 (i.e.
/dev/sdb) for local docker container images and attempt to configure Docker in direct-lvm or overlay2 mode, depending on your operating system. RHEL 7.4 and older will default to devicemapper, RHEL 7.5 and newer will default to Overlay2. All supported Ubuntu versions will default to Overlay2. Additional block devices are also mounted at various directories that hold ICP data depending on the node role. You may pre-install docker, but it must be configured in direct-lvm or overlay2 mode. For direct-lvm the block device must be set as the second disk. The simplest way of getting this to work is to create a template with a single OS disk without installing docker and let the automation configure direct-lvm or overlay2 mode as appropriate.
- The automation will create an additional block device at unit number 1 (i.e.
-
Ensure that the
ssh_usercan callsudowithout password. -
Install any other needed packages:
- Shared storage clients, e.g. if the shared storage is NFS for the registry and audit directories, install NFS clients.
- In environments with restricted outbound internet, the terraform automation requires and attempts to install
PyYAML. You can pre-install it into the template:yum install PyYAMLon RHELapt install python-yamlon Ubuntu
- Install VMware Tools or
open-vm-tools - For docker installation, install any additional pre-requisites:
yum install device-mapper libseccomp libtool-ltdl libcgroup iptableson RHELapt install libtdl7 thin-provisioning-tools lvm2on Ubuntu
- For RHEL templates, VMware guest customization requires
perl. - For RHEL templates, either disable the firewall (
systemctl disable firewalld), or addfirewall_enabled: truetoicp-config.yaml.
-
(optional) If you are not providing
image_location, and have pre-installed docker, you can also pre-load the docker images from the ICP package you wish to install.tar xf ibm-cloud-private-x86_64-3.1.tar.gz -O | sudo docker load -
Shutdown the VM Convert to a template, make note the name of the template.
Other environment preparation
The automation requires an HTTP or NFS server to hold the ICP binaries and docker packages. NFS storage is recommended as it can host these binaries and also the shared storage location for registry_mount_src, audit_mount_src, docker_package_location and image_location.
Using the Terraform templates
-
git clone or download the templates
-
Export your vSphere username and password into environment variables on the system you will run Terraform from. This can be done via the following commands:
export VSPHERE_USER={myusername}replacing{myusername}with your vSphere usernameexport VSPHERE_PASSWORD={mypassword}replacing{mypassword}with your vSphere password
-
Create a
terraform.tfvarsfile to reflect your environment. Please see variables.tf and below tables for variable names and descriptions. Here is an exampleterraform.tfvarsfile:####################################### ##### vSphere Access Credentials ###### ####################################### vsphere_server = "10.25.0.20" # Set username/password as environment variables VSPHERE_USER and VSPHERE_PASSWORD ############################################## ##### vSphere deployment specifications ###### ############################################## # Following resources must exist in vSphere vsphere_datacenter = "DC1" vsphere_cluster = "Cluster1" vsphere_resource_pool = "ICP31_pool/terraform_icp_31" network_label = "LabPrivate" datastore = "LabDatastore" template = "ubuntu_1604_base_template" # Folder to provision the new VMs in, does not need to exist in vSphere folder = "terraform_icp_31" ################################## ##### ICP deployment details ##### ################################## ##### ICP instance name ##### # MUST consist of only lower case alphanumeric characters and '-' instance_name = "user1-icp-31" ##### Network ##### staticipblock = "10.30.0.0/24" staticipblock_offset = 2 gateway = "10.0.0.1" netmask = "16" dns_servers = [ "10.0.0.11", "10.0.0.12" ] # Cluster access cluster_vip = "10.30.0.1" cluster_vip_iface = "ens160" proxy_vip = "10.0.0.2" proxy_vip_iface = "ens160" ##### Local Terraform connectivity details ##### ssh_user = "virtuser" ssh_password = "SuperPa88w0rd" ##### ICP installation method ##### icp_inception_image = "ibmcom/icp-inception:3.1.0-ee" private_registry = "registry.example.com" registry_username = "myUsername" registry_password = "myPassword" ##### ICP admin user password ##### # Non default admin user password 'admin' recommended icppassword = "SuperPa88w0rd" ##### ICP Cluster Components ##### master = { nodes = "3" vcpu = "8" memory = "16384" docker_disk_size = "250" thin_provisioned = "true" } proxy = { nodes = "3" vcpu = "4" memory = "8192" thin_provisioned = "true" } worker = { nodes = "3" vcpu = "8" memory = "8192" thin_provisioned = "true" } management = { nodes = "3" vcpu = "4" memory = "16384" thin_provisioned = "true" } va = { nodes = "2" vcpu = "4" memory = "8192" thin_provisioned = "true" } ##### NFS Server ##### registry_mount_src = "10.0.0.5:/storage/user1-icp-31/registry" audit_mount_src = "10.0.0.5:/storage/user1-icp-31/audit" -
Run
terraform initto download dependencies (modules and plugins) -
Run
terraform planto investigate deployment plan -
Run
terraform applyto start deployment
ICP installation method
Below you can find the different paths to install ICP on VMware.
- Install from ICP binary package. In order to install ICP from it's binary package, we need to specify the
image_locationof the binary in theterraform.tfvarsfile:
##### ICP installation method #####
icp_inception_image = "ibmcom/icp-inception:3.1.0-ee"
image_location = "nfs:<nfs_server_ip_address>:<path_within_your_nfs_server>/ibm-cloud-private-x86_64-3.1.0.tar.gz"
- Install from a private Docker registry which does not require authentication. In order to install ICP from a previously configured (with ICP images loaded into) private Docker registry which does not require authentication, we need to specify the
private_registryin theterraform.tfvarsfile:
##### ICP installation method #####
icp_inception_image = "ibmcom/icp-inception:3.1.0-ee"
private_registry = "registry.example.com"
- Install from a private Docker registry which requires authentication. In order to install ICP from a previously configured (with ICP images loaded into) private Docker registry which requires authentication, we need to specify the
private_registryand its credentials,registry_usernameandregistry_password, in theterraform.tfvarsfile:
##### ICP installation method #####
icp_inception_image = "ibmcom/icp-inception:3.1.0-ee"
private_registry = "registry.example.com"
registry_username = "myUsername"
registry_password = "myPassword"
Terraform configuration
vSphere variables
| name | required | value |
|----------------|------------|--------------|
| vsphere_server | yes | IP or hostname of vSphere server |
| vsphere_user | no, moved to environment variables | Username for vSphere server |
| vsphere_password | no, moved to environment variables | Password for vSphere user |
| allow_unverified_ssl | no | SSL certificate verification when connecting to vSphere, true by default. |
| vsphere_datacenter | yes | Name of the vSphere datacenter to deploy VMs to |
| vsphere_cluster | yes | Name of the vSphere cluster to deploy VMs to (must be under the vSphere datacenter) |
| vsphere_resource_pool | no | Path of the Resource Pool to deploy VMs to (must be under the vSphere cluster), will be in the format like /path/to/target, by default will add VMs to root resource pool in the cluster |
| network_label | yes | Network label to place all VMs on |
| datastore | yes | Name of the datastore to place all disk images in. |
| folder | no | Name of the VM folder to create where all created VMs are placed in, if not supplied, will place in root folder. |
| template | yes | Name of the VM template to use to c
Related Skills
dbx
13.7k20 MB lightweight cross-platform database client for 70+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker.
product
Cloud-agnostic Kubernetes infrastructure with Terraform & Helm for homelabs, edge, and production clusters.
ghidra-mcp
3.2kGhidra MCP Server — 200+ MCP tools for AI-powered reverse engineering. GUI plugin + headless server, lazy tool loading, convention enforcement, batch operations, Ghidra Server integration, and Docker deployment.
radar
2.8kThe missing open-source Kubernetes UI with a built-in MCP server for AI agents. See what's broken, why, and what changed. Issues, Topology, event timeline, Helm, GitOps, live service traffic, and cluster audits - all in one Go binary.
