diff --git a/.secrets.baseline b/.secrets.baseline index 7d0f95c5..c8f1e4c4 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2024-12-06T13:41:59Z", + "generated_at": "2024-12-17T18:27:59Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -77,6 +77,26 @@ } ], "results": { + "modules/ansible/templates-ansible/configure-monitoring-sap/ansible_configure_monitoring.sh.tftpl": [ + { + "hashed_secret": "3e4bdbe0b80e63c22b178576e906810777387b50", + "is_secret": false, + "is_verified": false, + "line_number": 10, + "type": "Secret Keyword", + "verified_result": null + } + ], + "modules/ansible/templates-ansible/configure-monitoring-sap/playbook-configure-monitoring-sap.yml.tftpl": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 53, + "type": "Secret Keyword", + "verified_result": null + } + ], "modules/pi-sap-system-type1/README.md": [ { "hashed_secret": "2254481e1661d8f017a712b0d1ad9a14fd9460a3", diff --git a/ibm_catalog.json b/ibm_catalog.json index 6294c92c..b7f6cd55 100755 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -352,7 +352,7 @@ { "diagram": { "caption": "Full SAP environment provisioned on a 'Power Virtual Server with VPC landing zone'", - "url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-sap/main/reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.svg", + "url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-sap/refs/tags/v3.4.0/reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.svg", "type": "image/svg+xml" }, "description": "'SAP ready PowerVS' variation of 'Power Virtual Server for SAP HANA' creates a basic and expandable SAP system landscape builds on the foundation of the 'Power Virtual Server with VPC landing zone'. PowerVS instances for SAP HANA, SAP NetWeaver and optionally for shared SAP files are deployed and preconfigured for SAP installation.\n\nServices such as DNS, NTP and NFS running in VPC and provided by 'Power Virtual Server with VPC landing zone' are leveraged.\n\nThe resulting SAP landscape leverages the services such as Activity Tracker, Cloud Object Storage, Key Management and the network connectivity configuration provided by 'Power Virtual Server with VPC landing zone'." @@ -599,6 +599,15 @@ "type": "json_editor" } }, + { + "key": "sap_monitoring_vars", + "required": true, + "custom_config": { + "grouping": "deployment", + "original_grouping": "deployment", + "type": "json_editor" + } + }, { "key": "sap_domain", "required": true @@ -692,6 +701,9 @@ }, { "key": "sap_solution_vars" + }, + { + "key": "sap_monitoring_vars" } ], "iam_permissions": [ @@ -739,7 +751,7 @@ { "diagram": { "caption": "Full SAP S/4HANA or BW/4HANA environment provisioned on a 'Power Virtual Server with VPC landing zone'", - "url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-sap/main/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.svg", + "url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-sap/refs/tags/v3.4.0/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.svg", "type": "image/svg+xml" }, "description": "'SAP S/4HANA or BW/4HANA' variation of 'Power Virtual Server for SAP HANA' creates a basic and expandable SAP system landscape builds on the foundation of 'Power Virtual Server with VPC landing zone'. PowerVS instances for SAP HANA, SAP NetWeaver and optionally for shared SAP files are deployed and preconfigured for SAP installation. S/4HANA or BW/4HANA solution is installed based on selected version. \n\nServices such as DNS, NTP and NFS running in VPC and provided by 'Power Virtual Server with VPC landing zone' are leveraged.\n\nThe resulting SAP landscape leverages the services such as Activity Tracker, Cloud Object Storage, Key Management and the network connectivity configuration provided by the 'Power Virtual Server with VPC landing zone'." diff --git a/modules/ansible/main.tf b/modules/ansible/main.tf index cbbae467..cf2937f4 100644 --- a/modules/ansible/main.tf +++ b/modules/ansible/main.tf @@ -9,6 +9,7 @@ locals { dst_playbook_file_path = "${local.dst_files_dir}/${var.dst_playbook_file_name}" src_inventory_tftpl_path = "${local.src_ansible_templates_dir}/${var.src_inventory_template_name}" dst_inventory_file_path = "${local.dst_files_dir}/${var.dst_inventory_file_name}" + ibmcloud_api_key = var.ibmcloud_api_key == null ? "" : nonsensitive(var.ibmcloud_api_key) } @@ -202,7 +203,7 @@ resource "terraform_data" "execute_playbooks_with_vault" { provisioner "remote-exec" { inline = [ "chmod +x ${local.dst_script_file_path}", - local.dst_script_file_path, + "export IBMCLOUD_API_KEY=${local.ibmcloud_api_key} && ${local.dst_script_file_path}", ] } diff --git a/modules/ansible/templates-ansible/configure-monitoring-sap/ansible_configure_monitoring.sh.tftpl b/modules/ansible/templates-ansible/configure-monitoring-sap/ansible_configure_monitoring.sh.tftpl new file mode 100644 index 00000000..890d3b3a --- /dev/null +++ b/modules/ansible/templates-ansible/configure-monitoring-sap/ansible_configure_monitoring.sh.tftpl @@ -0,0 +1,26 @@ +#!/bin/bash + +### Using input variables from terraform +ansible_playbook=${ansible_playbook_file} +ansible_log_path=${ansible_log_path} +ansible_inventory=${ansible_inventory} +ansible_private_key_file=${ansible_private_key_file} + +# shell to get the ibmcloud api token +ibmcloud_auth_response=$(curl -X POST 'https://iam.cloud.ibm.com/identity/token' -H 'Content-Type: application/x-www-form-urlencoded' -d "apikey=$IBMCLOUD_API_KEY&grant_type=urn:ibm:params:oauth:grant-type:apikey") +ibmcloud_iam_token=$(echo "$ibmcloud_auth_response" | jq -r '.access_token') + +# Create ansible.cfg file +ansible_playbook_name=$(basename $${ansible_playbook}) +echo -e "[defaults]\nhost_key_checking=False" >ansible.cfg +export ANSIBLE_LOG_PATH=$${ansible_log_path}/$${ansible_playbook_name}.$(date "+%Y.%m.%d-%H.%M.%S").log +export ANSIBLE_PRIVATE_KEY_FILE=$${ansible_private_key_file} + +#Execute ansible playbook +unbuffer ansible-playbook -i $${ansible_inventory} $${ansible_playbook} --extra-vars ibmcloud_iam_token=$${ibmcloud_iam_token} --vault-password-file password_file +if [ $? -ne 0 ]; then + rm -rf $${ansible_private_key_file} + exit 1 +fi +echo \"Playbook command successful\" +rm -rf $${ansible_private_key_file} diff --git a/modules/ansible/templates-ansible/configure-monitoring-sap/playbook-configure-monitoring-sap.yml.tftpl b/modules/ansible/templates-ansible/configure-monitoring-sap/playbook-configure-monitoring-sap.yml.tftpl new file mode 100644 index 00000000..3e62ab09 --- /dev/null +++ b/modules/ansible/templates-ansible/configure-monitoring-sap/playbook-configure-monitoring-sap.yml.tftpl @@ -0,0 +1,57 @@ +# ------------------------------------------------------------------------ +# This playbook uses the ibm.power_linux_sap collection. This collection is +# available on ansible galaxy +# https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/ and can +# be installed using 'ansible-galaxy collection install ibm.power_linux_sap' +# ------------------------------------------------------------------------ + +--- +- name: SAP monitoring configuration + hosts: all + become: true + vars: + + ## variable group: monitoring meta parameters + sap_monitoring_action: '${sap_monitoring_action}' + config_override: '${config_override}' + sap_monitoring_nr: '${sap_monitoring_nr}' + sap_monitoring_solution_name: '${sap_monitoring_solution_name}' + sap_tools_directory: '${sap_tools_directory}' + + ## variable group: hana parameters + sap_hana_ip: '${sap_hana_ip}' + sap_hana_http_port: '${sap_hana_http_port}' + sap_hana_sql_systemdb_port: '${sap_hana_sql_systemdb_port}' + sap_hana_sql_systemdb_user: '${sap_hana_sql_systemdb_user}' + sap_hana_sql_systemdb_password: '${sap_hana_sql_systemdb_password}' + + ## variable group: application server parameters + sap_ascs_ip: '${sap_ascs_ip}' + sap_ascs_http_port: '${sap_ascs_http_port}' + sap_app_server: ${sap_app_server} + + ## variable group: IBM cloud parameters + ibmcloud_monitoring_instance_url: '${ibmcloud_monitoring_instance_url}' + ibmcloud_monitoring_request_credential_url: '${ibmcloud_monitoring_request_credential_url}' + ibmcloud_monitoring_instance_guid: '${ibmcloud_monitoring_instance_guid}' + + tasks: + # use token to get the monitoring auth cred + - name: Obtain IBM Cloud IAM token + ansible.builtin.uri: + url: "{{ ibmcloud_monitoring_request_credential_url }}" + method: GET + headers: + Content-Type: application/json + IBMInstanceID: "{{ ibmcloud_monitoring_instance_guid }}" + Authorization: "Bearer {{ ibmcloud_iam_token }}" + return_content: yes + register: response + + - name: Set fact for IBM Cloud Monitoring authorization credentials + ansible.builtin.set_fact: + ibmcloud_monitoring_authorization_credentials: "{{ response.json.token.key }}" + + - name: Execute monitoring role for SAP + ansible.builtin.include_role: + name: ibm.power_linux_sap.monitoring_sap diff --git a/modules/ansible/templates-ansible/monitoring-inventory.tftpl b/modules/ansible/templates-ansible/monitoring-inventory.tftpl new file mode 100644 index 00000000..e00f5b34 --- /dev/null +++ b/modules/ansible/templates-ansible/monitoring-inventory.tftpl @@ -0,0 +1 @@ +${monitoring_host_ip} diff --git a/modules/ansible/templates-ansible/s4hanab4hana-solution/playbook-sap-swpm-install.yml.tftpl b/modules/ansible/templates-ansible/s4hanab4hana-solution/playbook-sap-swpm-install.yml.tftpl index d1fadc7f..3c2fafc2 100644 --- a/modules/ansible/templates-ansible/s4hanab4hana-solution/playbook-sap-swpm-install.yml.tftpl +++ b/modules/ansible/templates-ansible/s4hanab4hana-solution/playbook-sap-swpm-install.yml.tftpl @@ -78,3 +78,20 @@ - name: SAP SWPM Post Install - Enforce Connection Info in hdbuserstore ansible.builtin.shell: "runuser -l {{sap_swpm_sid|lower}}adm -c 'hdbuserstore SET DEFAULT {{ sap_swpm_db_host }}:3{{ sap_swpm_db_instance_nr }}15 {{ sap_swpm_db_schema_abap }} '{{ sap_swpm_db_system_password }}" + + - name: Update the service/protectedwebmethods line in the file DEFAULT.PFL profile + ansible.builtin.lineinfile: + path: /usr/sap/{{ sap_swpm_sid }}/SYS/profile/DEFAULT.PFL + regexp: '^service/protectedwebmethods =' + line: 'service/protectedwebmethods = ${sap_swpm_service_protectedwebmethods}' + backup: yes + + - name: Restart ASCS instance for service/protectedwebmethods to take effect + ansible.builtin.shell: "runuser -l {{sap_swpm_sid|lower}}adm -c 'sapcontrol -nr {{ sap_swpm_ascs_instance_nr }} -function RestartService'" + + - name: Pause for 30 seconds + ansible.builtin.pause: + seconds: 30 + + - name: Restart PAS instance for service/protectedwebmethods to take effect + ansible.builtin.shell: "runuser -l {{sap_swpm_sid|lower}}adm -c 'sapcontrol -nr {{ sap_swpm_pas_instance_nr }} -function RestartService'" diff --git a/modules/ansible/variables.tf b/modules/ansible/variables.tf index a8860fb3..5380fca1 100644 --- a/modules/ansible/variables.tf +++ b/modules/ansible/variables.tf @@ -65,3 +65,10 @@ variable "ansible_vault_password" { sensitive = true default = null } + +variable "ibmcloud_api_key" { + description = "IBM Cloud platform API key needed to deploy IAM enabled resources." + type = string + sensitive = true + default = null +} diff --git a/reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.md b/reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.md index 6ef63b01..8f7e01b9 100644 --- a/reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.md +++ b/reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.md @@ -2,7 +2,7 @@ copyright: years: 2024 -lastupdated: "2024-12-13" +lastupdated: "2025-01-14" keywords: subcollection: deployable-reference-architectures authors: @@ -16,7 +16,7 @@ use-case: ITServiceManagement industry: Technology compliance: SAPCertified content-type: reference-architecture -version: v3.3.0 +version: v3.4.0 related_links: - title: 'SAP in IBM Cloud documentation' url: 'https://cloud.ibm.com/docs/sap' @@ -38,7 +38,7 @@ related_links: {: toc-industry="Technology"} {: toc-use-case="ITServiceManagement"} {: toc-compliance="SAPCertified"} -{: toc-version="3.3.0"} +{: toc-version="3.4.0"} The SAP-ready PowerVS variation of the Power Virtual Server for SAP HANA creates a basic and expandable SAP system landscape. The variation builds on the foundation of the VPC landing zone and Power Virtual Server with VPC landing zone. PowerVS instances for SAP HANA, SAP NetWeaver, and optionally for shared SAP files are deployed and preconfigured for SAP installation. diff --git a/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.md b/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.md index d537b4a4..2e731fc3 100644 --- a/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.md +++ b/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.md @@ -2,7 +2,7 @@ copyright: years: 2024 -lastupdated: "2024-12-13" +lastupdated: "2025-01-14" keywords: subcollection: deployable-reference-architectures authors: @@ -16,7 +16,7 @@ use-case: ITServiceManagement industry: Technology compliance: SAPCertified content-type: reference-architecture -version: v3.3.0 +version: v3.4.0 related_links: - title: 'SAP in IBM Cloud documentation' url: 'https://cloud.ibm.com/docs/sap' @@ -38,7 +38,7 @@ related_links: {: toc-industry="Technology"} {: toc-use-case="ITServiceManagement"} {: toc-compliance="SAPCertified"} -{: toc-version="3.3.0"} +{: toc-version="3.4.0"} 'SAP S/4HANA or BW/4HANA' variation of 'Power Virtual Server for SAP HANA' creates a basic and expandable SAP system landscape built on the foundation of 'Power Virtual Server with VPC landing zone'. PowerVS instances for SAP HANA, SAP NetWeaver, and optionally for shared SAP files are deployed and preconfigured for SAP installation. The S/4HANA or BW/4HANA solution is installed based on the selected version. diff --git a/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.svg b/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.svg index 73503d00..6b790f09 100644 --- a/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.svg +++ b/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.svg @@ -1,4 +1,4 @@ -
Consumer
Consumer
UserInternet
IBM Cloud
IBM Cloud
Cloud Services
Cloud Services
Edge VPC Flow Log CollectorSecretsManagerObject  StorageInstallation filesObject  StorageActivity trackerActivity TrackerAcitivity Tracker Event RoutingKey Protect Monitoring
Services Resource Group
Services Resource Group
Zone 1
Zone 1
TransitGateway
PowerVS Resource Group
PowerVS Resource Group
Secure PowerVS Workspace
Secure PowerVS Workspace
SSH Public KeyCatalog Stock Images
10.51.0.0/24: Management Subnet
10.51.0.0/24: Management Subnet
10.52.0.0/24: Backup Subnet
10.52.0.0/24: Backup Subnet
Power Virtual Server Instance : Secure File Share(Optional)
Power Virtual Server Instance...
CustomInstanceBlock Storagesveth: Management Networkveth: Backup Network
10.53.0.0/24: SAP Subnet
10.53.0.0/24: SAP Subnet
Power Virtual Server Instance :
SAP HANA
Power Virtual Server Instance...
HANAInstanceBlock Storagesveth: Management Networkveth: Backup NetworkHANA Database
Power Virtual Server Instance :
SAP NetWeaver
Power Virtual Server Instance...
NetWeaverInstanceBlock Storagesveth: Management Networkveth: Backup Networkveth: SAP Network
ASCS

PAS
ASCS...
veth: SAP Network
Edge Resource Group
Edge Resource Group
10.30.30.0/24
VPE Subnet
10.30.30.0/24:...
COS VPE
VPE SG
VPE SG
Edge VPC (Default ACL)
Edge VPC (Default ACL)
Management SG
Management SG
10.30.20.0/24
Mgmt VSI Subnet
10.30.20.0/24:...
Virtual Server
Virtual Server
FloatingIPBastionHost
Default SG
Default SG
10.30.10.0/24
VPN Subnet
10.30.10.0/24:...
Client to site VPN server
Network-services SG
Network-services SG
10.30.40.0/24: Edge VSI Subnet
10.30.40.0/24: Edge VSI Subnet
Virtual Server
Virtual Server
Proxy ServerDNSForwarderNTP ForwarderAnsible Node
PublicGatewayApplicationLoadBalancerFileStorage
Virtual Server
Virtual Server
Monitoring Host
Text is not SVG - cannot display
\ No newline at end of file +
Consumer
Consumer
UserInternet
IBM Cloud
IBM Cloud
Cloud Services
Cloud Services
Edge VPC Flow Log CollectorSecretsManagerObject  StorageInstallation filesObject  StorageActivity trackerActivity TrackerAcitivity Tracker Event RoutingKey Protect Monitoring
Services Resource Group
Services Resource Group
Zone 1
Zone 1
TransitGateway
PowerVS Resource Group
PowerVS Resource Group
Secure PowerVS Workspace
Secure PowerVS Workspace
SSH Public KeyCatalog Stock Images
10.51.0.0/24: Management Subnet
10.51.0.0/24: Management Subnet
10.52.0.0/24: Backup Subnet
10.52.0.0/24: Backup Subnet
Power Virtual Server Instance : Secure File Share(Optional)
Power Virtual Server Instance...
CustomInstanceBlock Storagesveth: Management Networkveth: Backup Network
10.53.0.0/24: SAP Subnet
10.53.0.0/24: SAP Subnet
Power Virtual Server Instance :
SAP HANA
Power Virtual Server Instance...
HANAInstanceBlock Storagesveth: Management Networkveth: Backup NetworkHANA Database
Power Virtual Server Instance :
SAP NetWeaver
Power Virtual Server Instance...
NetWeaverInstanceBlock Storagesveth: Management Networkveth: Backup Networkveth: SAP Network
ASCS

PAS
ASCS...
veth: SAP Network
Edge Resource Group
Edge Resource Group
10.30.30.0/24
VPE Subnet
10.30.30.0/24:...
COS VPE
VPE SG
VPE SG
Edge VPC (Default ACL)
Edge VPC (Default ACL)
Management SG
Management SG
10.30.20.0/24
Mgmt VSI Subnet
10.30.20.0/24:...
Virtual Server
Virtual Server
FloatingIPBastionHost
Default SG
Default SG
10.30.10.0/24
VPN Subnet
10.30.10.0/24:...
Client to site VPN server
Network-services SG
Network-services SG
10.30.40.0/24: Edge VSI Subnet
10.30.40.0/24: Edge VSI Subnet
Virtual Server
Virtual Server
Proxy ServerDNSForwarderNTP ForwarderAnsible NodePublicGatewayApplicationLoadBalancerFileStorage
Virtual Server
Virtual Server
Monitoring Host
Text is not SVG - cannot display
\ No newline at end of file diff --git a/solutions/ibm-catalog/sap-ready-to-go/README.md b/solutions/ibm-catalog/sap-ready-to-go/README.md index 23571591..f6845858 100644 --- a/solutions/ibm-catalog/sap-ready-to-go/README.md +++ b/solutions/ibm-catalog/sap-ready-to-go/README.md @@ -75,7 +75,7 @@ | [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. | `number` | `1` | no | | [powervs\_netweaver\_instance\_name](#input\_powervs\_netweaver\_instance\_name) | PowerVS SAP NetWeaver instance hostname (non FQDN). Will get the form of --. Max length of final hostname must be <= 13 characters. | `string` | `"nw"` | no | -| [powervs\_netweaver\_instance\_storage\_config](#input\_powervs\_netweaver\_instance\_storage\_config) | File systems to be created and attached to PowerVS SAP NetWeaver 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. Do not specify volume for 'sapmnt' as this will be created internally if 'powervs\_create\_separate\_sharefs\_instance' is false, else 'sapmnt' be will mounted from sharefs instance. |
list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
}))
|
[
{
"count": "1",
"mount": "/usr/sap",
"name": "usrsap",
"size": "50",
"tier": "tier3"
}
]
| no | +| [powervs\_netweaver\_instance\_storage\_config](#input\_powervs\_netweaver\_instance\_storage\_config) | File systems to be created and attached to PowerVS SAP NetWeaver 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. Do not specify volume for 'sapmnt' as this will be created internally if 'powervs\_create\_separate\_sharefs\_instance' is false, else 'sapmnt' will be mounted from sharefs instance. |
list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
}))
|
[
{
"count": "1",
"mount": "/usr/sap",
"name": "usrsap",
"size": "50",
"tier": "tier3"
}
]
| no | | [powervs\_netweaver\_memory\_size](#input\_powervs\_netweaver\_memory\_size) | Memory size for each PowerVS SAP NetWeaver instance. | `string` | `"32"` | no | | [powervs\_sap\_network\_cidr](#input\_powervs\_sap\_network\_cidr) | Network range for dedicated SAP network. Used for communication between SAP Application servers with SAP HANA Database. E.g., '10.53.0.0/24' | `string` | `"10.53.0.0/24"` | no | | [powervs\_sharefs\_instance](#input\_powervs\_sharefs\_instance) | Share fs instance. This parameter is effective if 'powervs\_create\_separate\_sharefs\_instance' is set to true. 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({
name = string
processors = string
memory = string
proc_type = string
storage_config = list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
}))
})
|
{
"memory": "2",
"name": "share",
"proc_type": "shared",
"processors": "0.5",
"storage_config": [
{
"count": "1",
"mount": "/sapmnt",
"name": "sapmnt",
"size": "300",
"tier": "tier3"
},
{
"count": "1",
"mount": "/usr/trans",
"name": "trans",
"size": "50",
"tier": "tier3"
}
]
}
| no | diff --git a/solutions/ibm-catalog/sap-ready-to-go/variables.tf b/solutions/ibm-catalog/sap-ready-to-go/variables.tf index 4106ebd0..0c52a655 100644 --- a/solutions/ibm-catalog/sap-ready-to-go/variables.tf +++ b/solutions/ibm-catalog/sap-ready-to-go/variables.tf @@ -157,7 +157,7 @@ variable "powervs_hana_instance_additional_storage_config" { } variable "powervs_netweaver_instance_storage_config" { - description = "File systems to be created and attached to PowerVS SAP NetWeaver 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. Do not specify volume for 'sapmnt' as this will be created internally if 'powervs_create_separate_sharefs_instance' is false, else 'sapmnt' be will mounted from sharefs instance." + description = "File systems to be created and attached to PowerVS SAP NetWeaver 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. Do not specify volume for 'sapmnt' as this will be created internally if 'powervs_create_separate_sharefs_instance' is false, else 'sapmnt' will be mounted from sharefs instance." type = list(object({ name = string size = string diff --git a/solutions/ibm-catalog/sap-s4hana-bw4hana/README.md b/solutions/ibm-catalog/sap-s4hana-bw4hana/README.md index 113851f0..151349ce 100644 --- a/solutions/ibm-catalog/sap-s4hana-bw4hana/README.md +++ b/solutions/ibm-catalog/sap-s4hana-bw4hana/README.md @@ -30,6 +30,7 @@ - Optionally configures a shared NFS directory on all created PowerVS instances. - Supports installation of **S/4HANA2023, S/4HANA2022, S/4HANA2021, S/4HANA2020, BW/4HANA2021**. - Supports installation using **Maintenance Planner** as well. +- Optionally installs and configures SAP Monitoring host and dashboard, if monitoring instance was deployed as part of [Power Virtual Server with VPC landing zone deployment](https://cloud.ibm.com/catalog/architecture/deploy-arch-ibm-pvs-inf-2dd486c7-b317-4aaa-907b-42671485ad96-global?catalog_query=aHR0cHM6Ly9jbG91ZC5pYm0uY29tL2NhdGFsb2c%2Fc2VhcmNoPXBvd2VyI3NlYXJjaF9yZXN1bHRz). ## Before you begin @@ -52,8 +53,8 @@ 2. The 'ibmcloud_cos_service_credentials' variable requires a value in JSON format. This can be obtained using the instructions [here](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-service-credentials) ### 2. SAP binaries required for installation and folder structure in IBM Cloud Object Storage bucket -1. All binaries for HANA database and SAP solution (S/4HANA or BW/4HANA) must be uploaded to the IBM Cloud Object Storage Instance bucket in IBM Cloud before starting this deployment. -2. For example the binaries required for S/4HANA 2023 and BW/4HANA 2021 are listed [here](./docs/s4hana23_bw4hana21_binaries.md). +1. All binaries for SAP HANA database and SAP Solution (S/4HANA or BW/4HANA) must be uploaded to the IBM Cloud Object Storage Instance bucket in IBM Cloud before starting this deployment. +2. For example the binaries required for SAP S/4HANA 2023 and SAP BW/4HANA 2021 are listed [here](./docs/s4hana23_bw4hana21_binaries.md). 3. Example folder structure : ``` S4HANA_2023 @@ -62,10 +63,13 @@ S4HANA_2023 | |_all IMDB* Files and SAPCAR files (all files similar to listed in point 2 above example file) | |_S4HANA_2023 - |_all files similar to listed in point 2 above example file - |maintenance planner stack xml file (optional) +| |_all files similar to listed in point 2 above example file +| |maintenance planner stack xml file (optional) +|_Monitoring <---(optional) + |_SAPCAR_x86_64 + |_IMDB_SAP_CLIENT_x86_64.SAR ``` -**Do not mix the HANA DB binaries with the S/4HANA or BW/4HANA solution binaries otherwise the ansible playbook execution will fail.** +**Do not mix the SAP HANA DB binaries, the S/4HANA or BW/4HANA solution binaries and Monitoring binaries otherwise the ansible playbook execution will fail.** 4. If you have a **maintenance planner stack XML** file, place it under the **same folder as S4HANA_2023** and not under the HANA DB directory. Applies to all other versions as well. Mention only the name of this file in **'cos_swpm_mp_stack_file_name'**. Leave it **empty** if you do not have this stack XML file. @@ -75,9 +79,11 @@ S4HANA_2023 `cos_bucket_name`: cos bucket name - `cos_hana_software_path`: folder path to HANA db binaries from the root of the bucket. Example from point 3, the value would be: **"s4hana2023/HANA_DB"** + `cos_hana_software_path`: folder path to SAP HANA db binaries from the root of the bucket. Example from point 3, the value would be: **"s4hana2023/HANA_DB"** - `cos_solution_software_path`: folder path to S/4HANA binaries from the root of the bucket. Example from point 3, the value would be: **"s4hana2023/S4HANA_2023"** + `cos_solution_software_path`: folder path to SAP S/4HANA binaries from the root of the bucket. Example from point 3, the value would be: **"s4hana2023/S4HANA_2023"** + + `cos_monitoring_software_path`: folder path to **x86_64** SAPCAR and IMDB_CLIENT binaries from the root of the bucket. Example from point 3, the value would be: **"s4hana2023/Monitoring"** `cos_swpm_mp_stack_file_name`: Stack XML file name. Value must be set to empty `''` if not available. If value is provided, then this file **must be present** in the same path as `'cos_solution_software_path'`. @@ -136,9 +142,11 @@ S4HANA_2023 | Name | Source | Version | |------|--------|---------| +| [ansible\_monitoring\_sap\_install\_solution](#module\_ansible\_monitoring\_sap\_install\_solution) | ../../../modules/ansible | n/a | | [ansible\_sap\_install\_hana](#module\_ansible\_sap\_install\_hana) | ../../../modules/ansible | n/a | | [ansible\_sap\_install\_solution](#module\_ansible\_sap\_install\_solution) | ../../../modules/ansible | n/a | | [ibmcloud\_cos\_download\_hana\_binaries](#module\_ibmcloud\_cos\_download\_hana\_binaries) | ../../../modules/ibmcloud-cos | n/a | +| [ibmcloud\_cos\_download\_monitoring\_binaries](#module\_ibmcloud\_cos\_download\_monitoring\_binaries) | ../../../modules/ibmcloud-cos | n/a | | [ibmcloud\_cos\_download\_netweaver\_binaries](#module\_ibmcloud\_cos\_download\_netweaver\_binaries) | ../../../modules/ibmcloud-cos | n/a | | [sap\_system](#module\_sap\_system) | ../../../modules/pi-sap-system-type1 | n/a | @@ -155,7 +163,7 @@ S4HANA_2023 |------|-------------|------|---------|:--------:| | [ansible\_vault\_password](#input\_ansible\_vault\_password) | Vault password to encrypt SAP installation parameters in the OS. 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` | n/a | yes | | [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | IBM Cloud platform API key needed to deploy IAM enabled resources. | `string` | n/a | yes | -| [ibmcloud\_cos\_configuration](#input\_ibmcloud\_cos\_configuration) | Cloud Object Storage instance containing SAP installation files that will be downloaded to NFS share. 'cos\_hana\_software\_path' must contain only binaries required for HANA DB installation. 'cos\_solution\_software\_path' must contain only binaries required for S/4HANA or BW/4HANA installation and must not contain any IMDB files. The binaries required for installation can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/blob/main/solutions/ibm-catalog/sap-s4hana-bw4hana/docs/s4hana23_bw4hana21_binaries.md) If you have an optional stack xml file (maintenance planner), place it under the 'cos\_solution\_software\_path' directory. Avoid inserting '/' at the beginning for 'cos\_hana\_software\_path' and 'cos\_solution\_software\_path'. |
object({
cos_region = string
cos_bucket_name = string
cos_hana_software_path = string
cos_solution_software_path = string
cos_swpm_mp_stack_file_name = string
})
|
{
"cos_bucket_name": "powervs-automation",
"cos_hana_software_path": "HANA_DB/rev78",
"cos_region": "eu-geo",
"cos_solution_software_path": "S4HANA_2023",
"cos_swpm_mp_stack_file_name": ""
}
| no | +| [ibmcloud\_cos\_configuration](#input\_ibmcloud\_cos\_configuration) | Cloud Object Storage instance containing SAP installation files that will be downloaded to NFS share. 'cos\_hana\_software\_path' must contain only binaries required for HANA DB installation. 'cos\_solution\_software\_path' must contain only binaries required for S/4HANA or BW/4HANA installation and must not contain any IMDB files. 'cos\_monitoring\_software\_path' is optional and must contain x86\_64 SAPCAR and SAP HANA client binaries required for configuring monitoring instance. The binaries required for installation can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/blob/main/solutions/ibm-catalog/sap-s4hana-bw4hana/docs/s4hana23_bw4hana21_binaries.md) If you have an optional stack xml file (maintenance planner), place it under the 'cos\_solution\_software\_path' directory. Avoid inserting '/' at the beginning for 'cos\_hana\_software\_path', 'cos\_solution\_software\_path' and 'cos\_monitoring\_software\_path'. |
object({
cos_region = string
cos_bucket_name = string
cos_hana_software_path = string
cos_solution_software_path = string
cos_monitoring_software_path = optional(string)
cos_swpm_mp_stack_file_name = string
})
|
{
"cos_bucket_name": "powervs-automation",
"cos_hana_software_path": "HANA_DB/rev78",
"cos_monitoring_software_path": "HANA_CLIENT/x86_64",
"cos_region": "eu-geo",
"cos_solution_software_path": "S4HANA_2023",
"cos_swpm_mp_stack_file_name": ""
}
| no | | [ibmcloud\_cos\_service\_credentials](#input\_ibmcloud\_cos\_service\_credentials) | IBM Cloud Object Storage instance service credentials to access the bucket in the instance.[json example of service credential](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-service-credentials) | `string` | n/a | yes | | [powervs\_create\_separate\_sharefs\_instance](#input\_powervs\_create\_separate\_sharefs\_instance) | Deploy separate IBM PowerVS instance as central file system share. All filesystems defined in 'powervs\_sharefs\_instance\_storage\_config' variable will be NFS exported and mounted on SAP NetWeaver PowerVS instances if enabled. Optional parameter 'powervs\_share\_fs\_instance' can be configured if enabled. | `bool` | n/a | yes | | [powervs\_default\_sap\_images](#input\_powervs\_default\_sap\_images) | Default Red Hat Linux images to use for PowerVS SAP HANA and SAP NetWeaver instances. |
object({
rhel_hana_image = string
rhel_nw_image = string
})
|
{
"rhel_hana_image": "RHEL9-SP4-SAP",
"rhel_nw_image": "RHEL9-SP4-SAP-NETWEAVER"
}
| no | @@ -165,7 +173,7 @@ S4HANA_2023 | [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` | `"ush1-4x256"` | no | | [powervs\_netweaver\_cpu\_number](#input\_powervs\_netweaver\_cpu\_number) | Number of CPUs for PowerVS SAP NetWeaver instance. | `string` | `"3"` | no | | [powervs\_netweaver\_instance\_name](#input\_powervs\_netweaver\_instance\_name) | PowerVS SAP NetWeaver instance hostname (non FQDN). Will get the form of --. Max length of final hostname must be <= 13 characters. | `string` | `"nw"` | no | -| [powervs\_netweaver\_instance\_storage\_config](#input\_powervs\_netweaver\_instance\_storage\_config) | File systems to be created and attached to PowerVS SAP NetWeaver 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. Do not specify volume for 'sapmnt' as this will be created internally if 'powervs\_create\_separate\_sharefs\_instance' is false, else 'sapmnt' will mounted from sharefs instance. |
list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
}))
|
[
{
"count": "1",
"mount": "/usr/sap",
"name": "usrsap",
"size": "50",
"tier": "tier3"
}
]
| no | +| [powervs\_netweaver\_instance\_storage\_config](#input\_powervs\_netweaver\_instance\_storage\_config) | File systems to be created and attached to PowerVS SAP NetWeaver 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. Do not specify volume for 'sapmnt' as this will be created internally if 'powervs\_create\_separate\_sharefs\_instance' is false, else 'sapmnt' will be mounted from sharefs instance. |
list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
}))
|
[
{
"count": "1",
"mount": "/usr/sap",
"name": "usrsap",
"size": "50",
"tier": "tier3"
}
]
| no | | [powervs\_netweaver\_memory\_size](#input\_powervs\_netweaver\_memory\_size) | Memory size for PowerVS SAP NetWeaver instance. | `string` | `"32"` | no | | [powervs\_sap\_network\_cidr](#input\_powervs\_sap\_network\_cidr) | Network range for dedicated SAP network. Used for communication between SAP Application servers with SAP HANA Database. E.g., '10.53.0.0/24' | `string` | `"10.53.0.0/24"` | no | | [powervs\_sharefs\_instance](#input\_powervs\_sharefs\_instance) | Share fs instance. This parameter is effective if 'powervs\_create\_separate\_sharefs\_instance' is set to true. 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({
name = string
processors = string
memory = string
proc_type = string
storage_config = list(object({
name = string
size = string
count = string
tier = string
mount = string
pool = optional(string)
}))
})
|
{
"memory": "2",
"name": "share",
"proc_type": "shared",
"processors": "0.5",
"storage_config": [
{
"count": "1",
"mount": "/sapmnt",
"name": "sapmnt",
"size": "300",
"tier": "tier3"
},
{
"count": "1",
"mount": "/usr/trans",
"name": "trans",
"size": "50",
"tier": "tier3"
}
]
}
| no | @@ -175,8 +183,9 @@ S4HANA_2023 | [sap\_domain](#input\_sap\_domain) | SAP network domain name. | `string` | `"sap.com"` | no | | [sap\_hana\_master\_password](#input\_sap\_hana\_master\_password) | SAP HANA master password. | `string` | n/a | yes | | [sap\_hana\_vars](#input\_sap\_hana\_vars) | SAP HANA SID and instance number. |
object({
sap_hana_install_sid = string
sap_hana_install_number = string
})
|
{
"sap_hana_install_number": "02",
"sap_hana_install_sid": "HDB"
}
| no | +| [sap\_monitoring\_vars](#input\_sap\_monitoring\_vars) | Configuration details for SAP monitoring dashboard. Takes effect only when a monitoring instance was deployed as part of Power Virtual Server with VPC landing zone deployment. If 'config\_override' is true, an existing configuration will be overwritten, 'sap\_monitoring\_nr' Two-digit incremental number starting with 01 up to 99. This is not a existing SAP ID, but a pure virtual number and 'sap\_monitoring\_solution\_name' is a virtual arbitrary short name to recognize SAP System. |
object({
config_override = bool
sap_monitoring_nr = string
sap_monitoring_solution_name = string
})
|
{
"config_override": false,
"sap_monitoring_nr": "01",
"sap_monitoring_solution_name": ""
}
| no | | [sap\_solution](#input\_sap\_solution) | SAP Solution to be installed on Power Virtual Server. | `string` | n/a | yes | -| [sap\_solution\_vars](#input\_sap\_solution\_vars) | SAP SID, ASCS and PAS instance numbers. |
object({
sap_swpm_sid = string
sap_swpm_ascs_instance_nr = string
sap_swpm_pas_instance_nr = string

})
|
{
"sap_swpm_ascs_instance_nr": "00",
"sap_swpm_pas_instance_nr": "01",
"sap_swpm_sid": "S4H"
}
| no | +| [sap\_solution\_vars](#input\_sap\_solution\_vars) | SAP SID, ASCS and PAS instance numbers and service/protectedwebmethods parameters. |
object({
sap_swpm_sid = string
sap_swpm_ascs_instance_nr = string
sap_swpm_pas_instance_nr = string
sap_swpm_service_protectedwebmethods = string

})
|
{
"sap_swpm_ascs_instance_nr": "00",
"sap_swpm_pas_instance_nr": "01",
"sap_swpm_service_protectedwebmethods": "SDEFAULT -GetQueueStatistic -ABAPGetWPTable -EnqGetStatistic -GetProcessList -GetEnvironment -BAPGetSystemWPTable",
"sap_swpm_sid": "S4H"
}
| no | | [sap\_swpm\_master\_password](#input\_sap\_swpm\_master\_password) | SAP SWPM master password. | `string` | n/a | yes | | [software\_download\_directory](#input\_software\_download\_directory) | Software installation binaries will be downloaded to this directory. | `string` | `"/software"` | no | | [ssh\_private\_key](#input\_ssh\_private\_key) | Private SSH key (RSA format) used to login to IBM PowerVS instances. Should match to uploaded public SSH key referenced by 'ssh\_public\_key' which was created previously. The key is temporarily stored and deleted. For more information about SSH keys, see [SSH keys](https://cloud.ibm.com/docs/vpc?topic=vpc-ssh-keys). | `string` | n/a | yes | @@ -194,5 +203,6 @@ S4HANA_2023 | [powervs\_netweaver\_instance\_management\_ip](#output\_powervs\_netweaver\_instance\_management\_ip) | Management IP of NetWeaver instance. | | [powervs\_sharefs\_instance\_ips](#output\_powervs\_sharefs\_instance\_ips) | Private IPs of the Share FS instance. | | [sap\_hana\_vars](#output\_sap\_hana\_vars) | SAP HANA system details. | +| [sap\_monitoring\_vars](#output\_sap\_monitoring\_vars) | SAP Monitoring Instance details. | | [sap\_solution\_vars](#output\_sap\_solution\_vars) | SAP NetWeaver system details. | diff --git a/solutions/ibm-catalog/sap-s4hana-bw4hana/docs/s4hana23_bw4hana21_binaries.md b/solutions/ibm-catalog/sap-s4hana-bw4hana/docs/s4hana23_bw4hana21_binaries.md index 1c74c000..f5aaf7b2 100644 --- a/solutions/ibm-catalog/sap-s4hana-bw4hana/docs/s4hana23_bw4hana21_binaries.md +++ b/solutions/ibm-catalog/sap-s4hana-bw4hana/docs/s4hana23_bw4hana21_binaries.md @@ -1,4 +1,4 @@ -| HANA rev78 Binaries | +| SAP HANA rev78 Binaries | |-----------------------------------| | IMDB_AFL20_078_0-80002045.SAR | | IMDB_CLIENT20_020_23-80002095.SAR | @@ -39,3 +39,9 @@ | 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 | diff --git a/solutions/ibm-catalog/sap-s4hana-bw4hana/locals_schematics_data.tf b/solutions/ibm-catalog/sap-s4hana-bw4hana/locals_schematics_data.tf index a43e0e3d..89ec84f3 100644 --- a/solutions/ibm-catalog/sap-s4hana-bw4hana/locals_schematics_data.tf +++ b/solutions/ibm-catalog/sap-s4hana-bw4hana/locals_schematics_data.tf @@ -18,22 +18,23 @@ data "ibm_schematics_output" "schematics_output" { } locals { - powervs_infrastructure = jsondecode(data.ibm_schematics_output.schematics_output.output_json) - - powervs_workspace_guid = local.powervs_infrastructure[0].powervs_workspace_guid.value - powervs_sshkey_name = local.powervs_infrastructure[0].powervs_ssh_public_key.value.name - powervs_images = local.powervs_infrastructure[0].powervs_images.value - powervs_networks = [local.powervs_infrastructure[0].powervs_management_subnet.value, local.powervs_infrastructure[0].powervs_backup_subnet.value] - access_host_or_ip = local.powervs_infrastructure[0].access_host_or_ip.value - proxy_host_or_ip_port = local.powervs_infrastructure[0].proxy_host_or_ip_port.value - dns_host_or_ip = local.powervs_infrastructure[0].dns_host_or_ip.value - ntp_host_or_ip = local.powervs_infrastructure[0].ntp_host_or_ip.value - nfs_host_or_ip_path = local.powervs_infrastructure[0].nfs_host_or_ip_path.value - ansible_host_or_ip = local.powervs_infrastructure[0].ansible_host_or_ip.value - network_services_config = local.powervs_infrastructure[0].network_services_config.value + powervs_infrastructure = jsondecode(data.ibm_schematics_output.schematics_output.output_json) + powervs_workspace_guid = local.powervs_infrastructure[0].powervs_workspace_guid.value + powervs_sshkey_name = local.powervs_infrastructure[0].powervs_ssh_public_key.value.name + powervs_images = local.powervs_infrastructure[0].powervs_images.value + powervs_networks = [local.powervs_infrastructure[0].powervs_management_subnet.value, local.powervs_infrastructure[0].powervs_backup_subnet.value] + access_host_or_ip = local.powervs_infrastructure[0].access_host_or_ip.value + proxy_host_or_ip_port = local.powervs_infrastructure[0].proxy_host_or_ip_port.value + dns_host_or_ip = local.powervs_infrastructure[0].dns_host_or_ip.value + ntp_host_or_ip = local.powervs_infrastructure[0].ntp_host_or_ip.value + nfs_host_or_ip_path = local.powervs_infrastructure[0].nfs_host_or_ip_path.value + ansible_host_or_ip = local.powervs_infrastructure[0].ansible_host_or_ip.value + network_services_config = local.powervs_infrastructure[0].network_services_config.value + monitoring_instance_guid = local.powervs_infrastructure[0].monitoring_instance.value.guid + monitoring_instance_location = local.powervs_infrastructure[0].monitoring_instance.value.location + monitoring_host_ip = local.powervs_infrastructure[0].monitoring_instance.value.monitoring_host_ip } - locals { powervs_sharefs_os_image = var.powervs_default_sap_images.rhel_nw_image powervs_hana_os_image = var.powervs_default_sap_images.rhel_hana_image @@ -52,4 +53,6 @@ locals { dns = { enable = local.dns_host_or_ip != "" ? true : false, dns_server_ip = local.dns_host_or_ip } ntp = { enable = local.ntp_host_or_ip != "" ? true : false, ntp_server_ip = local.ntp_host_or_ip } } + + enable_monitoring = local.monitoring_instance_guid != "" && local.monitoring_host_ip != "" && local.monitoring_instance_location != "" && var.ibmcloud_cos_configuration.cos_monitoring_software_path != "" } diff --git a/solutions/ibm-catalog/sap-s4hana-bw4hana/main.tf b/solutions/ibm-catalog/sap-s4hana-bw4hana/main.tf index b3ad2a31..d9843a19 100644 --- a/solutions/ibm-catalog/sap-s4hana-bw4hana/main.tf +++ b/solutions/ibm-catalog/sap-s4hana-bw4hana/main.tf @@ -85,6 +85,15 @@ locals { cos_dir_name = var.ibmcloud_cos_configuration.cos_solution_software_path download_dir_path = local.network_services_config.nfs.nfs_client_path } + + ibmcloud_cos_monitoring_configuration = { + cos_apikey = local.cos_apikey + cos_region = var.ibmcloud_cos_configuration.cos_region + cos_resource_instance_id = local.cos_resource_instance_id + cos_bucket_name = var.ibmcloud_cos_configuration.cos_bucket_name + cos_dir_name = var.ibmcloud_cos_configuration.cos_monitoring_software_path + download_dir_path = local.network_services_config.nfs.nfs_client_path + } } module "ibmcloud_cos_download_hana_binaries" { @@ -108,6 +117,16 @@ module "ibmcloud_cos_download_netweaver_binaries" { ibmcloud_cos_configuration = local.ibmcloud_cos_solution_configuration } +module "ibmcloud_cos_download_monitoring_binaries" { + source = "../../../modules/ibmcloud-cos" + depends_on = [module.ibmcloud_cos_download_netweaver_binaries] + count = local.enable_monitoring ? 1 : 0 + + access_host_or_ip = local.access_host_or_ip + target_server_ip = local.ansible_host_or_ip + ssh_private_key = var.ssh_private_key + ibmcloud_cos_configuration = local.ibmcloud_cos_monitoring_configuration +} ##################################################### # Ansible vars validation @@ -210,3 +229,59 @@ module "ansible_sap_install_solution" { dst_inventory_file_name = "${var.prefix}-${var.powervs_netweaver_instance_name}-instance-inventory" inventory_template_vars = { "pi_instance_management_ip" : module.sap_system.pi_netweaver_instance_management_ips } } + +#################################################### +# Ansible Install Monitoring SAP solution +##################################################### + +locals { + + ansible_monitoring_solution_playbook_vars = merge(var.sap_monitoring_vars, + { + sap_monitoring_action = "add" + sap_tools_directory = "${local.network_services_config.nfs.nfs_client_path}/${var.ibmcloud_cos_configuration.cos_monitoring_software_path}" + sap_hana_ip = module.sap_system.pi_hana_instance_management_ip + sap_hana_http_port = "5${var.sap_hana_vars.sap_hana_install_number}13" + sap_hana_sql_systemdb_port = "3${var.sap_hana_vars.sap_hana_install_number}13" + sap_hana_sql_systemdb_user = "system" + sap_hana_sql_systemdb_password = var.sap_hana_master_password + sap_ascs_ip = module.sap_system.pi_netweaver_instance_management_ips + sap_ascs_http_port = "5${var.sap_solution_vars.sap_swpm_ascs_instance_nr}13" + sap_app_server = jsonencode([ + { + sap_app_server_nr = "01" + ip = module.sap_system.pi_netweaver_instance_management_ips + port = "5${var.sap_solution_vars.sap_swpm_pas_instance_nr}13" + }] + ) + ibmcloud_monitoring_instance_url = "https://ingest.prws.private.${local.monitoring_instance_location}.monitoring.cloud.ibm.com/prometheus/remote/write" + ibmcloud_monitoring_request_credential_url = "https://${local.monitoring_instance_location}.monitoring.cloud.ibm.com/api/token" + ibmcloud_monitoring_instance_guid = local.monitoring_instance_guid + } + ) +} + + +module "ansible_monitoring_sap_install_solution" { + + source = "../../../modules/ansible" + depends_on = [module.ibmcloud_cos_download_monitoring_binaries, module.ansible_sap_install_hana, module.ansible_sap_install_solution] + count = local.enable_monitoring ? 1 : 0 + + bastion_host_ip = local.access_host_or_ip + ansible_host_or_ip = local.ansible_host_or_ip + ssh_private_key = var.ssh_private_key + ansible_vault_password = var.ansible_vault_password + configure_ansible_host = false + ibmcloud_api_key = var.ibmcloud_api_key + + src_script_template_name = "configure-monitoring-sap/ansible_configure_monitoring.sh.tftpl" + dst_script_file_name = "${var.prefix}-configure_monitoring.sh" + + src_playbook_template_name = "configure-monitoring-sap/playbook-configure-monitoring-sap.yml.tftpl" + dst_playbook_file_name = "${var.prefix}-playbook-configure-monitoring-sap.yml" + playbook_template_vars = local.ansible_monitoring_solution_playbook_vars + src_inventory_template_name = "monitoring-inventory.tftpl" + dst_inventory_file_name = "${var.prefix}-monitoring-instance-inventory" + inventory_template_vars = { "monitoring_host_ip" : local.monitoring_host_ip } +} diff --git a/solutions/ibm-catalog/sap-s4hana-bw4hana/outputs.tf b/solutions/ibm-catalog/sap-s4hana-bw4hana/outputs.tf index 3e9ba1da..1dd19c1d 100644 --- a/solutions/ibm-catalog/sap-s4hana-bw4hana/outputs.tf +++ b/solutions/ibm-catalog/sap-s4hana-bw4hana/outputs.tf @@ -47,3 +47,8 @@ output "sap_solution_vars" { description = "SAP NetWeaver system details." value = var.sap_solution_vars } + +output "sap_monitoring_vars" { + description = "SAP Monitoring Instance details." + value = merge(var.sap_monitoring_vars, local.powervs_infrastructure[0].monitoring_instance.value) +} diff --git a/solutions/ibm-catalog/sap-s4hana-bw4hana/variables.tf b/solutions/ibm-catalog/sap-s4hana-bw4hana/variables.tf index 5d82c13e..37dc0e4e 100644 --- a/solutions/ibm-catalog/sap-s4hana-bw4hana/variables.tf +++ b/solutions/ibm-catalog/sap-s4hana-bw4hana/variables.tf @@ -71,19 +71,21 @@ variable "ibmcloud_cos_service_credentials" { } variable "ibmcloud_cos_configuration" { - description = "Cloud Object Storage instance containing SAP installation files that will be downloaded to NFS share. 'cos_hana_software_path' must contain only binaries required for HANA DB installation. 'cos_solution_software_path' must contain only binaries required for S/4HANA or BW/4HANA installation and must not contain any IMDB files. The binaries required for installation can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/blob/main/solutions/ibm-catalog/sap-s4hana-bw4hana/docs/s4hana23_bw4hana21_binaries.md) If you have an optional stack xml file (maintenance planner), place it under the 'cos_solution_software_path' directory. Avoid inserting '/' at the beginning for 'cos_hana_software_path' and 'cos_solution_software_path'." + description = "Cloud Object Storage instance containing SAP installation files that will be downloaded to NFS share. 'cos_hana_software_path' must contain only binaries required for HANA DB installation. 'cos_solution_software_path' must contain only binaries required for S/4HANA or BW/4HANA installation and must not contain any IMDB files. 'cos_monitoring_software_path' is optional and must contain x86_64 SAPCAR and SAP HANA client binaries required for configuring monitoring instance. The binaries required for installation can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/blob/main/solutions/ibm-catalog/sap-s4hana-bw4hana/docs/s4hana23_bw4hana21_binaries.md) If you have an optional stack xml file (maintenance planner), place it under the 'cos_solution_software_path' directory. Avoid inserting '/' at the beginning for 'cos_hana_software_path', 'cos_solution_software_path' and 'cos_monitoring_software_path'." type = object({ - cos_region = string - cos_bucket_name = string - cos_hana_software_path = string - cos_solution_software_path = string - cos_swpm_mp_stack_file_name = string + cos_region = string + cos_bucket_name = string + cos_hana_software_path = string + cos_solution_software_path = string + cos_monitoring_software_path = optional(string) + cos_swpm_mp_stack_file_name = string }) default = { "cos_region" : "eu-geo", "cos_bucket_name" : "powervs-automation", "cos_hana_software_path" : "HANA_DB/rev78", "cos_solution_software_path" : "S4HANA_2023", + "cos_monitoring_software_path" = "HANA_CLIENT/x86_64", "cos_swpm_mp_stack_file_name" : "" } } @@ -141,17 +143,19 @@ variable "sap_swpm_master_password" { } variable "sap_solution_vars" { - description = "SAP SID, ASCS and PAS instance numbers." + description = "SAP SID, ASCS and PAS instance numbers and service/protectedwebmethods parameters." type = object({ - sap_swpm_sid = string - sap_swpm_ascs_instance_nr = string - sap_swpm_pas_instance_nr = string + sap_swpm_sid = string + sap_swpm_ascs_instance_nr = string + sap_swpm_pas_instance_nr = string + sap_swpm_service_protectedwebmethods = string }) default = { "sap_swpm_sid" : "S4H", "sap_swpm_ascs_instance_nr" : "00", - "sap_swpm_pas_instance_nr" : "01" + "sap_swpm_pas_instance_nr" : "01", + "sap_swpm_service_protectedwebmethods" : "SDEFAULT -GetQueueStatistic -ABAPGetWPTable -EnqGetStatistic -GetProcessList -GetEnvironment -BAPGetSystemWPTable" } validation { condition = var.sap_solution_vars.sap_swpm_ascs_instance_nr != var.sap_solution_vars.sap_swpm_pas_instance_nr @@ -189,7 +193,6 @@ variable "ibmcloud_api_key" { sensitive = true } - ################################################################ # # Optional Parameters @@ -236,7 +239,7 @@ variable "powervs_hana_instance_additional_storage_config" { } variable "powervs_netweaver_instance_storage_config" { - description = "File systems to be created and attached to PowerVS SAP NetWeaver 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. Do not specify volume for 'sapmnt' as this will be created internally if 'powervs_create_separate_sharefs_instance' is false, else 'sapmnt' will mounted from sharefs instance." + description = "File systems to be created and attached to PowerVS SAP NetWeaver 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. Do not specify volume for 'sapmnt' as this will be created internally if 'powervs_create_separate_sharefs_instance' is false, else 'sapmnt' will be mounted from sharefs instance." type = list(object({ name = string size = string @@ -305,3 +308,21 @@ variable "powervs_default_sap_images" { "rhel_nw_image" : "RHEL9-SP4-SAP-NETWEAVER" } } + +variable "sap_monitoring_vars" { + description = "Configuration details for SAP monitoring dashboard. Takes effect only when a monitoring instance was deployed as part of Power Virtual Server with VPC landing zone deployment. If 'config_override' is true, an existing configuration will be overwritten, 'sap_monitoring_nr' Two-digit incremental number starting with 01 up to 99. This is not a existing SAP ID, but a pure virtual number and 'sap_monitoring_solution_name' is a virtual arbitrary short name to recognize SAP System." + type = object({ + config_override = bool + sap_monitoring_nr = string + sap_monitoring_solution_name = string + }) + default = { + config_override = false + sap_monitoring_nr = "01" + sap_monitoring_solution_name = "" + } + validation { + condition = (length(var.sap_monitoring_vars.sap_monitoring_nr) == 2 && tonumber(var.sap_monitoring_vars.sap_monitoring_nr) >= 0 && tonumber(var.sap_monitoring_vars.sap_monitoring_nr) <= 99) || var.sap_monitoring_vars.sap_monitoring_nr == "" + error_message = "sap_monitoring_nr should be a 2-digit number between 00 and 99. or empty" + } +}