Coder Social home page Coder Social logo

irekromaniuk / azurevmsscustomautoscale Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zivshtaeinberg/azurevmsscustomautoscale

0.0 1.0 0.0 753 KB

Custom logic for auto scaling Azure Virutual Machive Scale Sets (VMSS) based on Azure Function App

C# 99.84% HTML 0.16%

azurevmsscustomautoscale's Introduction

Azure VMSS Custom Auto Scale

Currently Azure Virtual Machine Scale Sets (VMSS) doesn't support custom logic based auto scaling.

This solution was developed for real customer need, It based on Azure Function App which triggered by timer and samples ServiceBus or SQL Database stored procedure to get current load on VMSS, Azure Function then adds or removes VMs accordingly to configured threshold.

Please select the samples product: ServiceBus or SQL Database in the concole application project or in the Azure Function project.

You can clone this repo and create your own custom logic, just create a new class library and implement ILoadWatcher interface.

There's also console app for testing locally.

alt tag

alt tag

Requirements

  • Azure Function App
  • VMSS
  • Register a new application in Azure Active Directory (need to be global admin in order to do that)
  • Create application Key, save this secret, you will need that later for deployment
  • Give the application "Owner" role on VMSS
  • Install Visual Studio Tools for Azure Functions
  • Create SQL Database and/or ServiceBus Topics or and Q.
  • Create Application Insights.

Scaling Logic Parameters

  • These paramters decides if input data is X & Y will the scaling will be up with Z VM'S or down.
  • Please decide where to store the scaling logic parameters to be store, the options are Database or File.

Deployment

  • Open solution in visual studio 2015 update 3
  • Build solution
  • Publish Azure Function project named "vmssAutoScale" into your Azure Function App
  • Set Azure Function App settings:
  <appSettings>
    <add key="MaxScale" value="maximum server capacity limit"/>
    <add key="MinScale" value="minimum server capacity limit"/>
    <add key="MaxThreshold" value="maximum threshold for auto scale, above this value autoscaler will add one server to vmss"/>
    <add key="MinThreshold" value="minimum threshold for auto scale, below this value autoscaler will remove one server to vmss"/>
    <add key="SQLConnectionString" value="sql server connection string which holds logic for autoscale"/>
    <add key="ClientId" value="application key in azure active directory"/>
    <add key="ClientSecret" value="application secret in azure active directory"/>
    <add key="TenantId" value="active directory id"/>
    <add key="SubscriptionId" value="azure subscription id which holds vmss"/>
    <add key="ResourceGroup" value="vmss resource group"/>
    <add key="VmssName" value="vmss name"/>
    <add key="AzureArmApiBaseUrl" value="https://management.azure.com/"/>
    <add key="VmssApiVersion" value="2016-03-30"/>
  </appSettings>

azurevmsscustomautoscale's People

Contributors

guybartal avatar zivshtaeinberg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.