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?
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.
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
Install the latest Azure Powershell, currently the latest version is 2.0.1:http://aka.ms/webpi-azps
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
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.
-
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
 
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; "/>
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; "/>
-
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; "/>
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; "/>
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
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