move the node_count definition

If there are mods in the configs, then the node_count would
not be initialised correctly. Moving to the read_configs
function fixes this
This commit is contained in:
Arif Ali 2022-01-10 10:33:38 +00:00
parent f11be6be55
commit f3eeb6e2eb
Signed by: arif
GPG Key ID: 369608FBA1353A70
2 changed files with 7 additions and 7 deletions

View File

@ -34,13 +34,6 @@ node_start=1
node_cpus=2
node_ram=4096
# Dynamically generate the node count
# The amount of memory add on 10% then divide by node_ram then add 1
# For a 32GB machine we'll get 10 VMs altogether
# 1 x 4GB juju, 1 x 8GB controler, 8 x 4GB compute
# The juju VM is not included in the count
node_count=$(( (( `cat /proc/meminfo | grep -i memtotal | awk '{print $2}'` - ( ${control_count} * ${control_ram} * 1024 )) * 11 / 10) / 1024 / ${node_ram} + (7*7/10) ))
# Disks to create on each VM
disks=()
disks+=(150)

View File

@ -223,6 +223,13 @@ read_configs()
for config in $configs ; do
read_config $config
done
# Dynamically generate the node count
# The amount of memory add on 10% then divide by node_ram then add 1
# For a 32GB machine we'll get 10 VMs altogether
# 1 x 4GB juju, 1 x 8GB controler, 8 x 4GB compute
# The juju VM is not included in the count
node_count=$(( (( `cat /proc/meminfo | grep -i memtotal | awk '{print $2}'` - ( ${control_count} * ${control_ram} * 1024 )) * 11 / 10) / 1024 / ${node_ram} + (7*7/10) ))
}
read_config()