Creating virtual NICs

Virtual NICs are created with New-AzureRmNetworkInterface. Run the following command twice—once for each virtual machine that will attach to the load balancer. The names to use for the NICs should be myVM3 and myVM4, so that they match the new VMs being deployed:

New-AzureRmNetworkInterface `
-ResourceGroupName "VMLab" `
-Name myVM3 `
-Location "EastUS" `
-Subnet $vnet.Subnets[0] `
-LoadBalancerBackendAddressPool $lb.BackendAddressPools[0]

It's important that you call your virtual NICs myVM3 and myVM4, because when you deploy the virtual machines in the following step, the process will automatically attach the NICs to the corresponding VMs. Instead of creating new NICs, the virtual machine deployment process will simply update the existing NICs that you've provisioned. This simplifies the process of creating and attaching NICs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.31.159