...
- InternalLBVm - have to add support for this provider first.
- Netscaler VPX
General flow
With InternalLBVMExample with Internal LB VM:
- Create App tier using network offering with Service=LB, Provider=InteralLBVm, LB service capability schema=Internal.
- Create LoadBalancingRule LBRule1 for LB Rule1 - specify source Ip1, loadBalancerPort source port 80, instancePort dest port 80, schema=Internal.The new If the source IP1 is not acquired yet and it's free, it will be acquired automatically. New internal LB VM starts up with IP1 on App tier with the Ip1. , and this VM will manage all LB rules created for IP1.
- Add vm1 to the LB1. The rule for Ip1/VM1/ports 80:80 gets configured inside the HA proxy
- Add vm2 to the LB1. The rule for IP1/VM2/80:80 gets configured inside the HA Proxy
- Create Internal Load Balancer LBRule2 for IP1, loadBalancerPort port 81, instancePort 81, schema=Internal. No need to start a new Internal LB vm as it's been already started for IP1 on step 2)
- If you want to manage access from tier A to tier B, setup Network ACLs on the VPC VR
With Netscaler VPX:
- Create App tier using network offering with Service=LB, Provider=Netscaler, LB service capability schema=Internal.
- Create LoadBalancingRule LBRule1 for Ip1, loadBalancerPort 80, instancePort 80, schema=Internal. Nothing gets configured on the Netscaler.
- Add vm1 to the LB1. The rule for Ip1/VM1/ports 80:80 gets configured on the Netscaler.
- Add vm2 to the LB1. The rule for IP1/VM2/80:80 gets configured on the Netscaler.
- Create Internal Load Balancer LBRule2 for IP1, loadBalancerPort port 81, instancePort 81, schema=Internal. Nothing gets configured on the Netscaler.LB Rule2. This time don't specify the source IP address. The random source IP2 will get acquired from the guest network, assigned to the LoadBalancingRule and will be returned to the end user in the API response. New internal LB VM will start with IP2 on APP tier, and it will manage all LB rules created for IP2.
- If you want to manage access from Web tier A to the App tier B, setup Network ACLs on the VPC VR.
The pic below is for the case when InternalLBVm is used as a provider for the LB service on internal tier:
...
- Add new manager - InternalLoadBalancerManagerImpl (name is TBD). This class will be responsible for managing Internal LB rules.
- The LBRule can be created with or without specifying the IP address. If no Ip address is specified, it will be acquired from the guest network on the fly and assigned to the load balancing rule. If ip address is specified, the validation whether the IP address is acquired, has to be done. If the IP is not acquired, fail the LB rule creation.In this case we acquire IP address from the Guest network and start new Internal LB vm for the IP address
- A new InternalLBVM should be spanned as soon as the guest IP address is acquired by the LB rule. This code should be handled by InternalLBNetworkApplianceManager. The VM gets created with 2 interfaces: eth0 - linkLocal (private in VMWare case), eth1 - the IP address of the LB rule.
- There is going to be 1 Internal LB vm spanned per guest IP address participating in the Internal Load Balancing.
...
- assignToLoadBalancerRule
- deleteFromLoadBalancerRule
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
- Create: InternalLBVM gets created when the first Load Balancing Rule is created for the IP address
- Destroy: InternalLBVM gets destroyed when the last Load Balancer is removed for the IP address
- Reboot: InternalLBVM can be rebooted as a regular system vm using RebootSystemVm API.
- List: InternalLBVM can be listed with ListSystemVMs API
...
Limitations
- Internal and Public Lb are mutually exclusive on a tier. If the tier has LB on the public side, then it can't have the Internal LB
- Supported just on VPC networks
...