Skip to content

Commit

Permalink
v1.7.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI User committed Sep 20, 2024
1 parent a1d2bf8 commit 68d44ce
Show file tree
Hide file tree
Showing 51 changed files with 3,391 additions and 2,082 deletions.
236 changes: 117 additions & 119 deletions README.md

Large diffs are not rendered by default.

38 changes: 0 additions & 38 deletions ansible/roles/s4appfs/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
---
#Disk size config
sap_disk_size: "128.00 GB"
swap_disk_size: "40.00 GB"

#Logical volume size config
# swap_lv_size: "30g"
usrsap_lv_size: "5g"
sap_lv_size: "20g"
sapmnt_lv_size: "20g"
saptrans_lv_size: "50g"

swap_lv:
- size: 38
ram_min: 32
ram_max: 63
- size: 38
ram_min: 64
ram_max: 127
- size: 38
ram_min: 128
ram_max: 255
- size: 38
ram_min: 256
ram_max: 511
- size: 38
ram_min: 512
ram_max: 1023
- size: 224
ram_min: 1024
ram_max: 2047
- size: 38
ram_min: 2048
ram_max: 4095
- size: 288
ram_min: 4096
ram_max: 8191
- size: 38
ram_min: 8192
ram_max: 20000
...
56 changes: 56 additions & 0 deletions ansible/roles/s4appfs/filter_plugins/filesystemdata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/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 = ""
mount_opt = "defaults"
mount_source = fs_device
if "label" in m.keys():
fs_options = "-L " + m['label']
mount_source = "LABEL=" + m['label']
if "fs_create_options" in m.keys():
fs_options = fs_options + " " + m['fs_create_options']
if "mount_point" in m.keys():
mp = m['mount_point']
if "mount_options" in m.keys():
mount_opt = m['mount_options']
fs_info = { "fs_device": fs_device, "fs_type": m['fs_type'], "mp": mp, "fs_options": fs_options, "mount_source": mount_source, "mount_opt": mount_opt }
temp_list.append(fs_info)
final_list.append(temp_list)
else:
temp_list = []
fs_device = v['device'][0] + "1"
fs_options = ""
mount_opt = ""
mount_source = fs_device
mp = None
if "label" in v.keys():
fs_options = "-L " + v['label']
mount_source = "LABEL=" + v['label']
if "fs_create_options" in v.keys():
fs_options = fs_options + " " + v['fs_create_options']
if "mount_point" in v.keys():
mp = v['mount_point']
if "mount_options" in v.keys():
mount_opt = v['mount_options']
fs_info = { "fs_device": fs_device, "fs_type": v['fs_type'], "mp": mp, "fs_options": fs_options, "mount_source": mount_source, "mount_opt": mount_opt }
temp_list.append(fs_info)
final_list.append(temp_list)
return final_list
39 changes: 39 additions & 0 deletions ansible/roles/s4appfs/filter_plugins/lvmdata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/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():
if 'lvm' in v.keys():
for m in v['lvm']['lv']:
temp_list = []
lv_size = ""
if '%' not in m['lv_size']:
lv_size = m['lv_size'] + "G"
else:
lv_size = m['lv_size']
lv_options = ""
if "raid_type" in m.keys():
lv_options = "--type " + m['raid_type']
if "mirrors" in m.keys():
lv_options += " -m " + m['mirrors']
if "lv_stripes" in m.keys():
lv_options += " -i " + m['lv_stripes']
if "lv_stripe_size" in m.keys():
lv_options += " -I " + m['lv_stripe_size']
lvm_info = { "vg_name": v['lvm']['vg']['vg_name'], "lv_name": m['lv_name'], "lv_size": lv_size, "lv_options": lv_options }
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]['lv_name'] == 'hana_data_lv':
final_list.append(final_list.pop(i))
break
return final_list
17 changes: 17 additions & 0 deletions ansible/roles/s4appfs/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
93 changes: 93 additions & 0 deletions ansible/roles/s4appfs/filter_plugins/storagedetails.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/usr/bin/python

import decimal

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']

# Get a list with the provisioned disk sizes
size_provisioned_disks = []
for m, n in ansible_devices_data.items():
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 float(v['disk_size']) >= 1024:
rounded_val = round(decimal.Decimal(float(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)

# Non-HANA provisioned disks (only different sizes)
non_hana_disks = [x for x in size_provisioned_disks_sorted if x not in size_profile_disks_sorted]

# Remove non-hana disks (only different sizes) from the list of provisioned disks
for t in non_hana_disks:
for j in size_provisioned_disks_sorted:
if t == j:
size_provisioned_disks_sorted.remove(j)
break

# Get the missing disks
if (len(size_profile_disks_sorted) - len(size_provisioned_disks_sorted) > 0) or (len(set(size_profile_disks_sorted)) != len(set(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 sorted(storage_profile_info.items()):
new_list1 = []
new_list2 = []
display_size = ""
if float(v['disk_size']) >= 1024:
rounded_val = round(decimal.Decimal(float(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 sorted(ansible_devices_data.items()):
if (n['size'] == display_size) and ("dm-" not in m) and (m not in temp_list) and n['partitions'] == {} and n['links']['labels'] == [] and len(n['links']['ids']) > 0:
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 68d44ce

Please sign in to comment.