Git Product home page Git Product logo

anfcapacitymanager's Introduction

ANFCapacityManager

An Azure Logic App that manages capacity based alert rules and automatically increases volume sizes to prevent your Azure NetApp Files volumes from running out of space.

Change Log

  • July 27, 2021 - Increased v3.1 -> v4.0
  • July 27, 2021 - Added separate alert for Volume full warning only. Use this value to notify your team without automatically growing the volume.
  • July 26, 2021 - Auto Grow amount now accepts percent-based values (20%) or static values with 't' for 'g'. i.e. '500g' to grow by 500 GiB or '2t' to grow by 2 TiB.
  • April 16, 2021 - Added NetApp Account name to metric rule names to guarantee resource name uniqueness.
  • April 12, 2021 - Added logic to check if pool resize is complete before attempting to resize volume. Changed 'put' methods to 'patch' to avoid wiping out tags and snapshot policies.
  • March 14, 2021 - CRR Source Volumes; added logic to autogrow function to increase CRR target capacity pool if required. Logic App will need contributor access to target volume's resource group.
  • March 3, 2021 - Change volume metric from "Volume Consumed Size" to "Percentage Volume Consumed Size"

Alert Management

  • When an Azure NetApp Files Capacity Pool or Volume is created, ANFCapacityManager creates a metric alert rule based on the specified percent consumed threshold.
  • When an Azure NetApp Files Capacity Pool or Volume is resized, ANFCapacityManager modifies the metric alert rule based on the specified percent capacity consumed threshold. If the alert rule does not exist, it will be created.
  • When an Azure NetApp Files Capacity Pool or Volume is deleted, the corresponding metric alert rule will be deleted.

Capacity Management (New!)

  • Optionally, when an Azure NetApp Files Volume reaches the specified percent consumed threshold, the volume quota (size) will be increased by the percent specified between 10-100%.
  • If increasing the volume size exceeds the capacity of the containing capacity pool, the capacity pool size will also be increased to accomodate the new volume size.
  • Because CRR target volumes will be increased to match the source, ANFCapacityManager will now verify there is sufficient space in the target volume's capacity pool and increase capacity as needed.
  • For an exmaple of how this works, click here.

Prerequisites and Permissions

  • The Logic App will need 'contributor' access to your ANF resrouce group (or subscription) and 'contributor' access to the resource group where it will be creating the alerts as well as the resource group it is deployed to.

  • You will need to have an Alert Action group already created prior to installing the Logic App. This Action group will be associated with all capacity based alerts that get created by the Logic App. This action group is triggered when a Capacity Pool or Volume has reached the full threshold. This Alert Action group should probably notify the appropriate people via email or SMS.

Disclaimer

This logic app (ANFCapacityManager) is provided as is and is not supported by NetApp or Microsoft. You are encouraged to modify to fit your specific environment and/or requirements. It is strongly recommended to test the functionality before deploying to any business critical or production environments.

Installation

Deploy to Azure

Deploy to Azure Gov

IMPORTANT: Follow all installation steps completely!

  1. Click the button above to deploy this Logic App to Azure. Complete the following fields:

    • Resource group - this is where the Logic App will be deployed.
    • Location - this is the region where your Logic App will be deployed.
    • Logic App Name - any name you would like, the default is recommended.
    • Target Resource Group for Alerts - new alerts will be created in this resource group.
    • Target Resource Group to Monitor - leave this field blank to monitor your entire subscription.
    • Capacity Pool % Full Threshold - This determines the consumed threshold that triggers an alert for capacity pools. A value of 90 would cause an alert to be triggered when the capacity pool reaches 90% consumed.
    • Volume Percent Grow Threshold - This determines the consumed threshold that triggers an alert for volumes and triggers auto grow. A value of 80 would cause an alert to be triggered when the volume reaches 80% consumed.
    • Volume Percent Warn Threshold - This determines the consumed threshold that triggers an alert for volumes. A value of 70 would cause an alert to be triggered when the volume reaches 70% consumed.
    • Existing Action Group's Resource Group - this is the resource group that contains your existing Action Group.
    • Existing Action Group for Capacity Notifications - this is the action group that will be triggered for capacity based alerting. This should be pre-created by you. This action group could send email/sms, or anything else you would like.
    • Auto Grow Amount - Percent of the existing volume size or GiB (g) or TiB (t) to automatically grow a volume if it reaches the % Full Threshold specified above. A value of 0 (zero) will disable the AutoGrow feature. To specify
  2. Give your new Logic App permissions to read, create, and modify resources within your environment: Navigate to Resource groups, choose the resource group that you specified for 'Target Resource Group for Alerts'. Choose 'Access control (IAM)' from the menu. Click the '+ Add' button and choose 'Add role assignment'. For the 'Role', choose Contributor. For 'Assign access to', choose Logic App, now select 'ANFCapacityManager' (or the name you specified in step 1). Finally, click the 'Save' button. Repeat as needed to give the Logic App the required access:

    • Resource Group containing ANFCapacityManager: 'Contributor'
    • Resource Group where Alert Rules will be created: 'Contributor'
    • Subscription (or Resource Group) being monitored: 'Contributor'

    Add Role to RG

  3. IMPORTANT: Run the Logic App manually to build the supporting resources: Navigate to your Logic App and choose Run Trigger, Manual. Running the Logic App manually kicks off a special workflow that does the following:

    • Creates an Action Group called 'ANF_LogicAppTrigger[_monitor_rg]', this action group is called when any of the four below alerts are triggered. The action group calls the logic app when a new volume or capacity pool is created, modified, or deleted.
    • Creates an Activity Log Alert rule called 'ANF_VolumeModified[_monitor_rg]' to trigger the Logic App whenever a volume is created or modified.
    • Creates an Activity Log Alert called 'ANF_PoolModified[_monitor_rg]' to trigger the Logic App whenever a capacity pool is created or modified.
    • Creates an Activity Log Alert called 'ANF_VolumeDeleted[_monitor_rg]' to trigger the Logic App whenever a volume is deleted.
    • Creates an Activity Log Alert called 'ANF_PoolDeleted[_monitor_rg]' to trigger the Logic App whenever a pool is deleted.
    • NEW! Creates capacity based Metric Alert rules for existing volumes and capacity pools.

Once ANFCapacityManager is installed successfully you should experience the following behavior: When an Azure NetApp Files Capacity Pool or Volume is created, modified, or deleted, the Logic App will automatically create (or modify, or delete) a capacity based Metric Alert rule with the name 'ANF_Pool_accountname_poolname' or 'ANF_Vol_accountname_poolname_volname'. In addition, if you provided a value greater than 0 (zero) for the 'AutoGrow Percent Increase' field, the Logic App will automatically increase the volume capacity by the percent specified if a volume reaches the consumed threshold.'

Modifying Alert Thresholds and AutoGrow Amount

You can modify the ANFCapacityManager capacity thresholds and AutoGrow percent as needed after deployment: Navigate back to Logic Apps, choose your Logic App, and select 'Logic app designer' from the left hand menu.

Modify the three variables as required:

  • Set Capacity Pool Alert Percentage (consumed)
  • Set Volume Alert Percentage (consumed)
  • Set Volume AutoGrow Percent

Trigger a manual run of the Logic App. This will modify all of the existing Metric alert rules based on the new value specified.

Please reach out if you have any questions or feature requests.

I'd love to hear what you think of this Logic App. Say hello on Twitter.

anfcapacitymanager's People

Contributors

seanluce avatar binarysta 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.