How to bypass a Load Balancer in Cloud Director using Hosts file
search cancel

How to bypass a Load Balancer in Cloud Director using Hosts file

book

Article ID: 374695

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

This KB is only for testing your environment when we have to bypass the Load Balancer in VMware Cloud Director to connect directly to a specific Cloud Director Cell. This can be necessary for troubleshooting, testing, or when the Load Balancer is not functioning as expected. By modifying the hosts file on your local machine, you can redirect traffic directly to the Cloud Director Cell using its Private IP address instead of going through the Load Balancer.

Possible scenarios:

- Testing or verifying the configuration of a specific Cloud Director Cell without the interference of the Load Balancer.

- The Load Balancer is down or misconfigured and it is necessary for a direct connection.

 

 

Environment

VMware Cloud Director 10.5.x

VMware Cloud Director 10.6.x

Resolution

Windows Users

1. Open your Notepad as Administrator
2. Navigate/open the following Directory C:\Windows\System32\drivers\etc and select hosts file
3. Edit your hosts file using the following format
    <Internal IP Address> <Public FQDN>
    Example
    192.168.1.100 cloud-director.PublicFQDN.com
    192.168.1.101 cloud-director.PublicFQDN.com
    
Please ensure that you are replacing your actual internal IP from your Cloud Director Primary Cell and your Public Cloud Director FQDN

4. Save your setting
5. To apply these steps immediately on your Windows Machine, clean your DNS cache.
    Open the Command Prompt as Administrator and run:

    ipconfig /flushdns

    Open PowerShell and select Run as administrator

    Clear-DnsClientCache

6. After applying these steps, please check that your Windows Machine can resolve your FQDN using your IP/FQDN with your hosts details
    nslookup <Cloud Cell IP or Public Cloud Director Domain>

If you are using Powershell, please use Resolve-DnsName <Cloud Cell IP or Public Cloud Director Domain>

 

For Linux Users

1. Open a Terminal Window or Command Line

2. Edit hosts file using: vi nano /etc/hosts

3. Add a new line at the bottom of this file with the Private IP of the Cloud Director Cell followed by the Public FQDN.

<Internal IP Address> <Public FQDN>

Example

192.168.1.100 cloud-director.PublicFQDN.com
192.168.1.101 cloud-director.PublicFQDN.com

4. Save settings using Esc key, type :wq! and hit the Enter key

5. Type the following command in the terminal to flush the DNS cache (If this command is not working, check your Linux distribution)

sudo systemd-resolve --flush-caches

6. After applying these steps, please check that your Windows Machine can resolve your FQDN using your IP/FQDN with your hosts details
    nslookup <Cloud Cell IP or Public Cloud Director Domain>

Additional Information

 

  • If you no longer need to bypass the Load Balancer, simply remove or comment out the line you added in the hosts file.
  • Keep in mind that changes to the hosts file only affect the local machine and do not propagate across the network.