Azure - Can't create load balancer for the ScaleSet - azure

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.

Related

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

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

Adding public IP for existing virtual machine scale set

I have an existing virtual machine scale set. Currently I have one virtual machine there. I would like to update the scale set and add a public IP to the virtual machine or somehow create a load balancer that will allow me to "access" the virtual machine from the outside. I am new to azure so I have no idea how it all works.
Any ideas/help will be appreciated, Thanks!
You can create a load balancer with the public IP, then add the virtual machine scale set into the backend pool of the load balancer. Finally, create the NAT rules for each instance. Create the load balancer following the steps in Create a Basic Load Balancer by using the Azure portal.

Azure - change the load balancer attached to a Service Fabric VM Scale Set from one to another, OR change existing from public to private

We have a public load balancer attached to the VM scale set of our Service Fabric Cluster. I have created a new internal private load balancer to attach to the VM's for better security. But when I go into Add in the Backend Pool configuration of the new private load balancer, the option to add the VM scale set is not there. In fact the screen looks different than the Add screen in the public load balancer: (the public load balancer has a dropdown menu for "Associated to" where you choose Virtual Machine Scale Set, whereas the private load balancer doesn't have that menu - it just has a virtual network dropdown and single Virtual Machine dropdown, and neither have what I need in their lists). I've attached two screenshots for reference.
My questions:
Is the reason I'm not seeing the option for the Service Fabric VM Scale Set in the private load balancer options because it's still attached to the public load balancer?
If not, how would I achieve this outside using the Portal?
If so, will I interrupt traffic to the Service Fabric Cluster if I remove the public load balancer from the VM scale set?
Finally, is there a way to just make the existing public load balancer private?
For your questions:
No, there are options difference between the basic and standard SKU load balancer in the web UI.
You could create an internal basic load balancer. Then associated the VMSS to the backend pool of new load balancer.
Since the access frontend IP change, it will interrupt traffic.
It's not possible to make the existing public load balancer private directly, you need to create a new internal load balancer, then reply the old load balancer configuration with the new one. Then remove the old one.
You can refer to this quickstart to create a Basic load balancer by using the Azure portal and select type Internal.
no, this is probably a UI limitation, you can have both internal and public load balancers attached to the same vmss\vm
yes, it will
no, there is no way of doing that
what you could do - attach internal load balancer, migrate traffic to that and detach public load balancer after that.

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