Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Glossary

InternalLB - Internal Load Balancer

InternalLBVM - Internal Load Balancer VM

The general flow

  1. Create App tier using network offering with Service=Lb, Provider=InteralLBVmILBVm
  2. Create Internal Load Balancer - InternalLB1 - on Acquire guest IP address - Ip1 - from the App tier .Create Internal Load Balancer LB1 for Ip1, loadBalancerPort 80, instancePort 80. The new internal LB VM network. The new InternalLBVM starts up on App tier with the Ip1 automatically acquired from the app tier network.
  3. Create Load Balancing rule LBRule1 with lbPort 80 and instancePort 80 in InternalLB1. Nothing gets configured on the backend yet.
  4. Add vm1 to the LB1LBRule1. The rule for Ip1/VM1/ports 80:80 is configured inside the HA proxy
  5. Add vm2 to the LB1LBRule1. The rule for IP1/VM2/80:80 is configured inside the HA Proxy
  6. Create Internal Load Balancer LB2 for IP1, loadBalancerPort port 81, instancePort 81. No need to start a new Internal LB vm as it's been already started for IP1.
  7. If you want to manage access from tier A to tier B, setup Network ACLs

The pic below will have following LB rules configured on the VPC:

  1. InternalLB1 having guest IP 10.10.10.4. InternalLB1 has 2 LB rules - rule #1 lbPort=23, instancePort=25; rule #2 lbPort=45, instancePort=46
  2. InternalLB2 having guest IP
  3. 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.
  4. Internal LB rule #1 for 10.10.10.4 guest IP, loadBalancerPort 23 and instancePort 25. 
  5. Internal LB rule #2 for 10.10.10.4 guest IP, loadBalancerPort 45 and instancePort 46.
  6. Internal LB rule #3 for 10.10.10.6 guest IP, loadBalancerPort 23 and instancePort 25.Public LB rule gets configured on the VPC VRInternalLB rules #1 and #2 get configured on Internal LB VM1Internal LB rule #3 gets configured on Internal LB VM2.. InternalLB2 has 1 LB rule with lbPort=23 and isntancePort=25
  1. Image Modified

Architecture and design description

...

Introduce new Network Provider - InternalLBVm InternalLBVm. This provider supports only 1 service  - LB

...

Add one more default Network offering having LB Service with Internal LB provider. Insert this offering as a part of the upgrade as well.

2)

...

Create Internal Load Balancer

Create Internal Load Balancer for Before creating the Internal Load Balancer, the Guest IP address has to be allocated from the App tier network. The InternalLB is uniquely identified by:

  • networkId
  • ipAddress

InternalLB creation will trigger IP allocation from Guest network, and span new InternalLBVM

Java code changes
  • New code for allocating and managing IP addresses from the guest network to the account. Might need to create a new manager for that.

...

Backend changes

...

  • Add new manager - InternalLoadBalancerManagerImpl (name is TBD). This class will manage Internal Load Balancers.
  • A new InternalLBVM should be spanned once the internal load balancer is created. This code should be handled by InternalLoadBalancerNetworkApplianceManager. The VM gets created with 1 NIC having guest IP of the InternalLB

Backend changes

For the backend engineer to complete. Have to put HA proxy management/configuration details hereNo backend changes are needed for this part

Web Services API

New set of APIs to allocate guest IP address to the account.create InternalLB, delete load balancer, list load balancers

Api name

Request parameters

Response parameter

Available to regular user

createInternalLoadBalancer allocateIpAddress

networkId (required, accepts only Id of VPC guest networks in 4.2)
name (required)
description (required)

  • id
  • name
  • descriptionipAddress
  • networkId
  • account
  • zoneId
  • ipAddress
  • type (=Internal)
  • list of LBRules (child objects, the list is empty at this point)domainId

yes

deleteLoadBalancer releaseIpAddress

id (required)

true/false

yes

listLoadBalancers listIpAddresses

  • id
  • name
  • ipAddressdescription
  • networkId
  • zoneId
  • accountipAddress
  • domainId type

List of Ip Load Balancer objects, each having:

  • id
  • name
  • descriptionipAddress
  • networkId
  • zoneId
  • ipAddress
  • account
  • type
  • list of LBRules (child objects)domainId

yes

DB changes
TBD

3)

...

Add Load Balancing Rule to the Internal Load Balancer

...

created on step #2

Java code changes
  • Add new manager - InternalLoadBalancerManagerImpl (name is TBD). This class will manage all the internal lb rules in the system.
  • A new InternalLBVM should be spanned when the first LB rule for the IP address gets created. This code should be handled by InternalLBNetworkApplianceManager. The VM gets created with 1 interface having IP address of the Load Balancer assigned to it.
  • You can create as many Internal Load Balancers for the IP address as  you want. The Internal Load Balancer is uniquely identified by the IpAddress / LbPort combination.
  • There is going to be 1 Internal LB vm spanned per IP address participating in the Internal Load Balancing.

...

Backend changes

...

For the backend engineer to complete. Have to put HA proxy management/configuration details here

...

Web Services API

...

  •  

...

Backend changes

...

Web Services API

New set of APIs to manage Load Balancing rules

API name

Request parameters

Response parameters

Available to regular user

createInternalLoadBalancer createLoadBalancingRule

  • ipAddressIdloadBalancerId(required)
  • name (required)
  • description (required)
  • algorithm (required)
  • loadBalancerPort (required)
  • instancePort (required)
  • networkId (optional)
  • id
  • name
  • descriptionloadBalancerId
  • algorithm
  • loadBalancerPort
  • instancePort
  • networkId
  • ipAddress child object

yes

deleteInternalLoadBalancer deleteLoadBalancingRule

id(required)

true/false

yes

listInternalLoadBalancers listLoadBalancingRules

  • id
  • ipAddressId
  • name
  • descriptionloadBalancerId
  • algorithm
  • loadBalancerPort
  • instancePort
  • networkId

list of load balancers List of LBRules, each having parameters:

  • id
  • name
  • descriptionloadBalancerId
  • algorithm
  • loadBalancerPort
  • instancePortnetworkId
  • ipAddress child object

yes

DB changes

TBD

4) Assign

...

VM(s) to the

...

Load

...

Balancing Rule.

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

  • assignToLoadBalancerRule
  • deleteFromLoadBalancerRule

...

Web Services API

...

assignToLoadBalancerRule/deleteFromLoadBalancerRule will accept internal load balancer id when passed with id request parameter.

...

  • Create: InternalLBVM gets created when the first Load Balancer is created for the IP addressinternalLB gets created.
  • Destroy: InternalLBVM gets destroyed when the last Load Balancer is removed for the IP addressinternalLB gets removed.
  • Reboot: InternalLBVM can be rebooted as a regular system vm using RebootSystemVm API.
  • List: InternalLBVM can be listed with ListSystemVMs API

...