Skip to main content

Lab Guide: Modern Load Balancing

Lab Guide: Modern Load Balancing

This lab will walk you through the basics of load balancing with Avi. Feel free to take extra time and explore.

Demo Avi

Feel free to play around with the system. This is a demo environment. You can't hurt it!
  • Access the lab environment via us.academy.demoavi.us or europe.academy.demoavi.us
  • Username is your email address (lowercase), password is Aviclass123
  • These credentials will be valid for a short period of time. Contact Avi for longer access


Virtual Service

Create a virtual service

  1. Select the Applications menu at the top, then Virtual Services on the left
  2. Start the VS Creation Wizard.
    • Under Virtual Services on the left, Click the blue CREATE pulldown
    • Select Basic Setup
  3. VS Name: Use your name
  4. Use the default application type HTTP

Create a VS VIP

  1. Scroll down to the VIP Address Section
  2. Do not use any of the existing configured VIPs in the drop-down.
  3. Click the three vertical dots to the right, then Click the Create button.
  4. This opens the Create VS VIP window
  5. Name: Leave the default name or Give the VIP object any name
  6. VIPs: Click the ADD button
  7. Enable VIP should be CHECKED
  8. Availability Zone: Select the first / top option in the drop-down menu
  9. Private IP: Auto Allocate (Avi will acquire the IP from the configured IPAM)
  10. VIP Address Allocation Network: Public AZ1 (be sure to select Public, not Private)
  11. IPv4 Subnet: 10.0.20.0/22
  12. Public IP: Select Auto-Allocate (This is the private to public NAT)
  13. Click SAVE, then SAVE again to complete the VS VIP and return to the New Virtual Service window

Create a server pool

  1. Scroll down to the Pool Section
  2. Select Servers: Click the blue on white BY NETWORK button on the right
  3. Network: From the pulldown list select Private-AZ1 network
  4. Servers: Check the boxes to Select server1 through server4
  5. Click the ADD button at the bottom right (Don't forget this step)
  6. This returns you to the NEW VIRTUAL SERVICE window
  7. Click the SAVE button in the bottom right to complete the VS creation
  8. The new virtual service will be opened to the Analytics tab
  9. If you hover your mouse over the name of the virtual service, various status updates will be displayed
  10. Congratulations! You have created a virtual service!


Verify

Service Engine creation

  • If this is the first VS created in your environment, the Avi Controller must first create Service Engines (load balancers)
  • SE creation takes about 3 minutes
  • Select the Applications menu at the top, then Virtual Services on the left
  • The VS health score is next to the VS name, initially will be red with a low score
  • The health should change to green once the SEs are created and the score will improve
  • Hover your mouse over the health score periodically to see the progress of the SE creation

Test the VS

  1. Once your VS score is green, you can test it
  2. Click the name of your new vs to open the VS details
  3. Hover your mouse over the Virtual Service: [your name] text. The pop-out box shows additional information
  4. The NATed public IP for the virtual service should be below the internal private VIP
  5. Copy the public VIP address
  6. Open a new browser tab and enter http://thepublicvip with the IP you copied
  7. If it works, you should see a basic web page with two txt files
  8. If it's not working, edit the VS
    1. If in the VS detail screen, use the pencil icon in the top right
    2. If in the main VS list, click the three dots at the right and select Edit
  9. Common items to check include:
    1. Selected the correct AZ and network for the VIP address
    2. Pool is configured with servers
    3. Application type and port
    4. The logs in the verify section could be useful

Verify

  • In the VS details view, click on the Logs tab
  • Select the Logs menu to show the logs generated from testing your application
  • Expand an individual log by clicking on the pulldown icon on the right side of the log
  • Expose the full log details by clicking on the three dots and selecting Log detail
  • Close the detailed log by clicking the X in the top right corner
  • Avi can be set to higher logging levels with increased verbosity for advanced troubleshooting

SSL/TLS

Change the site to TLS encryption
  • Edit the VS (pencil icon on the top right of the VS page)
  • Add a second service port for 443 and enable the SSL checkbox
  • An SSL Settings section will appear on the bottom right
  • Set the SSL Profile to the System-Standard - This defines the SSL/TLS versions and ciphers to support
  • For the SSL Certificate, select both System-Default-Cert (RSA cert) and System-Default-Cert-EC (EC cert)
  • Test the site via https:// [your VS IP] - You will get an SSL certificate error as the cert is self-signed
  • Which certificate did your browser negotiate, EC or RSA? Take a look in the logs to find out.

HTTPS Redirect

Automatically redirect clients from HTTP to HTTPS
There are several ways to accomplish redirection with increasing levels of sophistication and flexibility. This exercise shows one example of accomplishing this task.
  • Edit the VS
  • Select the Application Profile (currently set to System-HTTP) and create a new app profile
  • Give the new HTTP profile any name
  • Set the Type to HTTP
  • Select the Security tab at the top
  • Select SSL Everywhere - This will enable HTTP to HTTPS redirect, rewrite server redirects, and enable common SSL tasks
  • Save the new profile then save the changes to the VS
  • Verify the redirect by accessing the site via HTTP

Server Health

Troubleshoot problematic servers
  • Navigate to Applications > Dashboard
  • Set the view to View VS Tree (if it is not already)
  • Select the + to the right of your virtual service to expand the view - The illustration shows the VS on the left, point to the Pool to the right, then the servers in the pool. The Service Engine is shown below.
  • To see why a server is marked down, mouse over the red health score
  • The servers that are green / up are not entirely problem free. Hit the site a few times and check the logs, filtering for Significant (the red logs). Issues range from intermittent server slowdowns to missing files to simply the wrong content.
Apply a custom health monitor
  • Navigate to Pools page, select the [yourname-pool] pool to drill into this object
  • Select the Servers tab of this pool to view the it's servers
  • Edit the pool via the pencil icon in the top right
  • Remove the default System-HTTP health monitor via the trash can icon - this monitor is very basic, validating a 200 OK response came back, not the content
  • Select the Add button to apply a more robust HTTP health check
  • Select Avi Rocks health monitor and save the change to the pool - This health monitor looks for specific content to be returned
  • One of the servers is now marked down because of a content mismatch
  • Click on the server name to drill in further to this server
  • In the health monitor table, click in the name of the Avi Rocks health check to expand. What content is this server returning versus expected content from the new health monitor?

Advanced Virtual Service Functionality

This lab enables a few interesting features
  • Create a new virtual service via Advanced Setup - This mode will expose a few more options
  • Step 1 Settings: As before, provide a Name and VS VIP
  • In Advanced setup, a pool is not created automatically, so Create a Pool via the pool pulldown menu - This pauses the VS creation and jumps into a pool create workflow
  • Give the new pool a name
  • Scroll down to Servers, enter 18.216.156.188 followed by the blue Add button, then Save to complete the pool creation process
  • The workflow returns to the unfinished VS, which is now pointing to the new pool
  • Step 2 Policies: Select Next to go to the Policies page, select HTTP Request followed by the green + button - Policies are simple mechanisms to provide content manipulation or similar functionality
  • Under the Action table, use the pulldown menu to Add New Action, select Modify Header, change the default from Remove Header to Add Header, set the Name to test and the Custom Value to true, the green Save Rule button, then Next - This will add a custom header into all client requests for this site
  • Step 3 Analytics: Select the Log All Headers checkbox then Next - This will increase the logging level to capture client headers, cookies, etc
  • Step 4 Advanced: For the Host Name Translate, enter nomoreproxypass.com (or something similarly fun!) followed by Save - This will change the hostname requested by the client from the IP address to this hostname before the request is forwarded to the server
  • Step 5 Advanced: Select Use VIP As SNAT checkbox. This enables the Service Engine to use a unique source address when initiating traffic to remote networks and overcomes some routing challenges specific to this lab in AWS
Validate the settings
  • Access the new VS to generate some traffic - The website being returned is a simple DataScript on another VS that reflects the headers it received, a fun way to compare what the server sees versus what the client sent
  • Navigate to the Logs page of the VS, select Non-Significant Logs to filter for all logs
  • Expand a log, then select the blue View All Headers text on the right of the expanded log
  • On the title bar of the top table, click the dark blue bar to expand - This view shows Headers Received from the Client. Rows in yellow were modified by Avi, red rows were removed by Avi, and in the Headers Sent to Server column, green rows were added by Avi
  • Try adding more logic, such as HTTP Request Policies to send traffic different pools

Learn More

Interested in taking Avi for a real spin? Here are some suggestions
  • If you want more time to use this lab, just send us a message
  • Contact learnavi@broadcom.com for any issues with the lab or questions about Avi
  • Knowledge base articles: techdocs.broadcom.com
  • Join a free, technical workshop: go-vmware.broadcom.com

Comments

Popular posts from this blog

Quick Guide to VCF Automation for VCD Administrators

  Quick Guide to VCF Automation for VCD Administrators VMware Cloud Foundation 9 (VCF 9) has been  released  and with it comes brand new Cloud Management Platform –  VCF Automation (VCFA)  which supercedes both Aria Automation and VMware Cloud Director (VCD). This blog post is intended for those people that know VCD quite well and want to understand how is VCFA similar or different to help them quickly orient in the new direction. It should be emphasized that VCFA is a new solution and not just rebranding of an old one. However it reuses a lot of components from its predecessors. The provider part of VCFA called Tenenat Manager is based on VCD code and the UI and APIs will be familiar to VCD admins, while the tenant part inherist a lot from Aria Automation and especially for VCD end-users will look brand new. Deployment and Architecture VCFA is generaly deployed from VCF Operations Fleet Management (former Aria Suite LCM embeded in VCF Ops. Fleet Management...
  Issue with Aria Automation Custom form Multi Value Picker and Data Grid https://knowledge.broadcom.com/external/article?articleNumber=345960 Products VMware Aria Suite Issue/Introduction Symptoms: Getting  error " Expected Type String but was Object ", w hen trying to use Complex Types in MultiValue Picker on the Aria for Automation Custom Form. Environment VMware vRealize Automation 8.x Cause This issue has been identified where the problem appears when a single column Multi Value Picker or Data Grid is used. Resolution This is a known issue. There is a workaround.  Workaround: As a workaround, try adding one empty column in the Multivalue picker without filling the options. So we can add one more column without filling the value which will be hidden(there is a button in the designer page that will hide the column). This way the end user will receive the same view.  

Step-by-Step Explanation of Ballooning, Compression & Swapping in VMware

 ðŸ”¹ Step-by-Step Explanation of Ballooning, Compression & Swapping in VMware ⸻ 1️⃣ Memory Ballooning (vmmemctl) Ballooning is the first memory reclamation technique used when ESXi detects memory pressure. ➤ Step-by-Step: How Ballooning Works  1. VMware Tools installs the balloon driver (vmmemctl) inside the guest OS.  2. ESXi detects low free memory on the host.  3. ESXi inflates the balloon in selected VMs.  4. Balloon driver occupies guest memory, making the OS think RAM is full.  5. Guest OS frees idle / unused pages (because it believes memory is needed).  6. ESXi reclaims those freed pages and makes them available to other VMs. Why Ballooning Happens?  • Host free memory is very low.  • ESXi wants the VM to release unused pages before resorting to swapping. Example  • Host memory: 64 GB  • VMs used: 62 GB  • Free: 2 GB → ESXi triggers ballooning  • VM1 (8 GB RAM): Balloon inflates to 2 GB → OS frees 2 GB → ESXi re...