Skip to content

Commit

Permalink
v1.2.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI User committed Mar 31, 2023
1 parent aa4ab77 commit 2b9a0ce
Show file tree
Hide file tree
Showing 54 changed files with 3,929 additions and 330 deletions.
67 changes: 34 additions & 33 deletions README.md

Large diffs are not rendered by default.

29 changes: 24 additions & 5 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,21 @@ SAP HANA installation media used for this deployment is the default one for **SA
SAP S/4HANA installation media used for this deployment is the default one for **SAP S/4HANA 2020** available at SAP Support Portal under *INSTALLATION AND UPGRADE* area and it has to be provided manually in the input parameter file.

## VSI Configuration
The VSIs are deployed with one of the following Operating Systems for DB server: Suse Linux Enterprise Server 15 SP 3 for SAP HANA (amd64), Red Hat Enterprise Linux 8.4 for SAP HANA (amd64) or Red Hat Enterprise Linux 7.6 for SAP HANA (amd64) and with one of the following Operating Systems for APP server: Suse Enterprise Linux 1 SP3 for SAP Applications (amd64), Red Hat Enterprise Linux 8.4 for SAP Applications (amd64), Red Hat Enterprise Linux 7.6 for SAP Applications (amd64). The SSH keys are configured to allow root user access. The following storage volumes are creating during the provisioning:
The VSIs are deployed with one of the following Operating Systems for DB server: Suse Linux Enterprise Server 15 SP 3 for SAP HANA (amd64), Red Hat Enterprise Linux 8.4 for SAP HANA (amd64) or Red Hat Enterprise Linux 7.6 for SAP HANA (amd64) and with one of the following Operating Systems for APP server: Suse Enterprise Linux 15 SP3 for SAP Applications (amd64), Red Hat Enterprise Linux 8.4 for SAP Applications (amd64), Red Hat Enterprise Linux 7.6 for SAP Applications (amd64). The SSH keys are configured to allow root user access. The following storage volumes are creating during the provisioning:

HANA DB VSI Disks:
- 3 x 500 GB disks with 10 IOPS / GB - DATA
- the disk sizes depend on the selected profile, according to [Intel Virtual Server certified profiles on VPC infrastructure for SAP HANA](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-intel-vs-vpc) - Last updated 2022-01-28

Note: LVM will be used for **`/hana/data`**, **`hana/log`**, **`/hana/shared`** and **`/usr/sap`**, for all storage profiles, excepting **`vx2d-44x616`** and **`vx2d-88x1232`** profiles, where **`/hana/data`** and **`/hana/shared`** won't be manged by LVM, according to [Intel Virtual Server certified profiles on VPC infrastructure for SAP HANA](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-intel-vs-vpc#vx2d-16x224) - Last updated 2022-01-28 and to [Storage design considerations](https://cloud.ibm.com/docs/sap?topic=sap-storage-design-considerations#hana-iaas-mx2-16x128-32x256-configure) - Last updated 2022-05-19

For example, in case of deploying a HANA VM, using the default value for VSI profile `mx2-16x128`, the automation will execute the following storage setup:
- 3 volumes x 500 GB each for `<sid>_hana_vg` volume group
- the volume group will contain the following logical volumes (created with three stripes):
- `<sid>_hana_data_lv` - size 988 GB
- `<sid>_hana_log_lv` - size 256 GB
- `<sid>_hana_shared` - size 256 GB
- 1 volume x 50 GB for `/usr/sap` (volume group: `<sid>_usr_sap_vg`, logical volume: `<sid>_usr_sap_lv`)
- 1 volume x 10 GB for a 2 GB SWAP logical volume (volume group: `<sid>_swap_vg`, logical volume: `<sid>_swap_lv`)

SAP APPs VSI Disks:
- 1x 40 GB disk with 10 IOPS / GB - SWAP
Expand Down Expand Up @@ -75,7 +86,10 @@ DB-HOSTNAME = "saps4hnmar1"
# Example: HOSTNAME = "ic4sap"

DB-PROFILE = "mx2-16x128"
# The DB VSI profile. Supported profiles for DB VSI: mx2-16x128. The list of available profiles: https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui
# The instance profile used for the HANA VSI. The list of certified profiles for HANA VSIs: https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-intel-vs-vpc
# Details about all x86 instance profiles: https://cloud.ibm.com/docs/vpc?topic=vpc-profiles).
# For more information about supported DB/OS and IBM Gen 2 Virtual Server Instances (VSI), check [SAP Note 2927211: SAP Applications on IBM Virtual Private Cloud](https://launchpad.support.sap.com/#/notes/2927211)
# Default value: "mx2-16x128"

DB-IMAGE = "ibm-redhat-8-4-amd64-sap-hana-2"
# OS image for DB VSI. Supported OS images for DB VSIs: ibm-sles-15-3-amd64-sap-hana-2, ibm-redhat-8-4-amd64-sap-hana-2, ibm-redhat-7-6-amd64-sap-hana-3.
Expand Down Expand Up @@ -111,8 +125,10 @@ SUBNET | The name of an EXISTING Subnet. The list of Subnets is available [here]
SECURITY_GROUP | The name of an EXISTING Security group. The list of Security Groups is available [here](https://cloud.ibm.com/vpc-ext/network/securityGroups).
RESOURCE_GROUP | The name of an EXISTING Resource Group for VSIs and Volumes resources. The list of Resource Groups is available [here](https://cloud.ibm.com/account/resource-groups).
[DB/APP]-HOSTNAME | The Hostname for the HANA/APP VSI. The hostname should be up to 13 characters as required by SAP.<br> For more information on rules regarding hostnames for SAP systems, check [SAP Note 611361: Hostnames of SAP ABAP Platform servers](https://launchpad.support.sap.com/#/notes/%20611361)
[DB/APP]-PROFILE | The profile used for the HANA/APP VSI. A list of profiles is available [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles).<br> For more information about supported DB/OS and IBM Gen 2 Virtual Server Instances (VSI), check [SAP Note 2927211: SAP Applications on IBM Virtual Private Cloud](https://launchpad.support.sap.com/#/notes/2927211)
[DB/APP]-IMAGE | The OS image used for the HANA/APP VSI. A list of images is available [here](https://cloud.ibm.com/docs/vpc?topic=vpc-about-images)
DB-PROFILE | The instance profile used for the HANA VSI. The list of certified profiles for HANA VSIs is available [here](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-intel-vs-vpc). <br> Details about all x86 instance profiles are available [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles). <br> For more information about supported DB/OS and IBM Gen 2 Virtual Server Instances (VSI), check [SAP Note 2927211: SAP Applications on IBM Virtual Private Cloud](https://launchpad.support.sap.com/#/notes/2927211) <br /> Default value: "mx2-16x128"
DB-IMAGE | The OS image used for HANA VSI. A list of images is available [here](https://cloud.ibm.com/docs/vpc?topic=vpc-about-images) <br> Default value: ibm-redhat-8-4-amd64-sap-hana-2
APP-PROFILE | The instance profile used for SAP Application VSI. A list of profiles is available [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) <br> For more information about supported DB/OS and IBM Gen 2 Virtual Server Instances (VSI), check [SAP Note 2927211: SAP Applications on IBM Virtual Private Cloud](https://launchpad.support.sap.com/#/notes/2927211) <br /> Default value: "bx2-4x16"
APP-IMAGE | The OS image used for SAP Application VSI. A list of images is available [here](https://cloud.ibm.com/docs/vpc?topic=vpc-about-images).<br /> Default value: ibm-redhat-8-4-amd64-sap-applications-2

Edit your SAP system configuration variables that will be passed to the ansible automated deployment:

Expand Down Expand Up @@ -255,6 +271,9 @@ terraform destroy
```


The Terraform version used for deployment should be >= 1.3.6.
Note: The deployment was tested with Terraform 1.3.6

### Related links:

- [See how to create a BASTION/STORAGE VSI for SAP in IBM Schematics](https://github.com/IBM-Cloud/sap-bastion-setup)
Expand Down
10 changes: 0 additions & 10 deletions cli/ansible/roles/saphanareq/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
---
#Disk size config
hana_disk_size: "500.00 GB"

#Logical volume size config
swap_lv_size: "2g"
hana_data_lv_size: "700g"
hana_log_lv_size: "250g"
hana_shared_lv_size: "250g"
sap_lv_size: "50g"
...
64 changes: 64 additions & 0 deletions cli/ansible/roles/saphanareq/filter_plugins/filesystemdata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/python

class FilterModule(object):
'''Data related to filesystems for HANA VM'''

def filters(self):
return {
'filesystemdata': self.filesystemdata
}

def filesystemdata(self, data_list):
final_list = []
data_map = data_list[0]
sid = data_list[1]
for k, v in data_map.items():
key_to_check = 'lvm'
if key_to_check in v:
for m in v['lvm']['lv']:
temp_list = []
fs_device = "/dev/" + sid + "_" + v['lvm']['vg']['vg_name'] + "/" + sid + "_" + m['lv_name']
mp = None
fs_options = ""
label = ""
mount_source = fs_device
if m['lv_name'] == 'hana_data_lv':
label = "HANA_DATA"
elif m['lv_name'] == 'hana_log_lv':
label = "HANA_LOG"
elif m['lv_name'] == 'hana_shared_lv':
label = "HANA_SHARED"
else:
label = ""
if label != "":
fs_options = "-L " + label
mount_source = "LABEL=" + label
if "mount_point" in m.keys():
mp = m['mount_point']
fs_info = { "fs_device": fs_device, "fs_type": m['fs_type'], "mp": mp, "fs_options": fs_options, "mount_source": mount_source }
temp_list.append(fs_info)
final_list.append(temp_list)
else:
temp_list = []
fs_device = v['device'][0] + "1"
fs_options = ""
label = ""
mount_source = fs_device
mp = None
if "mount_point" in v.keys():
mp = v['mount_point']
if mp == "/hana/data":
label = "HANA_DATA"
elif mp == "/hana/log":
label = "HANA_LOG"
elif mp == "/hana/shared":
label = "HANA_SHARED"
else:
label = ""
if label != "":
fs_options = "-L " + label
mount_source = "LABEL=" + label
fs_info = { "fs_device": fs_device, "fs_type": v['fs_type'], "mp": mp, "fs_options": fs_options, "mount_source": mount_source }
temp_list.append(fs_info)
final_list.append(temp_list)
return final_list
45 changes: 45 additions & 0 deletions cli/ansible/roles/saphanareq/filter_plugins/lvmdata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/python

class FilterModule(object):
'''Data related to LVM for HANA VM'''

def filters(self):
return {
'lvmdata': self.lvmdata
}

def lvmdata(self, data_map):
final_list = []
for k, v in data_map.items():
key_to_check = 'lvm'
if key_to_check in v:
# In case the sum of the sizes of all LVs from the VG is lower than VG size
# and we don't want 'hana_data_lv' to be created as '100%FREE'
lv100free = True
total_lv_size = 0
vgsize = 0
for t in v['disk_size']:
vgsize += int(t)
lvminfo = v['lvm']['lv']
for n in lvminfo:
total_lv_size += int(n['lv_size'])
if vgsize > total_lv_size:
lv100free = False
for m in v['lvm']['lv']:
temp_list = []
lv_size = ""
# For HANA VMs, SWAP size is always 2 GB
# The volume group 'hana_vg' will always contain logical volume 'hana_data_lv'
if k == 'swap' or (k == 'hana_vg' and m['lv_name'] != 'hana_data_lv') or (lv100free == False and k == 'hana_vg' and m['lv_name'] == 'hana_data_lv'):
lv_size = m['lv_size'] + "G"
else:
lv_size = '100%FREE'
lvm_info = { "vg_name": v['lvm']['vg']['vg_name'], "lv_name": m['lv_name'], "lv_size": lv_size, "lv_stripes": m['lv_stripes'], "lv_stripe_size": m['lv_stripe_size'] }
temp_list.append(lvm_info)
final_list.append(temp_list)
for i in range(len(final_list)):
# LVM data 'hana_data_lv' should be last in array (in case it will be created in 'hana_vg') as we want 100%FREE as size
if final_list[i][0]['vg_name'] == 'hana_vg' and final_list[i][0]['lv_name'] == 'hana_data_lv':
final_list.append(final_list.pop(i))
break
return final_list
17 changes: 17 additions & 0 deletions cli/ansible/roles/saphanareq/filter_plugins/partitionlist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/python

class FilterModule(object):
'''List of devices for partitions on HANA VM'''

def filters(self):
return {
'partitionlist': self.partitionlist
}

def partitionlist(self, data_map):
final_list = []
for k, v in data_map.items():
key_to_check = 'lvm'
if key_to_check not in v:
final_list.append(v['device'])
return final_list
100 changes: 100 additions & 0 deletions cli/ansible/roles/saphanareq/filter_plugins/storagedetails.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/usr/bin/python

import decimal
import re

class FilterModule(object):
'''Storage details from profile containing also the devices for HANA VM'''

def filters(self):
return {
'storagedetails': self.storagedetails
}

def storagedetails(self, data_list):
# data_list[0] - json file data
# data_list[1] - ansible_devices data
# data_list[2] - selected storage profile
json_file_data = data_list[0]
ansible_devices_data = data_list[1]
hana_profile = data_list[2]

storage_profile_info = json_file_data['profiles'][hana_profile]['storage']

# Create a sorted list with all disks device keys available on the VM
pattern = 'dm-'
all_disk_device_keys = sorted([item for item in ansible_devices_data if re.match(pattern, item) == None])

# Get the number of the disks to be configured
necessary_disks_number = ""
count_disks = 0
for k, v in storage_profile_info.items():
count_disks += int(v['disk_count'])
necessary_disks_number = str(count_disks)

# Get a list with the device keys for disks to be configured
N = int(necessary_disks_number)
disk_device_keys = all_disk_device_keys[-N:]

# Get a list with the provisioned disk sizes corresponding to the device keys for disks to be configured
size_provisioned_disks = []
for m, n in ansible_devices_data.items():
if m in disk_device_keys and 'KB' not in n['size']:
size_provisioned_disks.append(n['size'])

# Sort the list with provisioned disk sizes
size_provisioned_disks_sorted = sorted(size_provisioned_disks)

# Get a list of disk sizes corresponding to the selected profile
size_profile_disks = []
for k, v in storage_profile_info.items():
display_size = ""
if int(v['disk_size']) >= 1024:
rounded_val = round(decimal.Decimal(int(v['disk_size']) / 1024), 2)
no_decimal_places = abs(rounded_val.as_tuple().exponent)
if no_decimal_places == 0:
display_size = str(rounded_val) + ".00 TB"
elif no_decimal_places == 1:
display_size = str(rounded_val) + "0 TB"
elif no_decimal_places == 2:
display_size = str(rounded_val) + " TB"
else:
display_size = v['disk_size'] + ".00 GB"
for t in range(int(v['disk_count'])):
size_profile_disks.append(display_size)

# Sort the list with disk sizes from profile
size_profile_disks_sorted = sorted(size_profile_disks)

# Get the missing disks
if (len(list(set(size_profile_disks_sorted) - set(size_provisioned_disks_sorted))) > 0) or (len(size_profile_disks_sorted) != len(size_provisioned_disks_sorted)):
msg = "The disks required for profile '" + hana_profile + "' are missing. The following disks sizes are required: " + str(size_profile_disks_sorted)[1:-1] + ". The following disk sizes were deployed: " + str(size_provisioned_disks_sorted)[1:-1]
return msg
else:
temp_list = []
for k, v in storage_profile_info.items():
new_list1 = []
new_list2 = []
display_size = ""
if int(v['disk_size']) >= 1024:
rounded_val = round(decimal.Decimal(int(v['disk_size']) / 1024), 2)
no_decimal_places = abs(rounded_val.as_tuple().exponent)
if no_decimal_places == 0:
display_size = str(rounded_val) + ".00 TB"
elif no_decimal_places == 1:
display_size = str(rounded_val) + "0 TB"
elif no_decimal_places == 2:
display_size = str(rounded_val) + " TB"
else:
display_size = v['disk_size'] + ".00 GB"
for t in range(int(v['disk_count'])):
new_list1.append(v['disk_size'])
for m, n in ansible_devices_data.items():
if (n['size'] == display_size) and (m in disk_device_keys) and (m not in temp_list):
new_list2.append("/dev/" + m)
temp_list.append(m)
break
storage_profile_info[k]['disk_size'] = new_list1
storage_profile_info[k]['device'] = new_list2
final_storage = storage_profile_info
return final_storage
Loading

0 comments on commit 2b9a0ce

Please sign in to comment.