Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Task 10: Ensuring reliability of instances in the cloud using Contrail and OpenStack load balancing

 

Goal

In this task, you will see how Contrail can steer the traffic between the virtual networks using the load balancing feature. This helps in controlling the traffic and ensuring reliability of instances in the cloud.

Disclaimer: The steps in this task are only applicable to Juniper’s Cloud Software Trial tool.

Some values and/or information may vary for users executing this task using a non-Juniper trial tool.

 

Step-by-Step Procedure

  1. Open the Contrail web interface in the browser by navigating to https://192.168.250.1:8143.

    Then, login to the Contrail dashboard using the below credentials.

    Username: admin

    Password: contrail123

    Domain: (leave blank)

  2. Create a virtual network called “red-network”. Expand the Subnets tab, and enter a subnet of 1.1.1.0/24. Leave all the other values at default and click on Save to complete the creation of virtual network.

  3. Following the instructions along the lines of step 2, create a 2nd virtual network “green-network” with subnet 2.2.2.0/24.

  4. . Log in to the OpenStack Dashboard.

    Open a new tab in the browser and go to https://192.168.250.1/horizon.

    Log in to the Dashboard using the credentials below.

    Username: admin

    Password: contrail123

    Select the project as “admin”.

  5. Navigate under Project > Instances and click on the “Launch Instance” button on the top right corner to start the creation of a VM.

    • For “Instance name”, enter “red-instance”

    • For “Image name”, enter “Ubuntu-slim”

    • For flavor, enter “m1.small”

    • Click on the “Next” button at the bottom of “Launch instance” window until we navigate to the “Networks” tab.

    • In the “Networks” tab, add red-network as the network to this instance.

    • Click Launch Instance to launch the red-instance.

  6. Repeat step 5 to create two additional VMs, named green-instance and VM-Client.

  7. Create a Neutron load balancer. From the left navigational panel, click Load Balancers.

  8. Log in to the Nova console of red-instance (username/password: contrail/contrail123) and activate root using command: sudo –i (password: contrail123).

    Enter the following command to simulate a HTTP server listening on port 5000. while true;do echo –e “ HTTP/1.1 200 OK\n\n ‘This is VM1’ “ | nc –l 5000;done

  9. Repeat Step 5 for green-instance using the same credentials.

    while true;do echo –e “ HTTP/1.1 200 OK\n\n ‘This is VM2’ “ | nc –l 5000;done

  10. Login to the Nova console of VM-Client and enter the nc client command to connect to load balancer VIP 1.1.1.250 and port 5000. nc 1.1.1.250 5000

    Repeat the same command to verify that the load balancer is alternating between red and green instances