Multiple vmss behind single Azure Load Balancer - azure

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.

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

Cannot access Azure VM Scaleset ip address externally

I have created a Virtual Machine Scaleset in Azure
This scaleset is made up of 5 VMs
There is a public ip
When I do a ping on my public ip I get no response, nor do I get a response with the full name, e.g.
myapp.uksouth.cloudapp.azure.com
Is there something I have missed?
I am wondering if I have to add my machine's IP somewhere?
I am trying to remote into the machines within the scaleset eventually!
This scaleset will be used for azure service fabric
Paul
If you deploy your scale set with "public IP per VM", then each VM gets its own public IP: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-networking#public-ipv4-per-virtual-machine. However, this is not the default in the portal. In the portal, the default is to create a load balancer in front of the scale set with a single public IP on the LB (today, at least; no guarantee it will stay this way). It also comes with NAT rules configured to allow RDP/SSH on ports 50000 and above. They won't necessarily be contiguous, though (at least in the default configuration), so you will need to examine the NAT rules on the load balancer to see which ports are relevant. Once you do, you should be able to do ssh -p <port-from-nat-rule> <public-ip> to ssh in (or similar in your RDP client for Windows).
When I do a ping on my public ip I get no response
Azure does not support ping.
For test, you can use RDP/SSH public IP address with different ports to test the connection.
Are you create VMSS with Azure marketplace? If yes, the Azure LB will configured.
If the load balancer created by your self, please check LB probes, backend pools(all vms should in that backend pools), load balancer rules and NAT rules.
Also you can configure log analytics for Azure load balancer to monitor it.

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.

Virtual Machine Scale Sets

I have a test azure subscription, I have created a Virtual Machine Scale Sets.
There are no errors in the scale set.
How do I connect to VM's and make my server to put in a load?
Can I connect with RDP to my Scale set VM's ? is this allowed?
If you create VMSS via Azure portal Marketplace, we can't add inbound NAT rules to use RDP to login the VMSS instances, we can't RDP them directly.
So if you want to login those instances, we can create a new VM in the same Vnet(same Vnet can connect by the private IP address), and use the private IP to RDP.
How do I connect to VM's and make my server to put in a load?
By default, we can use load balancer public IP address and NAT port to RDP VMs behind the VMss.
Can I connect with RDP to my Scale set VM's ? is this allowed?
You can create a windows VM in the same Virtual Network, this VM work as a jumpbox, then use this vm to RDP those instances via private IP address.
Another way, modify template to add NAT rules.
More information about VMss and NAT rules, please refer to this link.

Resources