This feature allows the direct agents to support multiple management servers. With this feature, a load balancer may no longer be necessary. The CloudStack administrator is responsible for setting a list of management servers and an algorithm in which to sort them, to the management server, using global configurations. The management server is responsible for applying algorithm to the management server list and propagate it to the agents.
Allow a CloudStack administrator to set a list of management servers for direct agents to connect to. In this way, directs agents should connect to the first element on the list as the master node, but in case of disconnection will iterate through the list in order (secondary nodes).
A new global configuration is added: 'direct.agent.lb.algorithm'. Possible values of this global configuration are: 'static', 'roundrobin' and 'shuffle'.
This feature makes use of two global configurations:
Values from both global configurations are read on management server startup by new utility and kept in memory.
An existing command-answer pattern that handles initial agent connection and startup will be modified to propagate the a comma-separated list of management servers. This list will be provided by the utility and will be determined by the value of 'direct.agent.lb.algorithm' in this way:
The agents will be modified to save this list as the configured 'host' value in agent.properties file.
Supposing an environment in which there are 3 management servers: A, B and C and 3 KVM agents.
Setting 'host' = 'A,B,C', agents will receive lists depending on 'direct.agent.lb' value: