Provisioning load balancers

Virtuozzo Hybrid Infrastructure offers load balancing as a service for the compute infrastructure. Load balancing ensures fault tolerance and improves performance of web applications by distributing incoming network traffic across virtual machines from a balancing pool. A load balancer receives and then routes incoming requests to a suitable VM based on a configured balancing algorithm and VM health.

Load balancers are created and managed by self-service users, as described in "Managing load balancers" in the Self-Service Guide. However, to provide self-service users with this functionality, you need to enable the load balancer service in the admin panel or by using the vinfra command-line tool.

Limitations

  • In the current version of Virtuozzo Hybrid Infrastructure, the installed service cannot be removed.

  • For self-service users to be able to create highly available load balancers, the compute cluster must have at least two nodes. However, we recommend having three compute nodes for the case of a load balancer failover after a failure.
  • If you install the service after creating a project, load balancers are not automatically enabled in the project quotas.
  • The maximum number of load balancers supported per project is 100.

Prerequisites

To enable the load balancer service

Admin panel

  1. Go to the Settings > Add-on services screen.
  2. In the Load balancer service section, click Install.

Command-line interface

Run the following command:

# vinfra service compute lbaas configure [--enable] [--loadbalancer-topology {SINGLE,ACTIVE_STANDBY}]
                                         [--amp-flavor-id <amp_flavor_id>] [--amp-image-tag <amp_image_tag>]
--enable
Enable compute load balancer service
--loadbalancer-topology {SINGLE,ACTIVE_STANDBY}

Configure the load balancer topology:

  • SINGLE: create one load balancer instance
  • ACTIVE_STANDBY: create two load balancer instances working in the Active/Standby mode
--amp-flavor-id <amp_flavor_id>
Compute flavor ID for the load balancer instance
--amp-image-tag <amp_image_tag>
Compute image tag for the amphora image to boot

To enable and configure the load balancer service to create two instances in the Active/Standby mode, run:

# vinfra service compute lbaas configure --enable --loadbalancer-topology ACTIVE_STANDBY

You can check the load balancer service configuration in the vinfra service compute lbaas show output:

# vinfra service compute lbaas show
+-----------------------+----------------+
| Field                 | Value          |
+-----------------------+----------------+
| amp_flavor_id         | amphora        |
| amp_image_tag         | amphora        |
| loadbalancer_topology | ACTIVE_STANDBY |
+-----------------------+----------------+