0
votes

Hi I am working with a single http endpoint that i can send requests to. I am working with Azure load balancer which should balance requests between 4 VMs. According to what i have read so far. The load balancer should use a round robin method to do the routing.

How do I make http requests in such a way that I am sure I have hit all the VMs and not just the first VM. I suppose I must do a concurrent request of some sort. Maybe an asynchrounous parallel request? The VMs have identical data so its pertinent that I hit all 4 VMs with 4 requests. I hope my question is clear enough

Also I have the VM server instance Id's. How do i use the id's to specify the server i want to hit in the request.

1
Azure Load balancer is not RR (see docs.microsoft.com/en-us/azure/load-balancer/…). Other services could be (see docs.microsoft.com/en-us/azure/traffic-manager/…). Can you clarify ""its pertinent that I hit all 4 VMs with 4 requests".JohnMark13
Yes i need to somehow tell the server which vm i want to hit in my request. I am new to this so i dont know if there are default headers forexample that allow specifying the server instanceflexxxit
I think that you are looking at the wrong infrastructure pattern as you should probably be trying not to direct your traffic to a specific server (unless you are after "sticky sessions" which can sort of be achieved using "Source IP affinity mode" again see docs.microsoft.com/en-us/azure/load-balancer/…. Can you update your question to reflect what you are trying to achieve and maybe why?JohnMark13

1 Answers

1
votes

The load balancer should use a round robin method to do the routing.

As JohnMark13 said, Azure load balancer have two modes: Hash-based distribution mode and Source IP affinity mode.

For now, Azure Load balancer does not support specify VM id to access it, just support IP address + port.

As a workaround, I think we can set NAT rules, set different ports to different VMs, so we can access different VMs with IP address and different ports.

enter image description here
More information about Azure load balancer and NAT rules, please refer to this link.