. Max length of final hostname must be <= 13 characters. 'instance\_count' is number of SAP NetWeaver instances that should be created. 'instance\_count' cannot exceed 10. '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 target mount point on OS. | object({
instance_count = number
name = string
image_id = string
processors = string
memory = string
proc_type = string
storage_config = list(object({
name = string
size = string
count = string
tier = string
mount = string
}))
}) | {
"image_id": "insert_value_here",
"instance_count": 1,
"memory": "32",
"name": "nw",
"proc_type": "shared",
"processors": "3",
"storage_config": [
{
"count": "1",
"mount": "/usr/sap",
"name": "usrsap",
"size": "50",
"tier": "tier3"
}
]
} | no |
| [pi\_networks](#input\_pi\_networks) | Existing list of subnets to be attached to PowerVS instances. The first element will become the primary interface. Run 'ibmcloud pi networks' to list available private subnets. | list(
object({
name = string
id = string
cidr = optional(string)
})
)
| n/a | yes |
diff --git a/modules/pi-sap-system-type1/variables.tf b/modules/pi-sap-system-type1/variables.tf
index 07264d3f..97b02cd0 100644
--- a/modules/pi-sap-system-type1/variables.tf
+++ b/modules/pi-sap-system-type1/variables.tf
@@ -75,7 +75,7 @@ variable "pi_hana_instance" {
}
variable "pi_hana_instance_custom_storage_config" {
- description = "Custom file systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS."
+ description = "Custom file systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS. If not specified, volumes for '/hana/data', '/hana/log', '/hana/shared' are automatically calculated and created."
type = list(object({
name = string
size = string
diff --git a/solutions/ibm-catalog/sap-ready-to-go/README.md b/solutions/ibm-catalog/sap-ready-to-go/README.md
index 5ad30abc..a517caa2 100644
--- a/solutions/ibm-catalog/sap-ready-to-go/README.md
+++ b/solutions/ibm-catalog/sap-ready-to-go/README.md
@@ -41,7 +41,7 @@
- Optionally configures a shared NFS directory on all created PowerVS instances.
- Optionally installs Sysdig agent and configures connection to [IBM Cloud Security and Compliance Center Workload Protection](https://cloud.ibm.com/docs/workload-protection)
- Post-instance provisioning, Ansible Galaxy collection roles from [IBM](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/) are executed: `power_linux_sap`.
-- Tested with RHEL8.4,/8.6/8.8/9.2, SLES15-SP3/SP5 images.
+- Tested with RHEL8.4,/8.6/8.8/9.2/9.4, SLES15-SP3/SP5/SP6 images.
## Notes
@@ -73,7 +73,7 @@
| Name | Source | Version |
|------|--------|---------|
| [sap\_system](#module\_sap\_system) | ../../../modules/pi-sap-system-type1 | n/a |
-| [standard](#module\_standard) | terraform-ibm-modules/powervs-infrastructure/ibm//modules/powervs-vpc-landing-zone | 10.0.1 |
+| [standard](#module\_standard) | terraform-ibm-modules/powervs-infrastructure/ibm//modules/powervs-vpc-landing-zone | 10.1.1 |
### Resources
@@ -103,7 +103,7 @@
| [powervs\_custom\_images](#input\_powervs\_custom\_images) | Optionally import up to three custom images from Cloud Object Storage into PowerVS workspace. Requires 'powervs\_custom\_image\_cos\_configuration' to be set. image\_name: string, must be unique. Name of image inside PowerVS workspace. file\_name: string, object key of image inside COS bucket. storage\_tier: string, storage tier which image will be stored in after import. Supported values: tier0, tier1, tier3, tier5k. sap\_type: optional string, Supported values: null, Hana, Netweaver, use null for non-SAP image. | object({
powervs_custom_image1 = object({
image_name = string
file_name = string
storage_tier = string
sap_type = optional(string)
}),
powervs_custom_image2 = object({
image_name = string
file_name = string
storage_tier = string
sap_type = optional(string)
}),
powervs_custom_image3 = object({
image_name = string
file_name = string
storage_tier = string
sap_type = optional(string)
})
}) | {
"powervs_custom_image1": {
"file_name": "",
"image_name": "",
"sap_type": null,
"storage_tier": ""
},
"powervs_custom_image2": {
"file_name": "",
"image_name": "",
"sap_type": null,
"storage_tier": ""
},
"powervs_custom_image3": {
"file_name": "",
"image_name": "",
"sap_type": null,
"storage_tier": ""
}
} | no |
| [powervs\_default\_sap\_images](#input\_powervs\_default\_sap\_images) | Default SUSE and Red Hat Linux Full Linux subscription images to use for PowerVS SAP HANA and SAP NetWeaver instances. If you're using a byol or a custom RHEL/SLES image, additionally specify the optional values for 'powervs\_os\_registration\_username', 'powervs\_os\_registration\_password' and 'ansible\_vault\_password' | object({
sles_hana_image = string
sles_nw_image = string
rhel_hana_image = string
rhel_nw_image = string
}) | {
"rhel_hana_image": "RHEL9-SP4-SAP",
"rhel_nw_image": "RHEL9-SP4-SAP-NETWEAVER",
"sles_hana_image": "SLES15-SP6-SAP",
"sles_nw_image": "SLES15-SP6-SAP-NETWEAVER"
} | no |
| [powervs\_hana\_instance\_additional\_storage\_config](#input\_powervs\_hana\_instance\_additional\_storage\_config) | Additional File systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS. | list(object({
name = string
size = string
count = string
tier = string
mount = string
})) | [
{
"count": "1",
"mount": "/usr/sap",
"name": "usrsap",
"size": "50",
"tier": "tier3"
}
]
| no |
-| [powervs\_hana\_instance\_custom\_storage\_config](#input\_powervs\_hana\_instance\_custom\_storage\_config) | Custom file systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS. | list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
})) | [
{
"count": "",
"mount": "",
"name": "",
"size": "",
"tier": ""
}
]
| no |
+| [powervs\_hana\_instance\_custom\_storage\_config](#input\_powervs\_hana\_instance\_custom\_storage\_config) | Custom file systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS. If not specified, volumes for '/hana/data', '/hana/log', '/hana/shared' are automatically calculated and created. | list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
})) | [
{
"count": "",
"mount": "",
"name": "",
"size": "",
"tier": ""
}
]
| no |
| [powervs\_hana\_instance\_sap\_profile\_id](#input\_powervs\_hana\_instance\_sap\_profile\_id) | PowerVS SAP HANA instance profile to use. Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-power-vs). File system sizes are automatically calculated. Override automatic calculation by setting values in optional parameter 'powervs\_hana\_instance\_custom\_storage\_config'. | `string` | `"sh2-4x256"` | no |
| [powervs\_netweaver\_cpu\_number](#input\_powervs\_netweaver\_cpu\_number) | Number of CPUs for each PowerVS SAP NetWeaver instance. | `string` | `"3"` | no |
| [powervs\_netweaver\_instance\_count](#input\_powervs\_netweaver\_instance\_count) | Number of PowerVS SAP NetWeaver instances that should be created. 'powervs\_netweaver\_instance\_count' cannot exceed 10. | `number` | `1` | no |
@@ -121,6 +121,7 @@
| [ssh\_public\_key](#input\_ssh\_public\_key) | Public SSH Key for VSI creation. Must be an RSA key with a key size of either 2048 bits or 4096 bits (recommended). Must be a valid SSH key that does not already exist in the deployment region. | `string` | n/a | yes |
| [tags](#input\_tags) | List of tag names for the IBM Cloud PowerVS workspace | `list(string)` | `[]` | no |
| [vpc\_intel\_images](#input\_vpc\_intel\_images) | Stock OS image names for creating VPC landing zone VSI instances: RHEL (management and network services) and SLES (monitoring). | object({
rhel_image = string
sles_image = string
}) | {
"rhel_image": "ibm-redhat-9-6-amd64-sap-applications-1",
"sles_image": "ibm-sles-15-7-amd64-sap-applications-1"
} | no |
+| [vpc\_subnet\_cidrs](#input\_vpc\_subnet\_cidrs) | CIDR values for the VPC subnets to be created. It's customer responsibility that none of the defined networks collide, including the PowerVS subnets and VPN client pool. | object({
vpn = string
mgmt = string
vpe = string
edge = string
}) | {
"edge": "10.30.40.0/24",
"mgmt": "10.30.20.0/24",
"vpe": "10.30.30.0/24",
"vpn": "10.30.10.0/24"
} | no |
### Outputs
diff --git a/solutions/ibm-catalog/sap-ready-to-go/main.tf b/solutions/ibm-catalog/sap-ready-to-go/main.tf
index a50b55d9..e482dabd 100644
--- a/solutions/ibm-catalog/sap-ready-to-go/main.tf
+++ b/solutions/ibm-catalog/sap-ready-to-go/main.tf
@@ -4,27 +4,9 @@
# PowerVS Workspace
#######################################################
-locals {
- powervs_management_network = { name = "${var.prefix}-sap-net", cidr = var.powervs_sap_network_cidr }
- powervs_server_routes = concat(
- [
- {
- route_name = local.powervs_management_network.name
- destination = local.powervs_management_network.cidr
- action = "deliver"
- }
- ]
- )
-
- client_to_site_vpn = merge(
- var.client_to_site_vpn,
- { powervs_server_routes = local.powervs_server_routes }
- )
-}
-
module "standard" {
source = "terraform-ibm-modules/powervs-infrastructure/ibm//modules/powervs-vpc-landing-zone"
- version = "10.0.1"
+ version = "10.1.1"
providers = {
ibm.ibm-is = ibm.ibm-is
@@ -39,7 +21,7 @@ module "standard" {
vpc_intel_images = var.vpc_intel_images
ssh_public_key = var.ssh_public_key
ssh_private_key = var.ssh_private_key
- powervs_management_network = local.powervs_management_network
+ powervs_management_network = { name = "${var.prefix}-sap-net", cidr = var.powervs_sap_network_cidr }
powervs_backup_network = null
configure_dns_forwarder = true
configure_ntp_forwarder = true
@@ -50,7 +32,7 @@ module "standard" {
powervs_custom_images = var.powervs_custom_images
powervs_custom_image_cos_configuration = var.powervs_custom_image_cos_configuration
powervs_custom_image_cos_service_credentials = var.powervs_custom_image_cos_service_credentials
- client_to_site_vpn = local.client_to_site_vpn
+ client_to_site_vpn = var.client_to_site_vpn
sm_service_plan = var.sm_service_plan
existing_sm_instance_guid = var.existing_sm_instance_guid
existing_sm_instance_region = var.existing_sm_instance_region
@@ -58,6 +40,7 @@ module "standard" {
existing_monitoring_instance_crn = var.existing_monitoring_instance_crn
enable_scc_wp = var.enable_scc_wp
ansible_vault_password = var.ansible_vault_password
+ vpc_subnet_cidrs = var.vpc_subnet_cidrs
}
diff --git a/solutions/ibm-catalog/sap-ready-to-go/variables.tf b/solutions/ibm-catalog/sap-ready-to-go/variables.tf
index 8e83bf20..2e8e558f 100644
--- a/solutions/ibm-catalog/sap-ready-to-go/variables.tf
+++ b/solutions/ibm-catalog/sap-ready-to-go/variables.tf
@@ -61,7 +61,7 @@ variable "powervs_hana_instance_sap_profile_id" {
}
variable "powervs_hana_instance_custom_storage_config" {
- description = "Custom file systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS."
+ description = "Custom file systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS. If not specified, volumes for '/hana/data', '/hana/log', '/hana/shared' are automatically calculated and created."
type = list(object({
name = string
size = string
@@ -361,3 +361,23 @@ variable "tags" {
type = list(string)
default = []
}
+
+#####################################################
+# Optional Parameters VPC subnets
+#####################################################
+
+variable "vpc_subnet_cidrs" {
+ description = "CIDR values for the VPC subnets to be created. It's customer responsibility that none of the defined networks collide, including the PowerVS subnets and VPN client pool."
+ type = object({
+ vpn = string
+ mgmt = string
+ vpe = string
+ edge = string
+ })
+ default = {
+ "vpn" = "10.30.10.0/24"
+ "mgmt" = "10.30.20.0/24"
+ "vpe" = "10.30.30.0/24"
+ "edge" = "10.30.40.0/24"
+ }
+}
diff --git a/solutions/single-hana-instance/README.md b/solutions/single-hana-instance/README.md
new file mode 100644
index 00000000..d0abe119
--- /dev/null
+++ b/solutions/single-hana-instance/README.md
@@ -0,0 +1,70 @@
+# Provisioning a single tuned Power Virtual Server for SAP HANA
+
+This example deploys a single Power Virtual Server instance that is tuned and ready to host an SAP HANA database.
+
+It provisions the following components in IBM Cloud:
+
+* Creates an IBM® Power Virtual Server instance in an existing PowerVS workspace (which contains a public SSH key, a pre-existing subnet, and a pre-imported OS image).
+* Creates and attaches volumes to the instance.
+* Automatically creates the required file systems for SAP HANA.
+* Provides an option for users to define a custom storage configuration if needed.
+* (Optional) Initializes the instance by configuring proxy settings and network services (NTP, DNS, NFS).
+* (Optional) Tunes the OS for SAP HANA.
+* Supports bring-your-own-license (BYOL) for RHEL/SLES images.
+* Does **not** install SAP HANA.
+
+
+
+
+### Requirements
+
+| Name | Version |
+|------|---------|
+| [terraform](#requirement\_terraform) | >= 1.9.0 |
+| [ibm](#requirement\_ibm) | =1.83.3 |
+
+### Modules
+
+| Name | Source | Version |
+|------|--------|---------|
+| [configure\_os\_for\_sap](#module\_configure\_os\_for\_sap) | ../../modules/ansible | n/a |
+| [hana\_storage\_calculation](#module\_hana\_storage\_calculation) | ../../modules/pi-hana-storage-config | n/a |
+| [sap\_hana\_instance](#module\_sap\_hana\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.8.2 |
+
+### Resources
+
+No resources.
+
+### Inputs
+
+| Name | Description | Type | Default | Required |
+|------|-------------|------|---------|:--------:|
+| [ansible\_vault\_password](#input\_ansible\_vault\_password) | Vault password to encrypt ansible playbooks that contain sensitive information. Required with customer provided linux subscription (powervs\_os\_registration). Password requirements: 15-100 characters and at least one uppercase letter, one lowercase letter, one number, and one special character. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]\_{\|}~. | `string` | `""` | no |
+| [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | The IBM Cloud platform API key needed to deploy IAM enabled resources. | `string` | n/a | yes |
+| [powervs\_boot\_image\_storage\_tier](#input\_powervs\_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 |
+| [powervs\_deployment\_target](#input\_powervs\_deployment\_target) | The deployment of a dedicated host. Max items: 1, id is the uuid of the host group or host. type is the deployment target type, supported values are host and hostGroup | list(object(
{
type = string
id = string
}
))
| `null` | no |
+| [powervs\_hana\_instance\_additional\_storage\_config](#input\_powervs\_hana\_instance\_additional\_storage\_config) | Additional File systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS. | list(object({
name = string
size = string
count = string
tier = string
mount = string
})) | [
{
"count": "1",
"mount": "/usr/sap",
"name": "usrsap",
"size": "50",
"tier": "tier3"
}
]
| no |
+| [powervs\_hana\_instance\_custom\_storage\_config](#input\_powervs\_hana\_instance\_custom\_storage\_config) | Custom file systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS. If not specified, volumes for '/hana/data', '/hana/log', '/hana/shared' are automatically calculated and created. | list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
})) | [
{
"count": "",
"mount": "",
"name": "",
"size": "",
"tier": ""
}
]
| no |
+| [powervs\_hana\_instance\_sap\_profile\_id](#input\_powervs\_hana\_instance\_sap\_profile\_id) | PowerVS SAP HANA instance profile to use. Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-power-vs). File system sizes are automatically calculated. Override automatic calculation by setting values in optional parameter 'powervs\_hana\_instance\_custom\_storage\_config'. | `string` | `"sh2-4x256"` | no |
+| [powervs\_image\_name](#input\_powervs\_image\_name) | Image name used for PowerVS instance. Run 'ibmcloud pi images' to list available images. | `string` | n/a | yes |
+| [powervs\_instance\_init\_linux](#input\_powervs\_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](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/). where 'proxy\_host\_or\_ip\_port' E.g., 10.10.10.4:3128 , 'bastion\_host\_ip' is public IP of bastion/jump host to access the private IP of created linux PowerVS instance. | object(
{
enable = bool
bastion_host_ip = string
ansible_host_or_ip = string
}
)
| {
"ansible_host_or_ip": "",
"bastion_host_ip": "",
"enable": false
} | no |
+| [powervs\_instance\_name](#input\_powervs\_instance\_name) | Name of instance which will be created. Must be less than 13 characters. | `string` | n/a | yes |
+| [powervs\_network\_services\_config](#input\_powervs\_network\_services\_config) | Configures network services NTP, NFS and DNS on PowerVS instance. Requires 'powervs\_instance\_init\_linux' to be specified as internet access is required to download ansible collection [ibm.power\_linux\_sap collection](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/) to configure these services. The 'opts' attribute can take in comma separated values. | object(
{
squid = object({ enable = bool, squid_server_ip_port = string, no_proxy_hosts = string })
nfs = object({ enable = bool, nfs_server_path = string, nfs_client_path = string, opts = string, fstype = string })
dns = object({ enable = bool, dns_server_ip = string })
ntp = object({ enable = bool, ntp_server_ip = string })
}
)
| {
"dns": {
"dns_server_ip": "",
"enable": false
},
"nfs": {
"enable": false,
"fstype": "",
"nfs_client_path": "",
"nfs_server_path": "",
"opts": ""
},
"ntp": {
"enable": false,
"ntp_server_ip": ""
},
"squid": {
"enable": false,
"no_proxy_hosts": "",
"squid_server_ip_port": ""
}
} | no |
+| [powervs\_networks](#input\_powervs\_networks) | Existing list of private subnet ids to be attached to an instance. The first element will become the primary interface. Run 'ibmcloud pi subnets' to list available subnets. | list(
object({
name = string
id = string
cidr = optional(string)
})
)
| n/a | yes |
+| [powervs\_os\_registration\_password](#input\_powervs\_os\_registration\_password) | If you're using a byol or a custom RHEL/SLES image for SAP HANA and Netweaver you need to provide your OS registration credentials here. Leave empty if you're using an IBM provided subscription (FLS). | `string` | `null` | no |
+| [powervs\_os\_registration\_username](#input\_powervs\_os\_registration\_username) | If you're using a byol or a custom RHEL/SLES image for SAP HANA and Netweaver you need to provide your OS registration credentials here. Leave empty if you're using an IBM provided subscription (FLS). | `string` | `null` | no |
+| [powervs\_server\_type](#input\_powervs\_server\_type) | By default SAP profile will be deployed on default system type. Override this to specify the type of system on which to create the VM. Supported values are s922/e980/s1022/e1050/e1080/s1122/e1150/e1180. Mandatory when using dedicated hosts. | `string` | `null` | no |
+| [powervs\_ssh\_public\_key\_name](#input\_powervs\_ssh\_public\_key\_name) | Name of the existing PowerVS SSH public key. | `string` | n/a | yes |
+| [powervs\_workspace\_guid](#input\_powervs\_workspace\_guid) | Existing GUID of the PowerVS workspace. The GUID of the service instance associated with an account. | `string` | n/a | yes |
+| [powervs\_zone](#input\_powervs\_zone) | IBM Cloud PowerVS zone. | `string` | n/a | yes |
+| [sap\_domain](#input\_sap\_domain) | SAP network domain name. | `string` | `"sap.com"` | no |
+| [ssh\_private\_key](#input\_ssh\_private\_key) | SSH private key to access the PowerVS instance via bastion host. | `string` | `""` | no |
+
+### Outputs
+
+| Name | Description |
+|------|-------------|
+| [pi\_instance\_primary\_ip](#output\_pi\_instance\_primary\_ip) | IP address of the primary network interface of IBM PowerVS instance. |
+| [pi\_instance\_private\_ips](#output\_pi\_instance\_private\_ips) | All private IP addresses (as a list) of IBM PowerVS instance. |
+| [pi\_storage\_configuration](#output\_pi\_storage\_configuration) | Storage configuration of PowerVS instance. |
+
diff --git a/solutions/single-hana-instance/main.tf b/solutions/single-hana-instance/main.tf
new file mode 100644
index 00000000..fbecd9bb
--- /dev/null
+++ b/solutions/single-hana-instance/main.tf
@@ -0,0 +1,66 @@
+#####################################################
+# Deploy PowerVS Instance
+#####################################################
+
+module "hana_storage_calculation" {
+ source = "../../modules/pi-hana-storage-config"
+ pi_hana_instance_sap_profile_id = var.powervs_hana_instance_sap_profile_id
+ pi_hana_instance_additional_storage_config = var.powervs_hana_instance_additional_storage_config
+ pi_hana_instance_custom_storage_config = var.powervs_hana_instance_custom_storage_config
+}
+
+module "sap_hana_instance" {
+ source = "terraform-ibm-modules/powervs-instance/ibm"
+ version = "2.8.2"
+
+ pi_workspace_guid = var.powervs_workspace_guid
+ pi_ssh_public_key_name = var.powervs_ssh_public_key_name
+ pi_image_id = var.powervs_image_name
+ pi_instance_name = var.powervs_instance_name
+ pi_boot_image_storage_tier = var.powervs_boot_image_storage_tier
+ pi_sap_profile_id = var.powervs_hana_instance_sap_profile_id
+ pi_server_type = var.powervs_server_type
+ pi_deployment_target = var.powervs_deployment_target
+ pi_networks = var.powervs_networks
+ pi_storage_config = module.hana_storage_calculation.pi_hana_storage_config
+ ansible_vault_password = var.ansible_vault_password
+ pi_instance_init_linux = merge(var.powervs_instance_init_linux,
+ {
+ ssh_private_key = var.ssh_private_key,
+ custom_os_registration = (
+ try(trim(var.powervs_os_registration_username), "") != "" &&
+ try(trim(var.powervs_os_registration_password), "") != ""
+ ) ? {
+ username = var.powervs_os_registration_username
+ password = var.powervs_os_registration_password
+ } : null
+
+ })
+ pi_network_services_config = var.powervs_network_services_config
+}
+
+module "configure_os_for_sap" {
+
+ source = "../../modules/ansible"
+ depends_on = [module.sap_hana_instance]
+ count = var.powervs_instance_init_linux.enable ? 1 : 0
+
+ bastion_host_ip = var.powervs_instance_init_linux.bastion_host_ip
+ ansible_host_or_ip = var.powervs_instance_init_linux.ansible_host_or_ip
+ ssh_private_key = var.ssh_private_key
+ configure_ansible_host = true
+
+ src_script_template_name = "configure-os-for-sap/ansible_exec.sh.tftpl"
+ dst_script_file_name = "${var.powervs_instance_name}_configure_os_for_sap.sh"
+
+ src_playbook_template_name = "configure-os-for-sap/playbook-configure-os-for-sap.yml.tftpl"
+ dst_playbook_file_name = "${var.powervs_instance_name}-playbook-configure-os-for-sap.yml"
+ playbook_template_vars = {
+ "sap_solution" : "HANA",
+ "sap_domain" : var.sap_domain
+ }
+
+ src_inventory_template_name = "pi-instance-inventory.tftpl"
+ dst_inventory_file_name = "${var.powervs_instance_name}-instance-inventory"
+ inventory_template_vars = { "pi_instance_management_ip" : module.sap_hana_instance.pi_instance_primary_ip }
+}
diff --git a/solutions/single-hana-instance/outputs.tf b/solutions/single-hana-instance/outputs.tf
new file mode 100644
index 00000000..1936e013
--- /dev/null
+++ b/solutions/single-hana-instance/outputs.tf
@@ -0,0 +1,16 @@
+##############################################################################
+# Outputs
+output "pi_instance_primary_ip" {
+ description = "IP address of the primary network interface of IBM PowerVS instance."
+ value = module.sap_hana_instance.pi_instance_primary_ip
+}
+
+output "pi_instance_private_ips" {
+ description = "All private IP addresses (as a list) of IBM PowerVS instance."
+ value = module.sap_hana_instance.pi_instance_private_ips
+}
+
+output "pi_storage_configuration" {
+ description = "Storage configuration of PowerVS instance."
+ value = module.sap_hana_instance.pi_storage_configuration
+}
diff --git a/solutions/single-hana-instance/provider.tf b/solutions/single-hana-instance/provider.tf
new file mode 100644
index 00000000..bf95131c
--- /dev/null
+++ b/solutions/single-hana-instance/provider.tf
@@ -0,0 +1,33 @@
+locals {
+ ibm_powervs_zone_region_map = {
+ "syd04" = "syd"
+ "syd05" = "syd"
+ "sao01" = "sao"
+ "sao04" = "sao"
+ "tor01" = "tor"
+ "mon01" = "mon"
+ "eu-de-1" = "eu-de"
+ "eu-de-2" = "eu-de"
+ "mad02" = "mad"
+ "mad04" = "mad"
+ "lon04" = "lon"
+ "lon06" = "lon"
+ "osa21" = "osa"
+ "tok04" = "tok"
+ "us-south" = "us-south"
+ "dal10" = "us-south"
+ "dal12" = "us-south"
+ "dal14" = "us-south"
+ "us-east" = "us-east"
+ "wdc06" = "us-east"
+ "wdc07" = "us-east"
+ "wdc06-pvs-01" = "us-east"
+ }
+
+}
+
+provider "ibm" {
+ region = lookup(local.ibm_powervs_zone_region_map, var.powervs_zone, null)
+ zone = var.powervs_zone
+ ibmcloud_api_key = var.ibmcloud_api_key != null ? var.ibmcloud_api_key : null
+}
diff --git a/solutions/single-hana-instance/variables.tf b/solutions/single-hana-instance/variables.tf
new file mode 100644
index 00000000..0190f1b3
--- /dev/null
+++ b/solutions/single-hana-instance/variables.tf
@@ -0,0 +1,204 @@
+variable "ibmcloud_api_key" {
+ description = "The IBM Cloud platform API key needed to deploy IAM enabled resources."
+ type = string
+ sensitive = true
+}
+
+variable "powervs_zone" {
+ description = "IBM Cloud PowerVS zone."
+ type = string
+ validation {
+ condition = contains(["syd04", "syd05", "eu-de-1", "eu-de-2", "lon04", "lon06", "tok04", "us-east", "us-south", "dal10", "dal12", "dal14", "tor01", "osa21", "sao01", "sao04", "mon01", "wdc06", "wdc07", "che01", "mad02", "mad04", "wdc06-pvs-01"], var.powervs_zone)
+ error_message = "Only Following DC values are supported : syd04, syd05, eu-de-1, eu-de-2, lon04, lon06, tok04, us-east, us-south, dal10, dal12, dal14, tor01, osa21, sao01, sao04, mon01, wdc06, wdc07,che01, mad02, mad04, wdc06-pvs-01"
+ }
+}
+
+variable "powervs_workspace_guid" {
+ description = "Existing GUID of the PowerVS workspace. The GUID of the service instance associated with an account."
+ type = string
+}
+
+variable "powervs_ssh_public_key_name" {
+ description = "Name of the existing PowerVS SSH public key."
+ type = string
+}
+
+#####################################################
+# PowerVS Instance Parameters
+#####################################################
+
+variable "powervs_instance_name" {
+ description = "Name of instance which will be created. Must be less than 13 characters."
+ type = string
+ validation {
+ condition = length(var.powervs_instance_name) < 13
+ error_message = "The instance name must be less than 13 characters."
+ }
+}
+
+variable "powervs_image_name" {
+ description = "Image name used for PowerVS instance. Run 'ibmcloud pi images' to list available images."
+ type = string
+}
+
+variable "powervs_boot_image_storage_tier" {
+ description = "Storage type for server deployment. If storage type is not provided the storage type will default to tier3. Possible values tier0, tier1 and tier3"
+ type = string
+ default = null
+}
+
+variable "powervs_hana_instance_sap_profile_id" {
+ description = "PowerVS SAP HANA instance profile to use. Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-power-vs). File system sizes are automatically calculated. Override automatic calculation by setting values in optional parameter 'powervs_hana_instance_custom_storage_config'."
+ type = string
+ default = "sh2-4x256"
+}
+
+variable "powervs_server_type" {
+ description = "By default SAP profile will be deployed on default system type. Override this to specify the type of system on which to create the VM. Supported values are s922/e980/s1022/e1050/e1080/s1122/e1150/e1180. Mandatory when using dedicated hosts."
+ type = string
+ default = null
+}
+
+variable "powervs_deployment_target" {
+ description = "The deployment of a dedicated host. Max items: 1, id is the uuid of the host group or host. type is the deployment target type, supported values are host and hostGroup"
+ type = list(object(
+ {
+ type = string
+ id = string
+ }
+ ))
+ default = null
+}
+
+variable "powervs_networks" {
+ description = "Existing list of private subnet ids to be attached to an instance. The first element will become the primary interface. Run 'ibmcloud pi subnets' to list available subnets."
+ type = list(
+ object({
+ name = string
+ id = string
+ cidr = optional(string)
+ })
+ )
+}
+
+variable "powervs_hana_instance_custom_storage_config" {
+ description = "Custom file systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS. If not specified, volumes for '/hana/data', '/hana/log', '/hana/shared' are automatically calculated and created."
+ type = list(object({
+ name = string
+ size = string
+ count = string
+ tier = string
+ mount = string
+ pool = optional(string)
+ }))
+ default = [{
+ "name" : "",
+ "size" : "",
+ "count" : "",
+ "tier" : "",
+ "mount" : ""
+ }]
+}
+
+variable "powervs_hana_instance_additional_storage_config" {
+ description = "Additional File systems to be created and attached to PowerVS SAP HANA 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 target mount point on OS."
+ type = list(object({
+ name = string
+ size = string
+ count = string
+ tier = string
+ mount = string
+ }))
+ default = [{
+ "name" : "usrsap",
+ "size" : "50",
+ "count" : "1",
+ "tier" : "tier3",
+ "mount" : "/usr/sap"
+
+ }]
+}
+
+#####################################################
+# PowerVS Instance Initialization Optional parameters.
+#####################################################
+
+variable "powervs_instance_init_linux" {
+ description = "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](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/). where 'proxy_host_or_ip_port' E.g., 10.10.10.4:3128 , 'bastion_host_ip' is public IP of bastion/jump host to access the private IP of created linux PowerVS instance."
+ sensitive = true
+ type = object(
+ {
+ enable = bool
+ bastion_host_ip = string
+ ansible_host_or_ip = string
+ }
+ )
+
+ default = {
+ enable = false
+ bastion_host_ip = ""
+ ansible_host_or_ip = ""
+ }
+ validation {
+ condition = var.powervs_instance_init_linux.enable == false || (var.powervs_instance_init_linux.enable == true && length(var.powervs_instance_init_linux.bastion_host_ip) > 0 && length(var.powervs_instance_init_linux.ansible_host_or_ip) > 0)
+ error_message = "bastion_host_ip and ansible_host_or_ip must be provided when powervs_instance_init_linux is enabled."
+ }
+}
+
+variable "ssh_private_key" {
+ description = "SSH private key to access the PowerVS instance via bastion host."
+ type = string
+ sensitive = true
+ default = ""
+
+ validation {
+ condition = var.powervs_instance_init_linux.enable == false || (var.powervs_instance_init_linux.enable == true && length(var.ssh_private_key) > 0)
+ error_message = "ssh_private_key must be provided when powervs_instance_init_linux is enabled."
+ }
+
+}
+variable "powervs_network_services_config" {
+ description = "Configures network services NTP, NFS and DNS on PowerVS instance. Requires 'powervs_instance_init_linux' to be specified as internet access is required to download ansible collection [ibm.power_linux_sap collection](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/) to configure these services. The 'opts' attribute can take in comma separated values."
+ type = object(
+ {
+ squid = object({ enable = bool, squid_server_ip_port = string, no_proxy_hosts = string })
+ nfs = object({ enable = bool, nfs_server_path = string, nfs_client_path = string, opts = string, fstype = string })
+ dns = object({ enable = bool, dns_server_ip = string })
+ ntp = object({ enable = bool, ntp_server_ip = string })
+ }
+ )
+
+ default = {
+ squid = { enable = false, squid_server_ip_port = "", no_proxy_hosts = "" }
+ nfs = { enable = false, nfs_server_path = "", nfs_client_path = "", opts = "", fstype = "" }
+ ntp = { enable = false, ntp_server_ip = "" },
+ dns = { enable = false, dns_server_ip = "" }
+ }
+
+}
+
+variable "sap_domain" {
+ description = "SAP network domain name."
+ type = string
+ default = "sap.com"
+}
+
+variable "powervs_os_registration_username" {
+ description = "If you're using a byol or a custom RHEL/SLES image for SAP HANA and Netweaver you need to provide your OS registration credentials here. Leave empty if you're using an IBM provided subscription (FLS)."
+ type = string
+ default = null
+}
+
+variable "powervs_os_registration_password" {
+ description = "If you're using a byol or a custom RHEL/SLES image for SAP HANA and Netweaver you need to provide your OS registration credentials here. Leave empty if you're using an IBM provided subscription (FLS)."
+ type = string
+ sensitive = true
+ default = null
+}
+
+variable "ansible_vault_password" {
+ description = "Vault password to encrypt ansible playbooks that contain sensitive information. Required with customer provided linux subscription (powervs_os_registration). Password requirements: 15-100 characters and at least one uppercase letter, one lowercase letter, one number, and one special character. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]_{|}~."
+ type = string
+ sensitive = true
+ default = ""
+}
diff --git a/solutions/single-hana-instance/version.tf b/solutions/single-hana-instance/version.tf
new file mode 100644
index 00000000..98e8f099
--- /dev/null
+++ b/solutions/single-hana-instance/version.tf
@@ -0,0 +1,13 @@
+#####################################################
+# PowerVS Instance Module
+#####################################################
+
+terraform {
+ required_version = ">= 1.9.0"
+ required_providers {
+ ibm = {
+ source = "IBM-Cloud/ibm"
+ version = "=1.83.3"
+ }
+ }
+}
diff --git a/solutions/single-netweaver-instance/README.md b/solutions/single-netweaver-instance/README.md
new file mode 100644
index 00000000..236a2ee9
--- /dev/null
+++ b/solutions/single-netweaver-instance/README.md
@@ -0,0 +1,67 @@
+# Provisioning a single tuned Power Virtual Server for SAP Application Server
+
+This example deploys a single Power Virtual Server instance that is tuned and ready to host an SAP NetWeaver/Application Server.
+
+It provisions the following components in IBM Cloud:
+
+* Creates an IBM® Power Virtual Server instance in an existing PowerVS workspace (which contains a public SSH key, pre-existing subnet and a pre-imported OS image).
+* Creates and attaches volumes to the instance.
+* (Optional) Initializes the instance by configuring proxy settings, network services (NTP, DNS, NFS), and creating file systems.
+* (Optional) Tunes the OS for SAP NetWeaver/SAP Application Server.
+* Supports bring-your-own-license (BYOL) for RHEL/SLES images.
+* Does **not** install SAP NetWeaver/SAP Application Server.
+
+
+
+### Requirements
+
+| Name | Version |
+|------|---------|
+| [terraform](#requirement\_terraform) | >= 1.9.0 |
+| [ibm](#requirement\_ibm) | =1.83.3 |
+
+### Modules
+
+| Name | Source | Version |
+|------|--------|---------|
+| [configure\_os\_for\_sap](#module\_configure\_os\_for\_sap) | ../../modules/ansible | n/a |
+| [sap\_netweaver\_instance](#module\_sap\_netweaver\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.8.2 |
+
+### Resources
+
+No resources.
+
+### Inputs
+
+| Name | Description | Type | Default | Required |
+|------|-------------|------|---------|:--------:|
+| [ansible\_vault\_password](#input\_ansible\_vault\_password) | Vault password to encrypt ansible playbooks that contain sensitive information. Required with customer provided linux subscription (powervs\_os\_registration). Password requirements: 15-100 characters and at least one uppercase letter, one lowercase letter, one number, and one special character. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]\_{\|}~. | `string` | `""` | no |
+| [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | The IBM Cloud platform API key needed to deploy IAM enabled resources. | `string` | n/a | yes |
+| [powervs\_boot\_image\_storage\_tier](#input\_powervs\_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 |
+| [powervs\_cpu\_proc\_type](#input\_powervs\_cpu\_proc\_type) | The type of processor mode in which the VM will run with shared, capped or dedicated. | `string` | n/a | yes |
+| [powervs\_deployment\_target](#input\_powervs\_deployment\_target) | The deployment of a dedicated host. Max items: 1, id is the uuid of the host group or host. type is the deployment target type, supported values are host and hostGroup | list(object(
{
type = string
id = string
}
))
| `null` | no |
+| [powervs\_image\_name](#input\_powervs\_image\_name) | Image name used for PowerVS instance. Run 'ibmcloud pi images' to list available images. | `string` | n/a | yes |
+| [powervs\_instance\_init\_linux](#input\_powervs\_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](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/). where 'proxy\_host\_or\_ip\_port' E.g., 10.10.10.4:3128 , 'bastion\_host\_ip' is public IP of bastion/jump host to access the private IP of created linux PowerVS instance. | object(
{
enable = bool
bastion_host_ip = string
ansible_host_or_ip = string
}
)
| {
"ansible_host_or_ip": "",
"bastion_host_ip": "",
"enable": false
} | no |
+| [powervs\_instance\_name](#input\_powervs\_instance\_name) | Name of instance which will be created. Must be less than 13 characters. | `string` | n/a | yes |
+| [powervs\_memory\_size](#input\_powervs\_memory\_size) | The amount of memory that you want to assign to your instance in GB. | `string` | n/a | yes |
+| [powervs\_network\_services\_config](#input\_powervs\_network\_services\_config) | Configures network services NTP, NFS and DNS on PowerVS instance. Requires 'powervs\_instance\_init\_linux' to be specified as internet access is required to download ansible collection [ibm.power\_linux\_sap collection](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/) to configure these services. The 'opts' attribute can take in comma separated values. | object(
{
squid = object({ enable = bool, squid_server_ip_port = string, no_proxy_hosts = string })
nfs = object({ enable = bool, nfs_server_path = string, nfs_client_path = string, opts = string, fstype = string })
dns = object({ enable = bool, dns_server_ip = string })
ntp = object({ enable = bool, ntp_server_ip = string })
}
)
| {
"dns": {
"dns_server_ip": "",
"enable": false
},
"nfs": {
"enable": false,
"fstype": "",
"nfs_client_path": "",
"nfs_server_path": "",
"opts": ""
},
"ntp": {
"enable": false,
"ntp_server_ip": ""
},
"squid": {
"enable": false,
"no_proxy_hosts": "",
"squid_server_ip_port": ""
}
} | no |
+| [powervs\_networks](#input\_powervs\_networks) | Existing list of private subnet ids to be attached to an instance. The first element will become the primary interface. Run 'ibmcloud pi subnets' to list available subnets. | list(
object({
name = string
id = string
cidr = optional(string)
})
)
| n/a | yes |
+| [powervs\_number\_of\_processors](#input\_powervs\_number\_of\_processors) | The number of vCPUs to assign to the VM as visible within the guest Operating System. | `string` | n/a | yes |
+| [powervs\_os\_registration\_password](#input\_powervs\_os\_registration\_password) | If you're using a byol or a custom RHEL/SLES image for SAP HANA and Netweaver you need to provide your OS registration credentials here. Leave empty if you're using an IBM provided subscription (FLS). | `string` | `null` | no |
+| [powervs\_os\_registration\_username](#input\_powervs\_os\_registration\_username) | If you're using a byol or a custom RHEL/SLES image for SAP HANA and Netweaver you need to provide your OS registration credentials here. Leave empty if you're using an IBM provided subscription (FLS). | `string` | `null` | no |
+| [powervs\_server\_type](#input\_powervs\_server\_type) | The type of system on which to create the VM. Supported values are s922/e980/s1022/e1050/e1080/s1122/e1150/e1180. | `string` | n/a | yes |
+| [powervs\_ssh\_public\_key\_name](#input\_powervs\_ssh\_public\_key\_name) | Name of the existing PowerVS SSH public key. | `string` | n/a | yes |
+| [powervs\_storage\_config](#input\_powervs\_storage\_config) | File systems to be created and attached to PowerVS instance. 'disk\_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. 'pool' specifies the volume pool where the volume will be created. 'sharable' specifies if volume can be shared across PVM instances. | list(object({
name = string
size = string
count = string
tier = string
mount = optional(string)
pool = optional(string)
sharable = optional(bool)
})) | [
{
"count": "1",
"mount": "/usr/sap",
"name": "usrsap",
"size": "200",
"tier": "tier3"
},
{
"count": "1",
"mount": "/sapmnt",
"name": "sapmnt",
"size": "200",
"tier": "tier3"
}
]
| no |
+| [powervs\_workspace\_guid](#input\_powervs\_workspace\_guid) | Existing GUID of the PowerVS workspace. The GUID of the service instance associated with an account. | `string` | n/a | yes |
+| [powervs\_zone](#input\_powervs\_zone) | IBM Cloud PowerVS zone. | `string` | n/a | yes |
+| [sap\_domain](#input\_sap\_domain) | SAP network domain name. | `string` | `"sap.com"` | no |
+| [ssh\_private\_key](#input\_ssh\_private\_key) | SSH private key to access the PowerVS instance via bastion host. | `string` | `""` | no |
+
+### Outputs
+
+| Name | Description |
+|------|-------------|
+| [pi\_instance\_primary\_ip](#output\_pi\_instance\_primary\_ip) | IP address of the primary network interface of IBM PowerVS instance. |
+| [pi\_instance\_private\_ips](#output\_pi\_instance\_private\_ips) | All private IP addresses (as a list) of IBM PowerVS instance. |
+| [pi\_storage\_configuration](#output\_pi\_storage\_configuration) | Storage configuration of PowerVS instance. |
+
diff --git a/solutions/single-netweaver-instance/main.tf b/solutions/single-netweaver-instance/main.tf
new file mode 100644
index 00000000..33375ccc
--- /dev/null
+++ b/solutions/single-netweaver-instance/main.tf
@@ -0,0 +1,63 @@
+#####################################################
+# Deploy PowerVS Instance
+#####################################################
+
+module "sap_netweaver_instance" {
+ source = "terraform-ibm-modules/powervs-instance/ibm"
+ version = "2.8.2"
+
+
+ pi_workspace_guid = var.powervs_workspace_guid
+ pi_ssh_public_key_name = var.powervs_ssh_public_key_name
+ pi_image_id = var.powervs_image_name
+ pi_instance_name = var.powervs_instance_name
+ pi_boot_image_storage_tier = var.powervs_boot_image_storage_tier
+ pi_sap_profile_id = null
+ pi_server_type = var.powervs_server_type
+ pi_deployment_target = var.powervs_deployment_target
+ pi_cpu_proc_type = var.powervs_cpu_proc_type
+ pi_number_of_processors = var.powervs_number_of_processors
+ pi_memory_size = var.powervs_memory_size
+ pi_networks = var.powervs_networks
+ pi_storage_config = var.powervs_storage_config
+ ansible_vault_password = var.ansible_vault_password
+ pi_instance_init_linux = merge(var.powervs_instance_init_linux,
+ {
+ ssh_private_key = var.ssh_private_key,
+ custom_os_registration = (
+ try(trim(var.powervs_os_registration_username), "") != "" &&
+ try(trim(var.powervs_os_registration_password), "") != ""
+ ) ? {
+ username = var.powervs_os_registration_username
+ password = var.powervs_os_registration_password
+ } : null
+
+ })
+ pi_network_services_config = var.powervs_network_services_config
+}
+
+module "configure_os_for_sap" {
+
+ source = "../../modules/ansible"
+ depends_on = [module.sap_netweaver_instance]
+ count = var.powervs_instance_init_linux.enable ? 1 : 0
+
+ bastion_host_ip = var.powervs_instance_init_linux.bastion_host_ip
+ ansible_host_or_ip = var.powervs_instance_init_linux.ansible_host_or_ip
+ ssh_private_key = var.ssh_private_key
+ configure_ansible_host = true
+
+ src_script_template_name = "configure-os-for-sap/ansible_exec.sh.tftpl"
+ dst_script_file_name = "${var.powervs_instance_name}_configure_os_for_sap.sh"
+
+ src_playbook_template_name = "configure-os-for-sap/playbook-configure-os-for-sap.yml.tftpl"
+ dst_playbook_file_name = "${var.powervs_instance_name}-playbook-configure-os-for-sap.yml"
+ playbook_template_vars = {
+ "sap_solution" : "NETWEAVER",
+ "sap_domain" : var.sap_domain
+ }
+
+ src_inventory_template_name = "pi-instance-inventory.tftpl"
+ dst_inventory_file_name = "${var.powervs_instance_name}-instance-inventory"
+ inventory_template_vars = { "pi_instance_management_ip" : module.sap_netweaver_instance.pi_instance_primary_ip }
+}
diff --git a/solutions/single-netweaver-instance/outputs.tf b/solutions/single-netweaver-instance/outputs.tf
new file mode 100644
index 00000000..eed13770
--- /dev/null
+++ b/solutions/single-netweaver-instance/outputs.tf
@@ -0,0 +1,16 @@
+##############################################################################
+# Outputs
+output "pi_instance_primary_ip" {
+ description = "IP address of the primary network interface of IBM PowerVS instance."
+ value = module.sap_netweaver_instance.pi_instance_primary_ip
+}
+
+output "pi_instance_private_ips" {
+ description = "All private IP addresses (as a list) of IBM PowerVS instance."
+ value = module.sap_netweaver_instance.pi_instance_private_ips
+}
+
+output "pi_storage_configuration" {
+ description = "Storage configuration of PowerVS instance."
+ value = module.sap_netweaver_instance.pi_storage_configuration
+}
diff --git a/solutions/single-netweaver-instance/provider.tf b/solutions/single-netweaver-instance/provider.tf
new file mode 100644
index 00000000..bf95131c
--- /dev/null
+++ b/solutions/single-netweaver-instance/provider.tf
@@ -0,0 +1,33 @@
+locals {
+ ibm_powervs_zone_region_map = {
+ "syd04" = "syd"
+ "syd05" = "syd"
+ "sao01" = "sao"
+ "sao04" = "sao"
+ "tor01" = "tor"
+ "mon01" = "mon"
+ "eu-de-1" = "eu-de"
+ "eu-de-2" = "eu-de"
+ "mad02" = "mad"
+ "mad04" = "mad"
+ "lon04" = "lon"
+ "lon06" = "lon"
+ "osa21" = "osa"
+ "tok04" = "tok"
+ "us-south" = "us-south"
+ "dal10" = "us-south"
+ "dal12" = "us-south"
+ "dal14" = "us-south"
+ "us-east" = "us-east"
+ "wdc06" = "us-east"
+ "wdc07" = "us-east"
+ "wdc06-pvs-01" = "us-east"
+ }
+
+}
+
+provider "ibm" {
+ region = lookup(local.ibm_powervs_zone_region_map, var.powervs_zone, null)
+ zone = var.powervs_zone
+ ibmcloud_api_key = var.ibmcloud_api_key != null ? var.ibmcloud_api_key : null
+}
diff --git a/solutions/single-netweaver-instance/variables.tf b/solutions/single-netweaver-instance/variables.tf
new file mode 100644
index 00000000..899025a4
--- /dev/null
+++ b/solutions/single-netweaver-instance/variables.tf
@@ -0,0 +1,195 @@
+variable "ibmcloud_api_key" {
+ description = "The IBM Cloud platform API key needed to deploy IAM enabled resources."
+ type = string
+ sensitive = true
+}
+
+variable "powervs_zone" {
+ description = "IBM Cloud PowerVS zone."
+ type = string
+ validation {
+ condition = contains(["syd04", "syd05", "eu-de-1", "eu-de-2", "lon04", "lon06", "tok04", "us-east", "us-south", "dal10", "dal12", "dal14", "tor01", "osa21", "sao01", "sao04", "mon01", "wdc06", "wdc07", "che01", "mad02", "mad04", "wdc06-pvs-01"], var.powervs_zone)
+ error_message = "Only Following DC values are supported : syd04, syd05, eu-de-1, eu-de-2, lon04, lon06, tok04, us-east, us-south, dal10, dal12, dal14, tor01, osa21, sao01, sao04, mon01, wdc06, wdc07,che01, mad02, mad04, wdc06-pvs-01"
+ }
+}
+
+variable "powervs_workspace_guid" {
+ description = "Existing GUID of the PowerVS workspace. The GUID of the service instance associated with an account."
+ type = string
+}
+
+variable "powervs_ssh_public_key_name" {
+ description = "Name of the existing PowerVS SSH public key."
+ type = string
+}
+
+#####################################################
+# PowerVS Instance Parameters
+#####################################################
+
+variable "powervs_instance_name" {
+ description = "Name of instance which will be created. Must be less than 13 characters."
+ type = string
+ validation {
+ condition = length(var.powervs_instance_name) < 13
+ error_message = "The instance name must be less than 13 characters."
+ }
+}
+
+variable "powervs_image_name" {
+ description = "Image name used for PowerVS instance. Run 'ibmcloud pi images' to list available images."
+ type = string
+}
+
+variable "powervs_boot_image_storage_tier" {
+ description = "Storage type for server deployment. If storage type is not provided the storage type will default to tier3. Possible values tier0, tier1 and tier3"
+ type = string
+ default = null
+}
+
+variable "powervs_server_type" {
+ description = "The type of system on which to create the VM. Supported values are s922/e980/s1022/e1050/e1080/s1122/e1150/e1180."
+ type = string
+}
+
+variable "powervs_deployment_target" {
+ description = "The deployment of a dedicated host. Max items: 1, id is the uuid of the host group or host. type is the deployment target type, supported values are host and hostGroup"
+ type = list(object(
+ {
+ type = string
+ id = string
+ }
+ ))
+ default = null
+}
+
+variable "powervs_cpu_proc_type" {
+ description = "The type of processor mode in which the VM will run with shared, capped or dedicated."
+ type = string
+}
+
+variable "powervs_number_of_processors" {
+ description = "The number of vCPUs to assign to the VM as visible within the guest Operating System."
+ type = string
+}
+
+variable "powervs_memory_size" {
+ description = "The amount of memory that you want to assign to your instance in GB."
+ type = string
+}
+
+variable "powervs_networks" {
+ description = "Existing list of private subnet ids to be attached to an instance. The first element will become the primary interface. Run 'ibmcloud pi subnets' to list available subnets."
+ type = list(
+ object({
+ name = string
+ id = string
+ cidr = optional(string)
+ })
+ )
+}
+
+variable "powervs_storage_config" {
+ description = "File systems to be created and attached to PowerVS instance. 'disk_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. 'pool' specifies the volume pool where the volume will be created. 'sharable' specifies if volume can be shared across PVM instances."
+ type = list(object({
+ name = string
+ size = string
+ count = string
+ tier = string
+ mount = optional(string)
+ pool = optional(string)
+ sharable = optional(bool)
+ }))
+ default = [
+ {
+ name = "usrsap", size = "200", count = "1", tier = "tier3", mount = "/usr/sap"
+ },
+ {
+ name = "sapmnt", size = "200", count = "1", tier = "tier3", mount = "/sapmnt"
+ }
+ ]
+}
+
+#####################################################
+# PowerVS Instance Initialization Optional parameters.
+#####################################################
+
+variable "powervs_instance_init_linux" {
+ description = "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](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/). where 'proxy_host_or_ip_port' E.g., 10.10.10.4:3128 , 'bastion_host_ip' is public IP of bastion/jump host to access the private IP of created linux PowerVS instance."
+ sensitive = true
+ type = object(
+ {
+ enable = bool
+ bastion_host_ip = string
+ ansible_host_or_ip = string
+ }
+ )
+
+ default = {
+ enable = false
+ bastion_host_ip = ""
+ ansible_host_or_ip = ""
+ }
+ validation {
+ condition = var.powervs_instance_init_linux.enable == false || (var.powervs_instance_init_linux.enable == true && length(var.powervs_instance_init_linux.bastion_host_ip) > 0 && length(var.powervs_instance_init_linux.ansible_host_or_ip) > 0)
+ error_message = "bastion_host_ip and ansible_host_or_ip must be provided when powervs_instance_init_linux is enabled."
+ }
+}
+
+variable "ssh_private_key" {
+ description = "SSH private key to access the PowerVS instance via bastion host."
+ type = string
+ sensitive = true
+ default = ""
+
+ validation {
+ condition = var.powervs_instance_init_linux.enable == false || (var.powervs_instance_init_linux.enable == true && length(var.ssh_private_key) > 0)
+ error_message = "ssh_private_key must be provided when powervs_instance_init_linux is enabled."
+ }
+
+}
+variable "powervs_network_services_config" {
+ description = "Configures network services NTP, NFS and DNS on PowerVS instance. Requires 'powervs_instance_init_linux' to be specified as internet access is required to download ansible collection [ibm.power_linux_sap collection](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/) to configure these services. The 'opts' attribute can take in comma separated values."
+ type = object(
+ {
+ squid = object({ enable = bool, squid_server_ip_port = string, no_proxy_hosts = string })
+ nfs = object({ enable = bool, nfs_server_path = string, nfs_client_path = string, opts = string, fstype = string })
+ dns = object({ enable = bool, dns_server_ip = string })
+ ntp = object({ enable = bool, ntp_server_ip = string })
+ }
+ )
+
+ default = {
+ squid = { enable = false, squid_server_ip_port = "", no_proxy_hosts = "" }
+ nfs = { enable = false, nfs_server_path = "", nfs_client_path = "", opts = "", fstype = "" }
+ ntp = { enable = false, ntp_server_ip = "" },
+ dns = { enable = false, dns_server_ip = "" }
+ }
+
+}
+
+variable "sap_domain" {
+ description = "SAP network domain name."
+ type = string
+ default = "sap.com"
+}
+
+variable "powervs_os_registration_username" {
+ description = "If you're using a byol or a custom RHEL/SLES image for SAP HANA and Netweaver you need to provide your OS registration credentials here. Leave empty if you're using an IBM provided subscription (FLS)."
+ type = string
+ default = null
+}
+
+variable "powervs_os_registration_password" {
+ description = "If you're using a byol or a custom RHEL/SLES image for SAP HANA and Netweaver you need to provide your OS registration credentials here. Leave empty if you're using an IBM provided subscription (FLS)."
+ type = string
+ sensitive = true
+ default = null
+}
+
+variable "ansible_vault_password" {
+ description = "Vault password to encrypt ansible playbooks that contain sensitive information. Required with customer provided linux subscription (powervs_os_registration). Password requirements: 15-100 characters and at least one uppercase letter, one lowercase letter, one number, and one special character. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]_{|}~."
+ type = string
+ sensitive = true
+ default = ""
+}
diff --git a/solutions/single-netweaver-instance/version.tf b/solutions/single-netweaver-instance/version.tf
new file mode 100644
index 00000000..98e8f099
--- /dev/null
+++ b/solutions/single-netweaver-instance/version.tf
@@ -0,0 +1,13 @@
+#####################################################
+# PowerVS Instance Module
+#####################################################
+
+terraform {
+ required_version = ">= 1.9.0"
+ required_providers {
+ ibm = {
+ source = "IBM-Cloud/ibm"
+ version = "=1.83.3"
+ }
+ }
+}