Task 10: Ensuring reliability of instances in the cloud using Contrail and OpenStack load balancing
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.
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.
Domain: (leave blank)
Create a virtual network called “red-network”. Expand the Subnets tab, and enter a subnet of 188.8.131.52/24. Leave all the other values at default and click on Save to complete the creation of virtual network.
Following the instructions along the lines of step 2, create a 2nd virtual network “green-network” with subnet 184.108.40.206/24.
. 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.
Select the project as “admin”.
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.
Repeat step 5 to create two additional VMs, named green-instance and VM-Client.
Create a Neutron load balancer. From the left navigational panel, click Load Balancers.
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
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
Login to the Nova console of VM-Client and enter the nc client command to connect to load balancer VIP 220.127.116.11 and port 5000. nc 18.104.22.168 5000
Repeat the same command to verify that the load balancer is alternating between red and green instances