From 9504dfaa72a341d81e5c2bf9142d8b04ddbf8de8 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Fri, 12 Mar 2021 14:44:38 +0000 Subject: [PATCH] new formula for node_count This enzures that, if the number of control nodes are increased, the compute nodes are decreased. --- configs/default.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/default.config b/configs/default.config index 19c541d..a123692 100644 --- a/configs/default.config +++ b/configs/default.config @@ -38,7 +38,7 @@ node_ram=4096 # 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}'` * 11 / 10 / 1024 / $node_ram + 1 )) +node_count=$(( (( `cat /proc/meminfo | grep -i memtotal | awk '{print $2}'` - ( ${control_count} * ${control_ram} * 1024 )) * 11 / 10) / 1024 / ${node_ram} + (4*8/10) )) # Disks to create on each VM disks=()