This root module automates and provisions an IBM® Power Virtual Server instance with following components:
- Creates an IBM® Power Virtual Server Instance.
- Attaches existing private subnets to the instance.
- Optionally creates volumes and attaches it to the instance.
- Optionally attaches existing volume ids to the instance.
- Optional instance initialization for ibm provided subscription linux images only ( configures proxy settings, creates filesystems, connects to network management services like DNS, NTP and NFS) using ansible galaxy collection roles ibm.power_linux_sap collection. Tested with RHEL8.4, RHEL 8.6, RHEL8.8, RHEL9.2, SLES15-SP4 and SLES15-SP5 images.
For more information about IBM Power Virtual Server see the getting started IBM Cloud docs.
provider "ibm" {
region = var.pi_region
zone = var.pi_zone
ibmcloud_api_key = var.ibmcloud_api_key != null ? var.ibmcloud_api_key : null
}
module "pi_instance" {
source = "terraform-ibm-modules/powervs-instance/ibm"
version = "x.x.x" # Replace "x.x.x" with a GIT release version to lock into a specific release
pi_workspace_guid = var.pi_workspace_guid
pi_ssh_public_key_name = var.pi_ssh_public_key_name
pi_image_id = var.pi_image_id
pi_networks = var.pi_networks
pi_instance_name = var.pi_instance_name
pi_sap_profile_id = var.pi_sap_profile_id #(optional, default null)
pi_server_type = var.pi_server_type #(optional, default null)
pi_number_of_processors = var.pi_number_of_processors #(optional, default null)
pi_memory_size = var.pi_memory_size #(optional, default null)
pi_cpu_proc_type = var.pi_cpu_proc_type #(optional, default check vars)
pi_boot_image_storage_pool = vat.pi_boot_image_storage_pool #(optional, default null)
pi_boot_image_storage_tier = var.pi_boot_image_storage_tier #(optional, default null)
pi_replicants = var.pi_replicants #(optional, default null)
pi_placement_group_id = var.pi_placement_group_id #(optional, default null)
pi_existing_volume_ids = var.pi_existing_volume_ids #(optional, default null)
pi_storage_config = var.pi_storage_config #(optional, default check vars)
pi_instance_init_linux = var.pi_instance_init_linux #(optional, default check vars)
pi_network_services_config = var.pi_network_services_config #(optional, default check vars)
pi_user_tags = var.pi_user_tags #(optional, default null)
ansible_vault_password = var.ansible_vault_password #(optional, default null)
}
You need the following permissions to run this module.
- Account Management
- Resource Group service
Viewer
platform access
- IAM Services
- Workspace for Power Virtual Server service
- Power Virtual Server service
Editor
platform access
- VPC Infrastructure Services service
Editor
platform access
- Transit Gateway service
Editor
platform access
- Direct Link service
Editor
platform access
- Resource Group service
Name | Version |
---|---|
terraform | >= 1.9.0 |
ibm | >= 1.71.3 |
Name | Source | Version |
---|---|---|
pi_instance | ./modules/pi-instance | n/a |
pi_instance_init_linux | ./modules/ansible | n/a |
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
ansible_vault_password | Vault password to encrypt OS registration parameters. Only required with customer provided linux subscription (specified in pi_instance_init_linux.custom_os_registration). For optimal security, set the vault password to 8-16 characters, including a mix of uppercase, lowercase, numbers, and special characters. Avoid non-printable characters. | string |
null |
no |
pi_boot_image_storage_pool | Storage Pool for server deployment; Only valid when you deploy one of the IBM supplied stock images. Storage pool for a custom image (an imported image or an image that is created from a VM capture) defaults to the storage pool the image was created in. | string |
null |
no |
pi_boot_image_storage_tier | Storage type for server deployment. If storage type is not provided the storage type will default to tier3. Possible values tier0, tier1 and tier3 | string |
null |
no |
pi_cpu_proc_type | The type of processor mode in which the VM will run with shared, capped or dedicated. Required when not creating SAP instances. Conflicts with 'pi_sap_profile_id'. | string |
null |
no |
pi_existing_volume_ids | List of existing volume ids that must be attached to the instance. | list(string) |
null |
no |
pi_image_id | Image ID used for PowerVS instance. Run 'ibmcloud pi images' to list available images. | string |
n/a | yes |
pi_instance_init_linux | Configures a PowerVS linux instance to have internet access by setting proxy on it, updates os and create filesystems using ansible collection ibm.power_linux_sap collection where 'bastion_host_ip' is public IP of bastion/jump host to access the 'ansible_host_or_ip' private IP of ansible node. Additionally, specify whether IBM provided or customer provided linux subscription should be used. For IBM provided subscription leave custom_os_registration empty. For customer provided subscription set a username and a password inside custom_os_registration. Customer provided linux subscription requires the use of either an IBM provided image ending in BYOL or a custom image. The ansible host must have access to the power virtual server instance and ansible host OS must be RHEL distribution. | object( |
{ |
no |
pi_instance_name | Name of instance which will be created. | string |
n/a | yes |
pi_memory_size | The amount of memory that you want to assign to your instance in GB. Required when not creating SAP instances. Conflicts with 'pi_sap_profile_id'. | string |
null |
no |
pi_network_services_config | Configures network services proxy, NTP, NFS and DNS on PowerVS instance. Requires 'pi_instance_init_linux' to be specified to configure these services. The 'opts' attribute can take in comma separated values. | object( |
{ |
no |
pi_networks | Existing list of private subnet ids to be attached to an instance. The first element will become the primary interface. Run 'ibmcloud pi networks' to list available private subnets. | list( |
n/a | yes |
pi_number_of_processors | The number of vCPUs to assign to the VM as visible within the guest Operating System. Required when not creating SAP instances. Conflicts with 'pi_sap_profile_id'. | string |
null |
no |
pi_placement_group_id | The ID of the placement group that the instance is in or empty quotes '' to indicate it is not in a placement group. pi_replicants cannot be used when specifying a placement group ID. | string |
null |
no |
pi_replicants | The number of instances that you want to provision with the same configuration. If this parameter is not set, 1 is used by default. The replication policy that you want to use, either affinity, anti-affinity or none. If this parameter is not set, none is used by default. pi_placement_group_id cannot be used when specifying pi_replicants | object({ |
null |
no |
pi_sap_profile_id | SAP HANA profile to use. Must be one of the supported profiles. See here. If this is mentioned then pi_server_type, pi_cpu_proc_type, pi_number_of_processors and pi_memory_size will not be taken into account. | string |
null |
no |
pi_server_type | The type of system on which to create the VM. Supported values are e980/s922/e1080/s1022. Required when not creating SAP instances. Conflicts with 'pi_sap_profile_id'. | string |
null |
no |
pi_ssh_public_key_name | Existing PowerVS SSH Public key name. Run 'ibmcloud pi keys' to list available keys. | string |
n/a | yes |
pi_storage_config | File systems to be created and attached to PowerVS instance. 'size' is in GB. 'count' specify over how many storage volumes the file system will be striped. 'tier' specifies the storage tier in PowerVS workspace, 'mount' specifies the mount point on the OS. | list(object({ |
null |
no |
pi_user_tags | List of Tag names for IBM Cloud PowerVS instance and volumes. Can be set to null. | list(string) |
null |
no |
pi_workspace_guid | Existing GUID of the PowerVS workspace. The GUID of the service instance associated with an account. | string |
n/a | yes |
Name | Description |
---|---|
pi_instance_id | he unique identifier of the instance. The ID is composed of <power_instance_id>/<instance_id>. |
pi_instance_instance_id | The unique identifier of PowerVS instance. |
pi_instance_name | Name of PowerVS instance. |
pi_instance_primary_ip | IP address of the primary network interface of IBM PowerVS instance. |
pi_instance_private_ips | All private IP addresses (as a list) of IBM PowerVS instance. |
pi_storage_configuration | Storage configuration of PowerVS instance. |
You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.
To set up your local development environment, see Local development setup in the project documentation.