If you have under-allocated your machine, the processes get stopped due to high memory consumption. In such a case, you must increase the memory allocated to the Container. This section explains the steps to allocate more memory to the virtual machine hosting the Controller.

The following are the steps to increase memory of the Controller for a bare metal deployment of Avi Load Balancer.

Prerequisites

Bare metal set up with the Controller running in a CentOS VM (v 7.6) on VMWare.

Procedure

  1. Allocate more memory to the VM hosting the Controller.
  2. Edit the “avicontroller.service” unit file to allocate the memory located at /etc/systemd/system as follows:
    ExecStartPre=/usr/bin/docker run --name=avicontroller -m *Enter the new memory value here* --cpu-period=100000 --cpu-quota=600000 -p 5098:5098 -p 8443:8443 -p 5054:5054 -p 80:80 -p 443:443 -p 161:161/udp -d --privileged -e "CONTAINER_NAME=avicontroller" -e "MANAGEMENT_IP=*Mgmt ip*" -e NUM_CPU=6 -e NUM_MEMG=14 -e DISK_GB=20 -e CNTRL_SSH_PORT=5098 -e SYSINT_PORT=8443 -e HTTP_PORT=80 -e HTTPS_PORT=443 -v /:/hostroot/ -v /dev:/dev -v /var/run/docker.sock:/var/run/docker.sock -v /opt/avi/controller/data:/vol/ avinetworks/controller:18.2.2-9224-20190306.090737

    In the above-mentioned code, you need to change “-m” value accordingly. For instance, if you want to allocate 24 GB of memory, then replace “-m” with “24g”.

  3. Save the file.
  4. Once the file is saved, execute systemctl daemon-reload command to load the edited file.
  5. Restart the avicontroller.service using the systemctl restart avicontroller command.

Results

After restarting, the controller will be updated with the new memory allocated.

Note:

Ensure that you have added the memory to the host machine before adding it to the controller. When Service Engines try to come up on hosts with their memory fragmented because of a large memory allocations and frees, there can be an assert due to the unavailability of enough contiguous memory blocks. The Service Engine auto-recovery code reboots the host to recover automatically from the situation.

Example

Before increasing the disk size:



After increasing the disk size:



You can increase the disk space by changing the DISK_GB metric in the unit file. You can also change the number of CPU cores.

The Controller container reads the memory from NUM_MEMG parameter from avicontroller.service file. The location is as follows: /etc/systemd/system).