- VMware vCloud Director Cookbook
- Daniel Langenhan
- 823字
- 2021-07-23 15:45:12
Creating load-balanced VMs in an organization
We will now use the Edge to create load-balanced VMs.
Getting ready
You will need a deployed organizational Edge with a suballocation of at least one IP.
Please also create an Organization Network that connects to the Edge device (if you have problems, have a look at the Giving your networks an Edge recipe in Chapter 1, Setting Up Networks).
Create a vApp with two VMs in it. You will need two VMs (Windows or Linux) with a web server installed (IIS or Apache). The VMs should have IPs from the Organization Network (pool or manual). Make sure your web server is prepared and tested for load balancing. Due to the limited space, I cannot go into details on how to configure IIS or Apache for load balancing. But Google will have the answers for you.
The VMs in this vApp should be connected to the Edge via the Organization Network you created. You might like to either use manual IPs or fix the IP allocation (as shown in the Ensuring no change occurs in IP after redeployment recipe in this chapter).
With regards to licensing, the load balancing (as well as VPN and HA) features of vCNS require advanced licensing. vCNS Advanced comes with vCloud Suite Advanced or a better edition.
How to do it...
- Enter the organization you have created the Edge and the vApp in.
- Click on Cloud Resources and then double-click on the OvDC you have created.
- Click on Edge Gateway.
- Right-click on the Edge and select Edge Gateway Services.
- Click on Load balancer.
- Configure the pool servers by performing the following steps:
- Click on Add.
- Name the pool, for example,
Webserver
. - Check HTTP (and if you want, check HTTPS; however, I will not cover this in detail).
- In the drop-down menu, you can select the method that shows how the connection should be distributed between the pool members, as shown in the following screenshot:
- In the Configure Health-Check step, we can configure what the load balancer should monitor to know if a resource is unavailable. For the moment, we can just click on Next.
- Now add the member servers to the pool by clicking on Add.
- Add the server by its IP from the Organization Network it's connected to.
- You can add different Port and Monitor Port values instead of the default. We are configuring HTTP so the Port value
80
is fine: - After adding a second member server to the pool, review the settings and finish the wizard.
- Configure the Virtual Servers (also called Virtual IP (VIP)) by performing the following steps:
- Click on Add.
- Give the VIP a name.
- Choose whether the IP should be used from the Edge network or from the External Network (for this example, we choose the External Network).
- Enter the IP you want. It has to be part of the suballocation you specified for the Edge.
- Select the service you would like to load balance and the Persistency Method (stickiness).
- Finally, do not forget to check Enabled, as shown in the following screenshot:
- Click on OK to finish the setup and then exit the Edge configuration with OK.
- The Edge will now be configured. After the configuration is finished, you should be able to try an HTTP connection to the VIP you have specified.
How it works...
The Edge contains a load balancing function. This function is accessible via vCloud; however, the amount of configuration that can be done is limited. We will later show how we can configure more using vCNS. The configuration from the previous example is reflected in the following diagram:

The VIP 172.16.1.51 (from the external network) is used to load balance the HTTP (TCP port 80) service to the VMs that are configured on the Edge network.
What really happens in the background is that vCloud uses the Edge to configure the load balancing. The options for the load balancer that vCloud can set are as follows:

If you are using the HTTP cookie method, you have some additional configuration items. You can define the cookie name as well as the mode. The cookie modes available are Insert, Prefix, and App.
One of the things that vCNS doesn't do is SSL offloading; only SSL pass through is supported at this stage.
There's more...
Instead of using the vCloud/vCNS load balancer, you can also use any load balancer that is available as a VM, such as F5 and Cisco provide. If you would like to play with a load balancer, you can get 30-day trial versions from most vendors. Using other virtual load balancers gives you some more flexibility as you can insert them directly into the vApps. The disadvantage is that they may incur additional licensing.
Load balancer methods
The following load balancing methods exist:

See also
- URI is explained at http://en.wikipedia.org/wiki/Uniform_resource_identifier
- Free load balancers that can be virtualized can be found at the following links:
- Ha-Proxy: https://haproxy.1wt.eu
- Nginx: https://nginx.org/en
- 汪博士詳解PMP?模擬題(第4版)
- 資本的眼睛
- 金融科技(FinTech)發(fā)展的國際經(jīng)驗和中國政策取向(中國金融四十人論壇書系)
- 基于價值增值的治理導向型內(nèi)部審計研究
- Citrix XenApp? 7.5 Desktop Virtualization Solutions
- 國有企業(yè)經(jīng)濟責任審計實務指南
- 金融保險集團內(nèi)部審計創(chuàng)新與實踐
- 注冊會計師全國統(tǒng)一考試專用教材:審計
- 財務建模與綜合估值:數(shù)據(jù)研磨、模型校準、動態(tài)估值
- vSphere Design Best Practices
- Minitab Cookbook
- 內(nèi)部控制審計功能與質(zhì)量
- 計量經(jīng)濟學
- Force.com Tips and Tricks
- 審計定價問題研究