Create arm VMS and public-facing load balancing with the Azure CLI on global Azure

Source: Internet
Author: User

The new portal and arm have been officially released on Azure, Global. In the future, traditional portals and ASM will fade out gradually.

China Azure will launch a new portal management interface and ARM functionality (i.e. IaaS v2) in the second half of this year. This article will create VMS and load balancing in arm mode via the Azure CLI command line.

In ASM mode, we often use the endpoint and load balancing SLB capabilities. Also in arm mode, SLB is a very important feature. But the most important difference between arm and ASM is that LoadBalancer is no longer associated with a property on a VM. That is, VMS can have no public IP and can provide services without load balancing.

This deployment model is more consistent with the deployment model for enterprise applications. In the enterprise application, only the front-end presentation layer will have the connection with the external network, and the other application layer, database layer and so on are not allowed to communicate with the outside world.

This feature is the case with VMS deployed through arm.

As shown in:

Load Balancing distributes Web requests to VMs that are added to the load balancer.

The following step-by-step creation of each component and VM that is load balanced.

1. Create Resource Group:

Azure Group Create HWLB Eastasia

2. Create a storage account in the resource group

Azure Storage Account create-g hwlb-l Eastasia--type LRS Hweastasia

3. Create a vnet in the resource group

10.0. 0.0/ +

4. Create a subnet in your vnet

Azure Network vnet Subnet Create HWLB hwlbvnet hwlbsubnet-110.0. 0.0/

5. Create Public-ip

4

6. Create LoadBalancer

Azure Network lb Create hwlb hwlb Eastasia

7. Define the front-end IP of the loadbalancer and the PUBLIC-IP bindings just defined

Azure Network lb FRONTEND-IP create hwlb hwlb hwlbfndip-i Hwlbpip

8. Create back-end IP address pool (no VMS joined at this time)

Azure Network lb Address-pool create hwlb hwlb Hwlbbndip

9. Define the NAT rule for this LoadBalancer

22122  A Azure Network lb inbound 22322  A

10. Create a load balancing rule for LoadBalancer

 the  -T Hwlbfndip-o Hwlbbndip

11. Create a loadbalancer health check rule

" TCP "  the  the 4

12. Check the created load balancer

Azure Network lb show hwlb hwlb

At this point, load balancing has been created. The VMs are created below.

13. Create two NICs and apply NAT rules to two network cards

Azure Network Nic create-g hwlb-n hwlbnic1-be--subnet-name hwlbsubnet-1--subnet-vnet-name hwlbvnet-d"/subscriptions/xxxx/resourcegroups/hwlb/providers/microsoft.network/loadbalancers/hwlb/backendaddresspools /hwlbbndip"-E"/subscriptions/xxxx/resourcegroups/hwlb/providers/microsoft.network/loadbalancers/hwlb/inboundnatrules/ssh1"Eastasia Azure Network nic Create-G hwlb-n hwlbnic2-be--subnet-name hwlbsubnet-1--subnet-vnet-name hwlbvnet-d"/subscriptions/xxxx/resourcegroups/hwlb/providers/microsoft.network/loadbalancers/hwlb/backendaddresspools /hwlbbndip"-E"/subscriptions/xxxx/resourcegroups/hwlb/providers/microsoft.network/loadbalancers/hwlb/inboundnatrules/ssh2"Eastasia

14. Create two VMS

 Azure VM Create--resource-group hwlb--name hwlbweb1--location eastasia--vnet-name hwlbvnet--vnet-subnet-name HWL Bsubnet-1 --nic-name hwlbnic1-be--availset-name hwlb-avset-- Storage-account-name hweastasia-u hengwei-p xxxx-z standard_a1--os-type Linux--image-urn openlogic:CentOS:6.5 : 6.5 . 20150904  azure vm create --resource-group hwlb--name hwlbweb2--location Eastasia-- Vnet-name hwlbvnet--vnet-subnet-name hwlbsubnet-1 --nic-name hwlbnic2-be-- Availset-name hwlb-avset--storage-account-name hweastasia-u hengwei-p xxxx-z standard_a1--os-type Linux--image-urn o Penlogic:centos:6.5 : 20150904  

15. Define the distribution mode of LoadBalancer

The SLB in ASM has 3 distribution Mode, which is default (5-tuple), SourceIP (2-tuple), SourceIP Protocol (3-tuple). In order to implement session Sticky, we will choose the distribution mode of SOURCEIP. The specific commands are as follows:

Azure network lb rule set-d SourceIP hwlb hwlb lbrule

This command requires the latest version of Azure CLI-0.9.15. If the version is not enough, please upgrade.

In the ARM environment, LoadBalancer is implemented in a similar way to ASM, but better than ASM.

Create arm VMS and public-facing load balancing with the Azure CLI on global Azure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.