This simple Bash Script can be used to calculate the number of the partitions power (2^X Logical Partitions) that you need in your SUSE OpenStack Cloud Swift barclamp

The recommended power part number is the next nearest of the total of your Swift nodes multiplied for the number of the HDD per node multiplied for 100.
(Remember that you need the first HDD of each node for SO)

So, if you have 10 nodes with 5 HDD each one (less one for SO):

10 * (5 - 1) = 400 * 100 = 4000

The next nearest part power is: 12

2 ^ 12 = 4096

This script do the math:

Billy@hackintosh:~/lab$ ./SOCSwift.sh

Calculate 2^X Logical Partitions  for
"SUSE OpenStack Cloud" Swift Barclamp
Usage:
 ./SOCSwift.sh <SOC Swift Nodes> <HDD per Node>

Billy@hackintosh:~/lab$

Easy right?

#!/bin/bash
# wvera@suse.com
# Tue Mar 15 18:32:59 COT 2016

Usage() {
  echo -e "\nCalculate 2^X Logical Partitions\
  for \n\"SUSE OpenStack Cloud\" Swift Barclamp"
  echo -e "Usage:\n $0 <SOC Swift Nodes> <HDD per Node>\n"
  exit 0
}
[[ $# -eq 2 ]] || Usage
SOC_NODES="$1"
SOC_HDDPNODE="$2"
# SOC6 Uses the first HDD for SO, please consider this
SOC_PW2=$(( $SOC_NODES * $SOC_HDDPNODE * 100 ))

NextPower2="1"
NextPowerCompare="1"
while [ $SOC_PW2 -ge $NextPowerCompare ]; do
        let NextPower2=$NextPower2+1
	NextPowerCompare=$(printf '%s\n' "$(( 2 ** $NextPower2 ))")
done
echo "2^X Logical Partitions,\
for SOC Swift Barclamp: $NextPower2"

Also is in Github:
https://github.com/bvera/soc-swift-partpower

And "online" version (careful, it's a lab!):
http://billy.sh/soc-swift-partpower/

IMPORTANT: Value Cannot be Changed After the Proposal Has Been Deployed

Changing the number of logical partition after Swift has been deployed is not supported. Therefore the value for the partition power should be calculated from the maximum number of partitions this cloud installation is likely going to need at any point in time.

Billy Vera © 2017. All Rights Reserved.

The opinions expressed in this blog are purely my own and are not in any way endorsed by my employer.

Proudly published with Ghost using Ghostium Theme