Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
750 changes: 387 additions & 363 deletions .secrets.baseline

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This repository contains deployable architecture solutions that help in deployin
- Additionally tunes the instances according to SAP's best practices, which are fully ready for hosting SAP applications.

1. [IBM catalog PowerVS S/4HANA or BW/4HANA variation](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/tree/main/solutions/ibm-catalog/sap-s4hana-bw4hana)
- Creates a VPC and Power Virtual Server workspace, interconnects them, and configures OS network management services (SQUID proxy, NTP, NFS, and DNS) using Ansible Galaxy collection roles from the ibm.power_linux_sap collection.
- Creates and configures **one HANA instance and one NetWeaver instance** with **RHEL** OS distribution. Creates a private subnet for SAP communication for the entire landscape.
- Optionally configures OS network management services (NTP, NFS, and DNS services) using Ansible Galaxy Collection from [IBM](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/): `power_linux_sap`
- Tunes the instances according to SAP's best practices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ authors:
- name: Arnold Beilmann
- name: Suraj Bharadwaj
- name: Ludwig Mueller
- name: Trilochan Pandey
production: true
deployment-url: https://cloud.ibm.com/catalog/architecture/deploy-arch-ibm-pvs-sap-9aa6135e-75d5-467e-9f4a-ac2a21c069b8-global
docs: https://cloud.ibm.com/docs/sap-powervs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ authors:
- name: Arnold Beilmann
- name: Suraj Bharadwaj
- name: Ludwig Mueller
- name: Trilochan Pandey
production: true
deployment-url: https://cloud.ibm.com/catalog/architecture/deploy-arch-ibm-pvs-sap-9aa6135e-75d5-467e-9f4a-ac2a21c069b8-global
docs: https://cloud.ibm.com/docs/sap-powervs
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
200 changes: 200 additions & 0 deletions solutions/ibm-catalog/sap-s4hana-bw4hana/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
| SAP HANA rev78 Binaries |
|-----------------------------------|
| IMDB_AFL20_078_0-80002045.SAR |
| IMDB_CLIENT20_020_23-80002095.SAR |
| IMDB_LCAPPS_2078_0-80002183.SAR |
| IMDB_SERVER20_078_0-80002046.SAR |
| SAPCAR_1115-70006238.EXE |


| S/4HANA 2023 Binaries |
|-------------------------------------------------------------|
| IMDB_CLIENT20_020_23-80002095.SAR |
| KD75888.SAR (Required when using stack xml file) |
| R3trans_85-70007832.SAR |
| S4CORE108_INST_EXPORT_1.zip .. S4CORE108_INST_EXPORT_30.zip |
| S4HANAOP108_ERP_LANG_EN.SAR |
| SAPCAR_1115-70006238.EXE |
| SAPEXEDB_51-70007831.SAR |
| SAPEXE_51-70007832.SAR |
| SAPHOSTAGENT64_64-80004831.SAR |
| SUM20SP20_0-80002470.SAR |
| SWPM20SP18_0-80003426.SAR |
| igsexe_4-70005446.sar |
| igshelper_17-10010245.sar |


| BW/4HANA Binaries 2021 |
|--------------------------------------------------------------|
| BW4HANA300_INST_EXPORT_1.zip .. BW4HANA300_INST_EXPORT_8.zip |
| IMDB_CLIENT20_015_19-80002095.SAR |
| KD75685.SAR(Required when using stack xml file) |
| BW4HANA300_NW_LANG_EN.SAR |
| R3trans_121-70006667.SAR |
| SAPCAR_1115-70006238.EXE |
| SAPEXEDB_100-70006666.SAR |
| SAPEXE_100-70006667.SAR |
| SAPHOSTAGENT60_60-80004831.SAR |
| SUM20SP17_1-80002470.SAR |
| SWPM20SP15_1-80003426.SAR |
| igsexe_3-70005446.sar |
| igshelper_17-10010245.sar |


| SAP x86_64 binaries for monitoring host|
|-----------------------------------|
| IMDB_CLIENT20_020_23-80002082.SAR |
| SAPCAR_1300-70007716.EXE |
77 changes: 77 additions & 0 deletions solutions/ibm-catalog/sap-s4hana-bw4hana/images.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
locals {
powervs_custom_images = module.standard.powervs_images
selected_hana_image = var.os_image_distro == "SLES" ? var.powervs_default_sap_images.sles_hana_image : var.powervs_default_sap_images.rhel_hana_image
selected_netweaver_image = var.os_image_distro == "SLES" ? var.powervs_default_sap_images.sles_nw_image : var.powervs_default_sap_images.rhel_nw_image

fls_image_types = ["stock-sap-fls", "stock-sap-netweaver-fls"]

use_custom_images = (
length(local.powervs_custom_images) > 0 &&
alltrue([
for name in [local.selected_hana_image, local.selected_netweaver_image] : (
contains(keys(local.powervs_custom_images), name) ?
local.powervs_custom_images[name].image_vendor == "SAP" : false
)
])
)
}

# Stock image data (only if not using custom)
data "ibm_pi_catalog_images" "catalog_images_ds" {
count = local.use_custom_images ? 0 : 1
provider = ibm.ibm-pi
pi_cloud_instance_id = module.standard.powervs_workspace_guid
sap = true
}

# Custom image data (only if using custom)
data "ibm_pi_image" "custom_images" {
count = local.use_custom_images ? 2 : 0
provider = ibm.ibm-pi
pi_image_name = element([local.selected_hana_image, local.selected_netweaver_image], count.index)
pi_cloud_instance_id = module.standard.powervs_workspace_guid
}

locals {
hana_image_type = local.use_custom_images ? data.ibm_pi_image.custom_images[0].image_type : one([
for img in data.ibm_pi_catalog_images.catalog_images_ds[0].images :
img.image_type if img.name == local.selected_hana_image
])

netweaver_image_type = local.use_custom_images ? data.ibm_pi_image.custom_images[1].image_type : one([
for img in data.ibm_pi_catalog_images.catalog_images_ds[0].images :
img.image_type if img.name == local.selected_netweaver_image
])

hana_image_id = local.use_custom_images ? lookup(local.powervs_custom_images, local.selected_hana_image, null).image_id : one([
for img in data.ibm_pi_catalog_images.catalog_images_ds[0].images :
img.image_id if img.name == local.selected_hana_image
])

netweaver_image_id = local.use_custom_images ? lookup(local.powervs_custom_images, local.selected_netweaver_image, null).image_id : one([
for img in data.ibm_pi_catalog_images.catalog_images_ds[0].images :
img.image_id if img.name == local.selected_netweaver_image
])

hana_is_fls = contains(local.fls_image_types, local.hana_image_type)
netweaver_is_fls = contains(local.fls_image_types, local.netweaver_image_type)
images_mixed = local.hana_is_fls != local.netweaver_is_fls
use_fls = local.hana_is_fls && local.netweaver_is_fls
has_byol_creds = length(var.powervs_os_registration_username) > 0 && length(var.powervs_os_registration_password) > 0
byol_and_fls = local.use_fls && local.has_byol_creds
missing_byol_creds = !local.use_fls && !local.has_byol_creds

# Validation messages
images_mixed_msg = "You've selected an fls image and a byol image for hana and netweaver. Using byol on one and fls on another is currently not supported."

# tflint-ignore: terraform_unused_declarations
validate_images_mixed = regex("^${local.images_mixed_msg}$", (local.images_mixed ? "" : local.images_mixed_msg))

missing_byol_msg = "Missing byol credentials for activation of linux subscription."
# tflint-ignore: terraform_unused_declarations
validate_byol_provided = regex("^${local.missing_byol_msg}$", (local.missing_byol_creds ? "" : local.missing_byol_msg))

byol_and_fls_msg = "FLS images and user provided linux subscription detected. Can't use both at the same time."
# tflint-ignore: terraform_unused_declarations
validate_byol_and_fls = regex("^${local.byol_and_fls_msg}$", (local.byol_and_fls ? "" : local.byol_and_fls_msg))
}
52 changes: 52 additions & 0 deletions solutions/ibm-catalog/sap-s4hana-bw4hana/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
locals {
powervs_hana_instance = {
name = "hana"
image_id = local.hana_image_id
sap_profile_id = var.powervs_hana_instance_sap_profile_id
additional_storage_config = var.powervs_hana_instance_additional_storage_config
}

powervs_netweaver_instance = {
instance_count = 1
name = "nw"
image_id = local.netweaver_image_id
processors = var.powervs_netweaver_cpu_number
memory = var.powervs_netweaver_memory_size
proc_type = "shared"
storage_config = var.powervs_netweaver_instance_storage_config
}

powervs_instance_init_linux = {
enable = true
bastion_host_ip = module.standard.access_host_or_ip
ansible_host_or_ip = module.standard.ansible_host_or_ip
ssh_private_key = var.ssh_private_key
custom_os_registration = local.use_fls ? null : {
"username" : var.powervs_os_registration_username,
"password" : var.powervs_os_registration_password
}
}

powervs_network_services_config = {
squid = {
enable = true
squid_server_ip_port = module.standard.proxy_host_or_ip_port
no_proxy_hosts = "161.0.0.0/8,10.0.0.0/8"
}
nfs = {
enable = true
nfs_server_path = module.standard.nfs_host_or_ip_path
nfs_client_path = var.nfs_server_config.mount_path
opts = module.standard.network_services_config.nfs.opts
fstype = module.standard.network_services_config.nfs.fstype
}
dns = {
enable = true
dns_server_ip = module.standard.dns_host_or_ip
}
ntp = {
enable = module.standard.ntp_host_or_ip != "" ? true : false
ntp_server_ip = module.standard.ntp_host_or_ip
}
}
}
Loading