Deploying auto-extended Linux VMSS using arm templates (1)

Source: Internet
Author: User

In the ASM version or Classic mode prior to Azure, users can achieve some degree of automatic scaling (auto scaling) with PAAs services such as the Azure Website,azure Cloud service, but with many limitations and drawbacks, For example, it can only be used on PAAs platforms, with extended periods, inability to support custom images, inability to support Linux, and so on, so is there a service on Azure that gives our enhanced PAAs the ability to expand automatically, At the same time allowing users to have the maximum control ability as with the IaaS virtual machine?

A new service, called the Virtual Machine Extensions collection (Virtual Machine sCale sETS), is introduced in Azure in the latest explorer (ARM) mode. Enables true automation scaling (auto scaling) capabilities, providing very good feature support for scenarios where large concurrency requires automatic scaling, such as:

    • Fine-grained performance collection and processing (performance data can be collected every minute, with a minimum of 5 minutes to expand or contract as a processing window)

    • Support for Linux and, of course, windows

    • Supports custom mirroring for customers and does not need to be pre-deployed like previous cloud services

    • Deploy hundreds of servers in minutes

    • Services such as load balancers, high-availability collections, application gateways, etc. can be consolidated in an extended set

    • Supports multiple different types of measures (Cpu/memeory/network/disk) for scaling

In this article, we describe how to create a Linux VMSS on the Azure China platform through arm templates and PowerShell to automate the expansion. For what is arm, what is arm template, arm and ASM comparison differences, etc. see my other blog.

  1. First make sure you have an account for Azure in China and are able to log in to the Azure portal in the preview version normally:

    https://portal.azure.cn

  2. Install the latest Azure Powershell, currently the latest version is 2.0.1:http://aka.ms/webpi-azps

  3. Azure provides a lot of sample templates for users to use, users can easily download, modify and apply these templates, all templates are on GitHub, the specific address is as follows:

    Https://github.com/Azure/azure-quickstart-templates

  4. All templates are JSON files, can be modified by themselves, found in the above address template "201-vmss-ubuntu-autoscale", and download Azuredeploy.json and Azuredeploy.parameters.json file.

  5. Opens the Azuredeploy.json file first, a basic arm template with 3 parts in addition to the basic information, such as schema and contecntversion: Parameters,variables,resources

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/ 845013-20160909120024848-1966410494.png "style=" border:0px; "/>

    parameters: Define the parameter values you want to enter externally, such as the size of the virtual machine, the name of the image, and so on

    variables: Default variables such as storage type, network address, API version and so on

    resources: The system resources and services you use, such as networks, virtual machine extensions, load balancing, and so on

     

  6. Open Azuredeploy.json file, first need to modify Ubuntu image, in China the latest version of Ubuntu 14 is 14.04.3-lts

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/845013-20160909120025613-945381365. PNG "style=" border:0px; "/>

    Modified to:

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/845013-20160909120026551-297109246. PNG "style=" border:0px; "/>

  7. All stored endpoint addresses are global and need to be modified to China:

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/845013-20160909120027129-61488622. PNG "style=" border:0px; "/>

    Modified to:

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/845013-20160909120027441-2141053645. PNG "style=" border:0px; "/>

  8. For Linux diagnostics storage endpoint, this place should pay special attention to, in addition to the need to modify the stored endpoint, but also need to add storage metrics table endpoint, Otherwise the entire VMSS cannot collect the correct data to the corresponding table, nor does it work:

    650) this.width=650; "src="/HTTP/ Images2015.cnblogs.com/blog/845013/201609/845013-20160909120027723-985275162.png "style=" border:0px; "/>

    P style= "margin:10px auto;" -Modified to:

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/ 201609/845013-20160909120028051-989596748.png "style=" border:0px; "/>

     

  9. Let's take a look at auto scaling, when you define auto scaling, you can first determine a capacity, such as the minimum number of VMS, the default number, and the maximum number of extensions:

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/845013-20160909120028457-764522685. PNG "style=" border:0px; "/>

    Then we need to define the rules for auto-scaling, under what circumstances to increase the instance, under what circumstances to reduce the instance, in this example, we define the processor's percentusertime, every 1 minutes to collect data, every 5 minutes as a time window, if the average value is greater than 60%, then automatically expand, Add one instance at a time:

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/845013-20160909120029113-1332779287. PNG "style=" border:0px; "/>

  10. From the above steps can be seen, you get the template on GitHub can not be used directly, because there are more parameters for the global azure, need to make some changes, directly modify the template I have been shared on GitHub above, you can also go to the following address download use:

    Https://github.com/kingliantop/azurelabs/tree/master/AzureChinaARMTemplate/VMSS-Linux-Autoscale

  11. Open the parameter file Azuredeploy.parameters.json, this file is where you set parameters for the template, such as what kind of VM size you want to use, user name password, how many VMs to start with, etc.:

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/845013-20160909120029566-1487293693. PNG "style=" border:0px; "/>

    For example, my parameter file is as follows:

    650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201609/845013-20160909120030004-1127456117. PNG "style=" border:0px; "/>


This article is from the "cloud Big Data Life" blog, make sure to keep this source http://cloudapps.blog.51cto.com/3136598/1851033

Deploying auto-extended Linux VMSS using arm templates (1)

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.