Introduction

This documents gives an overview to the design and functional implementation for Internal Load Balancing on VPC tiers.

Feature developers:

Glossary

Use case

There are 2 tiers in the VPC - Web tier and Application tier. Traffic to Web tier is balanced on the VPC VR on the public side. User wants traffic coming from Web to the App tier to be balanced as well. Load balancing on the App tier will be covered by the Internal LB feature.

Internal LB can be handled by 2 network providers:

The pic below is for the case when InternalLBVm is used as a provider for the LB service on internal tier:

  1. Public LB rule for 72.52.125.10 Public IP, public port 80 and private port 81. It enables LB for traffic coming from the internet to the vms on the Web tier. The LB rule is configured on the VPC VR.
  2. Internal LB rule #1 for 10.10.10.4 guest IP, loadBalancerPort 23 and instancePort 25. The LB rule is configured on InternalLBVM1.
  3. Internal LB rule #2 for 10.10.10.4 guest IP, loadBalancerPort 45 and instancePort 46. The LB rule is configured on InternalLBVM1.
  4. Internal LB rule #3 for 10.10.10.6 guest IP, loadBalancerPort 23 and instancePort 25. The LB rule is configured on InternalLBVM2.

General flow

1) Enable Internal LB on VPC tier

In order to have Internal Load Balancing support on VPC tier, the tier has to be created from the network offering with:

or

Java code changes

Backend changes

TBD. We might need a separate template/set of scripts for this kind of vm, or we can re-use the existing VR template.

Web Services API

No changes to existing Apis

DB changes

No changes

2) Create Load Balancer Rule 

Java code changes
Backend changes

TBD. Have to put HA proxy management/configuration details here

Web Services API

Changes to existing APIs

API name

Request parameters

Response parameters

Available to regular user

createLoadBalancingRule

1) New parameters:

  • schema (String enum, with External/Internal choices; optional; =External by default)
  • sourceIpAddress (String, optional, can be used only with networkId conjunction)  If networkId=(guestNetworkId of the network where internal LB is supported) is passed in w/o sourceIpAddress param,  
    the IP address from the guest network will get acquired on the fly and be assigned to the Load Balancing Rule.
    2) Changes to existing parameters: 

Existing table load_balancing_rules will get a new field - "schema". It will have "External" value by default, and will accept enum values External/Internal.

3) Assign VMs to the Internal Load Balancer.

Existing set of APIs will be used for adding/deleting VMs to/from Internal LB

How to list Guest IP addresses allocated for LB purpose

At the moment, cloudStack doesn't expose any API for listing IP addresses from the guest network. Adding a new one to serve this purpose:

API Name

Request Parameters

Response Parameters

Available to regular user

listIpAddresses

  • ipAddress
  • networkId
  • purpose

list of ip Addresses, each IP object having parameter:

  • ipAddress
  • networkId
  • purpose (can have value "LB" at this point)
  • state (Free/Allocated)

true

In 4.2 this API will return only Allocated IP addresses.

Internal Load Balancing Vm life cycle

Limitations

UI

TBD