Updates on configs

* Add comments to the default.config file
* move the node_count to the default.config, this will allow to use
  customised value if needed
* If pod-console-logging tag is to be added, then add correctly,
  Otherwise, if we are adding fresh pods after tag creation, the pods
  will fail to add. This also allows for other cases to be fulfilled if
  required
This commit is contained in:
Arif Ali 2020-12-31 12:47:30 +00:00
parent 2b57cff585
commit efab2d3628
Signed by: arif
GPG Key ID: 369608FBA1353A70
3 changed files with 28 additions and 8 deletions

View File

@ -6,28 +6,46 @@ virsh_user="virsh"
storage_path="/var/lib/libvirt/maas-images"
# Node prefix for all the nodes except for juju
compute="maas-node"
# Juju node count and definition
juju_count=1
juju_cpus=1
juju_ram=4096
juju_disk=20
# Control node count and definition
control_count=1
control_cpus=3
control_ram=8192
# 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}'` * 11 / 10 / 1024 / 1024 / $node_ram / 1024 + 1 ))
# Compute node definition
node_start=1
node_cpus=2
node_ram=4096
# Disks to create on each VM
disks=()
disks+=(50)
disks+=(20)
disks+=(20)
# The network type, you have to options, bridge and network
# Bridge, will then assign each interface to the bridged identified in
# the bridges array.
# Network, will assign each interface to the virsh network that has been
# defined in the networks array.
network_type=bridge
# The vlans for each of the bridges if that is defined.
vlans=()
vlans+=(300)
vlans+=(301)
@ -37,6 +55,7 @@ vlans+=(304)
vlans+=(305)
vlans+=(1)
# The bridges by default that will be used
bridges=()
bridges+=("br0")
bridges+=("br1")

View File

@ -50,7 +50,15 @@ machine_add_tag()
# If the tag doesn't exist, then create it
if [[ $(maas ${maas_profile} tag read ${tag}) == "Not Found" ]] ; then
tag_create=$(maas ${maas_profile} tags create name=${tag})
case $tag in:
"pod-console-logging")
kernel_opts="console=tty1 console=ttyS0"
;;
*)
kernel_opts=""
;;
esac
tag_create=$(maas ${maas_profile} tags create name=${tag} kernel_opts=${kernel_opts})
fi
# Assign the tag to the machine

View File

@ -13,13 +13,6 @@ stg_bus="scsi"
# Time between building VMs
build_fanout=60
# 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}'` * 11 / 10 / 1024 / 1024 / $node_ram / 1024 + 1 ))
maas_assign_networks()
{
maas_auto_assign_networks $1