How to add multiple Azure VMSS to one basic tier Azure load balancer? - azure

I am using VMSS with basic tier load balancer and public IP address. When I am doing application update, I want to create new VMSS to make sure it is not affecting the old VMSS. Now I am creating new VMSS with new IP and load balancer. However, I do not want the IP to change. Is there any way to create a new VMSS connecting to an existing basic tier load balancer?

You cannot add multiple Azure VMSS to one Basic tier Azure load balancer.
Azure Basic load balancer only supports virtual machines in a single availability set or virtual machine scale set (this is a single VMSS).
Reference : https://learn.microsoft.com/en-us/azure/load-balancer/skus
However, Standard load balancer supports any virtual machines or virtual machine scale sets (multiple) in a single virtual network.
So, you can easily configure a VMSS with an existing Standard SKU load balancer using the Azure portal:
https://learn.microsoft.com/en-us/azure/load-balancer/configure-vm-scale-set-portal

Related

Creating Virtual Network in multiregion and Created Azure LB for Loadbalancing

I am trying to create Virtual Network in multiregion and Created Azure LB for Loadbalancing in Azure Cloud. It looks like we can loadbalance only same availability set VMs. Can we use Azure LB to load balance a multi region virtual network VMs?
I have never heard of multiple-region virtual networks. VNet is scoped to a single region/location.
If you want to load balancer multi-region VMs, you can look at Cross-region load balancer (Preview). In this case, Azure Standard Load Balancer supports cross-region load balancing.
Reference: https://learn.microsoft.com/en-us/azure/load-balancer/cross-region-overview

How to associate loadBalancingRules, listener and probs in an addition template to an existing load balancer on Azure cloud?

I have created an Azure load balancer with Azure resource manager template, but could not figure out how to associate new listeners, rules and probes defined in an extra template to the existing load balancer.
The motive to do this is utilizing one load balancer to route traffic to several applications running on the same virtual machine scale set through different port.

Azure - Can't create load balancer for the ScaleSet

I created a Scale Set (using a template) with an existing virtual network.
This existing virtual network has already a Load Balancer (with a public IP) with specific VMs.
Now, I can't connect to the VMs in the scale set, There's no option to add the scale set to the Load Balancer or to add the scale set's VMs to the Load Balancer. Creating a new Load Balancer doesn't help.
It seems that the only option for adding a backend pool is using an availability set or a single VM (which is not in the Scale Set).
Is there any way to solve this? to somehow add the Scale Set to the Load Balancer or to connect to it?
The goal was to create the scale set to be in the existing Load Balancer (in the network with the other VMs), but unfortunately it didn't work.
It is not posible to add vms in different availability sets to the same lb. VMSS has its own availability set (by desing). so this is not possible.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ccf69a9c-0a6a-47bc-afca-561cf66cdebd/multiple-availability-sets-on-single-load-balancer?forum=WAVirtualMachinesVirtualNetwork
You can work around by creating vm in the network that will act as a load balancer, but that's obviously not a PAAS solution
The goal was to create the scale set to be in the existing Load
Balancer (in the network with the other VMs), but unfortunately it
didn't work.
It is not possible and no need. Please refer to this official document. Azure VMSS instances are behind a load balancer. Also VMSS's intance could not add to a existing load balancer.
Now, I can't connect to the VMs in the scale set.
Do you create inbound NAT rules for your instance? Also, you could create a jump VM in the same VNet to login one instance. See this question.
If you could not login your VM from a jump VM, it is not a VMSS issue. You should check your instance. If you don't do any change for your instances. You could create a ticket to Azure to solve this issue.

Azure load balancer: NAT redirect RDP to VM, and load balance HTTP to availability set?

It looks like you can't NAT as well as load balance unless it's to the same destination. Once I created the NAT rule (so I can RDP to the load balancer over a custom port, and then that's redirected to my management VM), I cannot create the backend pool to use for HTTP load balancing. I go to backend pools and click create and it already fills in "associated with " and I cannot change that to my web VMs availability set.
I've also tried creating the backend pool first, for which I select the web VM availability set, but then when I create a NAT rule I cannot point to the management VM, only to the availability set/specific VM in that set.
What am I missing? Is there a solution besides recreating the management VM and putting it in the web VM availability set?
I've also tried creating the backend pool first, for which I select
the web VM availability set, but then when I create a NAT rule I
cannot point to the management VM, only to the availability
set/specific VM in that set.
All of these are by design behavior. LB only work for an availability set or a single VM.
Is there a solution besides recreating the management VM and putting
it in the web VM availability set?
No, if you want to use LB to connect to the management VM, we should recreate it and add this VM to that availability set.
If you just want this VM can connect to those VMs behind that LB, we can create this VM in that Vnet, then use management VM's public IP address to login this VM, and use private IP address to connect to those VMs.

Multiple vmss behind single Azure Load Balancer

We have multiple background worker vmss that do not need a public IP to work.
I want to be able to connect to arbitrary vm (e.g. to troubleshoot via rdp, or to collect some snapshots using remote profiler etc).
When there's only one VMSS per load balancer all works like a charm. I've setup nat pools for each port used on VMs and all works fine.
Now, if I'm trying to add one more vmss to the same load balancer (using its own nat / backend pools) the deployment fails with
Virtual Machine /subscriptions/.../resourceGroups/.../providers/Microsoft.Compute/virtualMachines/|providers|Micr
osoft.Compute|virtualMachineScaleSets|...|virtualMachines|0 is using different Availability Set than other Virtual Machines connected to the Load Balancer(s) ...
message.
As far as I know there's no way to set up availability set for vmss. Are there any options but keeping own load balancer/public ip for each VMSS?
UPD I've found similar scheme for VM+Availability Set setup (see ILB endpoint section).
Something like this for VMSS?
Your are right, we can't change availability set for vmss.
if I'm trying to add one more vmss to the same load balancer
As we know, we can't add different availability sets to single load balancer, so we can't add one or more VMSS to the same load balancer.
Are there any options but keeping own load balancer/public ip for each
VMSS?
We have multiple background worker vmss that do not need a public IP
to work.
Are those VMss in same VNet? If yes, we can deploy a new VM in the same Vnet, we can connect to this VM, then use this VM to connect to VMSS instances with internal IP addresses, in this way, this new VM work as a jumpbox. we can use this jumpbox to troubleshoot.
Update:
Is it possible then to have multiple vmss in same VNet and assign own
public api/load balancer for each of it?
Yes, we can create a new Azure VM with public IP, then install HAproxy on it, make this VM work as a load balancer, add all VMSS instances which in the same Vnet to HAproxy backend pool, in this way, we can access this VM's public IP address + your NAT port to connect VMss instance.

Resources