A useful tool to create and check OpenShift clusters on IBM Cloud PowerVC.
To install an OpenShift cluster, please head to the main documentation root here.
CLI commands:
- check-alive
- create-bastion
- create-rhcos
- delete-bastion
- erase-metadata
- rhcos-exists
- send-metadata
- watch-create
- watch-installation
This will check if the controller is alive.
Example usage:
$ ocp-ipi-powervc-linux-amd64 check-alive --serverIP ${controller_ip} --shouldDebug false
args:
-
serverIPThe IP address or hostname of the controller. -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This will create an HAProxy VM which will act as an OpenShift Load Balancer. This VM will be managed by another instance of this program with the watch-installation parameter.
NOTE:
The environment variable IBMCLOUD_API_KEY is optional. If not set, make sure DNS is supported via CoreOS DNS or another method.
Example usage:
$ ocp-ipi-powervc-linux-amd64 create-bastion --cloud ${cloud_name} --bastionName ${bastion_name} --flavorName ${flavor_name} --imageName ${image_name} --networkName ${network_name} --sshKeyName ${ssh_keyname} --domainName ${domain_name} --enableHAProxy true --serverIP ${controller_ip} --shouldDebug true
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
bastionNameThe name of the VM to use which should match the OpenShift cluster name. -
bastionRsaThe SSH private key file for the bastion VM. -
availabilityZoneThe name of the OpenStack availability zone (defaults tos1022). -
flavorNameThe OpenStack flavor to create the VM with. -
imageNameThe OpenStack image to create the VM with. -
networkNameThe OpenStack network to create the VM with. -
sshKeyNameThe OpenStack ssh keyname to create the VM with. -
domainNameThe DNS domain name for the bastion. (optional) -
enableHAProxydefaults totrue. If we should install HA Proxy on the bastion node. -
serverIPThe IP address of the controller. -
bastionIpFileThe filename to write the bastion IP address to (defaults to/tmp/bastionIp). -
passwdHashThe password hash used in the CoreOS ignition file. (optional) -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This will create a test RHCOS VM. This VM will be managed by the controller.
NOTE:
The environment variable IBMCLOUD_API_KEY is optional. If not set, make sure DNS is supported via CoreOS DNS or another method.
Example usage:
$ ocp-ipi-powervc-linux-amd64 create-rhcos --cloud ${cloud_name} --rhcosName ${rhcos_name} --flavorName ${flavor_name} --imageName ${image_name} --networkName ${network_name} --sshPublicKey $(cat ${HOME}/.ssh/id_installer_rsa.pub) --domainName ${domain_name} --shouldDebug true
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
rhcosNameThe name of the VM to use which should match the OpenShift cluster name. -
availabilityZoneThe name of the OpenStack availability zone (defaults tos1022). -
flavorNameThe OpenStack flavor to create the VM with. -
imageNameThe OpenStack image to create the VM with. -
networkNameThe OpenStack network to create the VM with. -
passwdHashThe password hash of the core user. -
sshPublicKeyThe SSH public key contents to inject into the VM. -
domainNameThe DNS domain name for the VM. (optional) -
timeoutMaximum duration for the operation (defaults to15m). -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This will delete an existing bastion HAProxy VM.
Example usage:
$ ocp-ipi-powervc-linux-amd64 delete-bastion --cloud ${cloud_name} --bastionName ${bastion_name} --shouldDebug true
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
bastionNameThe name of the bastion VM to delete. -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This will erase cluster metadata entries matching a pattern from a remote server.
Example usage:
$ ocp-ipi-powervc-linux-amd64 erase-metadata --pattern "test-*" --serverIP ${controller_ip} --timeout 5m --shouldDebug true
args:
-
patternPattern to match metadata entries for deletion (e.g.,test-*,staging-*). -
serverIPThe IP address of the controller. -
timeoutTimeout for the erase operation (defaults to1m, e.g.,5m,10m,30s). -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This will verify that a named RHCOS image exists in the OpenStack cloud. If the image is not found, all available images are listed to help diagnose naming issues.
Example usage:
$ ocp-ipi-powervc-linux-amd64 rhcos-exists --cloud ${cloud_name} --imageName ${image_name} --shouldDebug false
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
imageNameThe name of the RHCOS image to search for (case-sensitive, exact match). -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This will send a command to the server to either create or delete a local copy of the metadata.json file.
Example usage:
$ ocp-ipi-powervc-linux-amd64 send-metadata --createMetadata ${directory}/metadata.json --serverIP ${controller_ip} --shouldDebug true
args:
-
createMetadataTells the server to create a local copy of this metadata.json file (mutually exclusive withdeleteMetadata). -
deleteMetadataTells the server to delete a local copy of this metadata.json file (mutually exclusive withcreateMetadata). -
serverIPThe IP address of the controller. -
timeoutTimeout for the send operation (defaults to1m, e.g.,5m,10m,30s). -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This monitors and displays the status of cluster resources during and after cluster creation. It queries the state of VMs, the load balancer, and optionally the OpenShift cluster and IBM DNS.
NOTE:
The environment variable IBMCLOUD_API_KEY needs to be set.
Example usage:
$ ocp-ipi-powervc-linux-amd64 watch-create --metadata ${directory}/metadata.json --kubeconfig ${directory}/auth/kubeconfig --cloud ${cloud_name} --bastionRsa ${HOME}/.ssh/id_installer_rsa --baseDomain ${domain_name} --shouldDebug false
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
metadatathe location of themetadata.jsonfile created by the IPI OpenShift installer. -
kubeconfigthe location of thekubeconfigfile created by the IPI OpenShift installer. (optional) -
bastionRsathe SSH private key file for the bastion VM. -
baseDomainthe domain name of the OpenShift cluster. (optional) -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This is for checking the progress of an ongoing openshift-install create cluster operation of the OpenShift IPI installer. Run this in another window while the installer deploys a cluster.
NOTE:
The environment variable IBMCLOUD_API_KEY is optional. If not set, make sure DNS is supported via CoreOS DNS or another method.
Example usage:
$ ocp-ipi-powervc-linux-amd64 watch-installation --cloud ${cloud_name} --domainName ${domain_name} --bastionMetadata ${directory}/metadata.json --bastionRsa ${HOME}/.ssh/id_installer_rsa --dhcpSubnet ${dhcp_subnet} --dhcpNetmask ${dhcp_netmask} --dhcpRouter ${dhcp_router} --dhcpDnsServers "${dhcp_servers}" --shouldDebug true
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
domainNamethe domain name to use for the OpenShift cluster. -
bastionMetadatathe location of themetadata.jsonfile created by the IPI OpenShift installer. This parameter can have more than one occurrence. -
bastionRsathe SSH private key file for the default username for the HAProxy VM. -
enableDhcpddefaults tofalse. Enables updating the locally installed DHCP server. -
dhcpInterfaceThe network interface to listen for DHCPd requests. -
dhcpSubnetThe subnet to use for DHCPd requests. -
dhcpNetmaskThe netmask to use for DHCPd requests. -
dhcpRouterThe router to use for DHCPd requests. -
dhcpDnsServersThe comma separated DNS servers to use for DHCPd requests. -
dhcpServerIdThe DNS server identifier for a DHCP request. -
statsUserHAProxy stats username (leave empty to disable stats). (optional) -
statsPasswordHAProxy stats password. (optional) -
shouldDebugdefaults tofalse. This will cause the program to output verbose debugging information.
This script downloads a nightly OCP build and sets up the environment for testing.
This script will check if this repo tool is running on the controller IP address. If it is not, then it will start it up inside of the tmux window number 0.
Required environment variables before running this script:
-
BASEDOMAINthe domain name to use for the OpenShift cluster. -
BASTION_USERNAMEthe default username for the HAProxy VM. -
BASTION_RSAthe ssh private key for the bastion node. -
CLOUDthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
CONTROLLER_IPthe IP address of the controller. -
DHCP_DNS_SERVERSa list of DNS servers. -
DHCP_NETMASKthe netmask used for a DHCP request. -
DHCP_ROUTERthe router used for a DHCP request. -
DHCP_SERVER_IDthe DHCP server ID used for a DHCP request. -
DHCP_SUBNETthe DHCP subnet used for a DHCP request.
Required existing binaries before running this script:
-
ocp-ipi-powervc-linux-${ARCH}This repo tool. -
awka Linux admin tool. -
cuta Linux admin tool. -
ipa Linux admin tool. -
tmuxa linux shell windowing tool. -
tra Linux admin tool.
This script removes all containers and their objects from an OpenStack cloud. It processes containers one at a time, deleting all objects before removing the container itself. Optionally filters by infrastructure ID.
Required environment variables before running this script:
CLOUDthe OpenStack cloud name fromclouds.yaml.
Optional arguments:
INFRA_IDfilter containers by infrastructure ID (e.g.,cluster-abc123).
Required existing binaries before running this script:
openstackThe OpenStack CLI tool.
This script will output the ssh command needed to access the console for a VM or OpenShift node name.
This script will create an OpenShift cluster using the IPI installer.
Required environment variables before running this script:
-
BASEDOMAINthe domain name to use for the OpenShift cluster. -
BASTION_IMAGE_NAMEthe OpenStack image name for the HAProxy VM. -
BASTION_RSAthe ssh private key for the bastion node. (used for failure diagnostics) -
CLOUDthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
CLUSTER_DIRthe directory location where the OpenShift IPI installer will save important files. (defaults totest) -
CLUSTER_NAMEthe name prefix to use for the OpenShift cluster which you are installing. -
CONTROLLER_IPthe IP address of the controller. -
FLAVOR_NAMEthe OpenStack flavor name to use for OpenShift VMs. -
INSTALLER_SSHKEYthe path to the ssh public key for access to the bootstrap and master nodes. Usually named~/.ssh/id_installer_rsa.pub. -
MACHINE_TYPEthe PowerPC machine type / availability zone to use for OpenShift VMs. -
NETWORK_NAMEthe OpenStack network name to use for OpenShift VMs. -
PROJECTan optional prefix to prepend to the RHCOS image name. (optional) -
PULL_SECRETthe pull secret content (used inline in install-config). (optional alternative toPULLSECRET_FILE) -
PULLSECRET_FILEthe filename containing the pull secrets for the OpenShift containers. Usually named~/.pullSecretCompact. -
SSHKEY_NAMEthe OpenStack ssh keyname to use for the HAProxy VM.
Required existing files before running this script:
-
~/.pullSecretCompact -
~/.ssh/id_installer_rsa.pub
Required existing binaries before running this script:
-
openshift-installThe OpenShift IPI installer. -
ocp-ipi-powervc-linux-${ARCH}This repo tool. -
openstackThe OpenStack CLI tool existing on Fedora/RHEL/CentOS repositories. -
jqThe JSON query CLI tool found at https://jqlang.org/download/ and existing on Fedora/RHEL/CentOS repositories. -
getentDNS resolution utility. -
podmanContainer tool used for pull secret validation. -
ssh-keygenUsed for optional SSH public key validation and controller connectivity check. -
pingUsed to verify controller connectivity.
This script lists bastion (standalone) VMs on PowerVC/OpenStack. Any server whose name does not match the cluster-node pattern is treated as a bastion VM.
Optional arguments:
-
--cloud <cloud>OpenStack cloud name (overrides$CLOUD/$OS_CLOUD). -
--bastionRSA <path>Path to SSH private key for bastion access. When provided, each listed bastion is probed over SSH and only reachable ones are shown (with the matching username).
Optional environment variables:
-
CLOUDthe OpenStack cloud name fromclouds.yaml(skips interactive prompt if set). -
BASTION_RSApath to SSH private key for bastion access (skips prompt if set).
Required existing binaries before running this script:
-
openstackThe OpenStack CLI tool. -
sshRequired only when--bastionRSAis provided.
This script lists OpenStack servers grouped by cluster and standalone VMs.
Optional arguments:
-c <cloud>OpenStack cloud name (overrides$CLOUD/$OS_CLOUD).
Required existing binaries before running this script:
openstackThe OpenStack CLI tool.
This script will delete an OpenShift cluster using the IPI installer.
Required environment variables before running this script:
-
CLUSTER_DIRthe directory location where the OpenShift IPI installer will save important files. -
CONTROLLER_IPthe IP address of the controller.
Required existing binaries before running this script:
-
openshift-installThe OpenShift IPI installer. -
ocp-ipi-powervc-linux-${ARCH}This repo tool. -
pinga Linux admin tool.
This script lists running OpenShift clusters on PowerVC/OpenStack, prompts the user to select one, and deletes it.
Optional arguments:
-
-c <cloud>OpenStack cloud name (skips interactive prompt). -
-lList clusters only; do not prompt for deletion.
Optional environment variables:
CLOUDthe OpenStack cloud name fromclouds.yaml(skips interactive prompt if set).
Required existing binaries before running this script:
-
openstackThe OpenStack CLI tool. -
openshift-installThe OpenShift IPI installer.
This script downloads CoreOS JSON metadata and verifies that RHCOS images exist in OpenStack. It supports multiple release versions, multiple output formats (text, JSON, CSV), dry-run mode, and RHEL version preference (RHEL 9 or RHEL 10).
Required existing binaries before running this script:
-
openstackThe OpenStack CLI tool. -
jqThe JSON query CLI tool. -
curlFor downloading CoreOS metadata.
This script bulk-renames RHCOS images in OpenStack by adding a project prefix to their names.
Required existing binaries before running this script:
openstackThe OpenStack CLI tool.
This script will output the ssh command needed to access a specific OpenShift node.
This script downloads and uploads CentOS Stream GenericCloud images to PowerVC/OpenStack. It resolves the latest dated .qcow2 image for either CentOS Stream 9 or CentOS Stream 10 (ppc64le) from the official CentOS cloud mirror, verifies its SHA1 checksum, derives the image name, checks whether the image already exists in OpenStack, and if not converts it with pvsadm and imports it via pvcctl or powervc-image.
Required environment variables before running this script:
-
CLOUDOpenStack cloud name from~/.config/openstack/clouds.yaml(or--cloud). -
PROJECT_UPLOADPowerVC project to associate the uploaded image with (or--project-upload). -
CENTOS_VERSIONCentOS stream version:CentOS9orCentOS10(or--centOS). -
SVC_HOSTPowerVC service host used bypvcctl(or--svc-host). -
TEMPLATEPowerVC template UUID used during image import (or--template).
Required existing binaries before running this script:
-
curlFor downloading files and checking URLs. -
jqThe JSON query CLI tool. -
openstackThe OpenStack CLI tool. -
pvsadmFor converting qcow2 images to OVA format. -
pvcctlorpowervc-imageFor importing images into PowerVC (either one required).
Example usage:
source environmentCI
./scripts/upload-centos.sh --centOS CentOS9
./scripts/upload-centos.sh --centOS CentOS10 --dry-run
./scripts/upload-centos.sh --centOS CentOS9 --verboseThis script downloads and uploads RHCOS images to PowerVC/OpenStack. It handles multiple release versions, supports both RHEL 9 and RHEL 10 based images, converts images with pvsadm, and imports them via pvcctl or powervc-image.
Required existing binaries before running this script:
-
curlFor downloading files and checking URLs. -
jqThe JSON query CLI tool. -
openstackThe OpenStack CLI tool. -
pvsadmFor converting qcow2 images to OVA format. -
pvcctlorpowervc-imageFor importing images into PowerVC (either one required).
This script polls DNS servers to verify that all required DNS entries for an OpenShift cluster are resolvable before proceeding with installation. It checks wildcard DNS entries (*.apps), the API endpoint, and the internal API endpoint.
Required environment variables before running this script:
-
CLUSTER_DIRdirectory containing cluster metadata (prompts if not set). -
BASEDOMAINbase domain for the cluster (prompts if not set).
Required existing files before running this script:
${CLUSTER_DIR}/metadata.jsonCluster metadata containing the cluster name.
Required existing binaries before running this script:
-
jqThe JSON query CLI tool. -
getentDNS resolution utility.