Add existing VMs to the LB #9564
Unanswered
ArthiSaravana
asked this question in
Q&A
Replies: 2 comments 9 replies
-
any update on this |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here is a NIC Template that offers all different way to add to different types of LB's https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/x.NIC-NIC.bicep |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
need to add 2 existing vms to the LB. but not sure how to add the existing 2 vms(existing 2nic card) to the LB.
below is the code for creating a load balancer help me to add back end pool(2existing vm) into it
param loadbalancerName string = 'loadbalancer213'
param location string = 'australiaeast'
var lbSkuName = 'Standard'
var lbFrontEndName = 'frontend-ip'
var subnetid = resourceId('Microsoft.Network/virtualNetworks/subnets', virtualNetworkName, subnetName)
var virtualNetworkName = 'lb-vnet'
var subnetName = 'lb-subnet'
var BackendPoolName = 'BackendPool1'
var lbprobe = 'ProbeA'
resource internalloadbalancer 'Microsoft.Network/loadBalancers@2022-07-01' = {
name: loadbalancerName
location: location
sku: {
name: lbSkuName
}
properties: {
frontendIPConfigurations: [
{
name: lbFrontEndName
properties: {
subnet: {
id: subnetid
}
privateIPAddress: '10.0.0.7'
privateIPAllocationMethod: 'Static'
}
}
]
backendAddressPools: [
{
name: BackendPoolName
}
]
loadBalancingRules: [
{
name: 'HTTPRule'
properties: {
frontendIPConfiguration: {
id: resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', loadbalancerName, lbFrontEndName)
}
backendAddressPool: {
id: resourceId('Microsoft.Network/loadBalancers/backendAddressPools', loadbalancerName, BackendPoolName)
}
frontendPort: 80
backendPort: 80
enableFloatingIP: false
idleTimeoutInMinutes: 4
protocol: 'Tcp'
enableTcpReset: false
loadDistribution: 'Default'
probe: {
id: resourceId('Microsoft.Network/loadBalancers/probes', loadbalancerName, lbprobe)
}
}
}
]
probes: [
{
name: lbprobe
properties: {
intervalInSeconds: 5
numberOfProbes: 2
port: 80
probeThreshold: 2
protocol: 'TCP'
}
}
]
}
}
Beta Was this translation helpful? Give feedback.
All reactions