Giter VIP home page Giter VIP logo

anfhealthcheck's Introduction

ANFHealthCheck

A PowerShell Runbook that will provide useful information about the health of your Azure NetApp Files (ANF) resources and optionally remediate various issues. Schedule this to run every day for the most up-to-date info delivered straight to your inbox.

Note - This update requires the following updated modules:

  • Az.Accounts, v2.13.1
  • Az.NetAppFiles, v0.13.1
  • Az.VMware, v0.5.0

Change Log

  • October 31, 2023 - updated backup status module to use API until PowerShell modules are updated (Thank you, Erik!)
  • October 5, 2023 - updated tested version of Az.Accounts, Az.NetAppFiles, and Az.VMware
  • February 16, 2023 - script now disallows a null/empty value for the subscription Id ($subId), use 'ALL' to run against all subscriptions
  • February 16, 2023 - added paramters to control actions/behavior related to reporting, remediation, and remediation dry run
  • February 16, 2023 - added variables to control if the report is sent via Email and/or to Blob independently
  • August 8, 2022 - added functionality to remediate volume capacity based on desired headroom, more info can be found under the 'Remediation' heading below
  • August 8, 2022 - create new module to report on IP addresses used within each VNet that contains an ANF delegated subnet
  • August 8, 2022 - created new module to show ANF/AVS datastores attached to AVS
  • June 21, 2022 - added 'Volume Backup Status' module to show Azure NetApp Files backup status
  • June 21, 2022 - added Capacity Pool column to all volume related modules
  • June 21, 2022 - fixed Regional Quota module to use new powershell cmdlet, Get-AzNetAppFilesQuotaLimit
  • Jan 14, 2022 - added parameter to set a custom subject line and report heading via -Subject parameter flag
  • Jan 14, 2022 - fixed regional quota API call
  • Sept 13, 2021 - added columns to CSV output, pool name, account, etc.
  • Sept 01, 2021 - added CSV attachments to email for volume and pool details
  • Sept 01, 2021 - added field 'active directory domain' to NetApp account module
  • Sept 01, 2021 - created new module to show under-utilized pools only
  • Sept 01, 2021 - created new module to show under-utilized volumes only, optionally only above a certain size
  • Sept 01, 2021 - fixed display for 'manual' qos type in pool detail display
  • Sept 01, 2021 - regional quota module now retrieves actual regional quota from API
  • July 27, 2021 - added hash table to store hard coded regional quotas until API is available. Default is 25TiB unless another value is specified for a given region.

Disclaimer

ANFHealthcheck 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.

Control the scope

The '-subId' parameter must be used to specify the scope of ANFCapacityManager

Specify a single SubId: -SubId 'subscriptionIDhere'

Specify a comma-delimited list of SubIds: -SubId 'sub-Id-one,sub-Id-two,sub-Id-three'

Specify all SubIds: -SubId 'ALL'

What does it look like?

https://seanluce.github.io/ANFHealthCheck/sample_output.html

Deploy from the Runbook Gallery

Deploy this script from the Runbook Gallery. Edit the 'Send-Email' function with your SMTP server, credentials, email address, etc.

Clone this repo and run locally

Clone this repo to run locally on your machine. Use the parameter '-OutFile myfile.html' to write the output locally instead of sending via Email.

Current Modules

  • NetApp Account Summary
  • Capacity Provisioned Against Regional Quota (more info)
  • Capacity Pool Utilization
  • Volume Utilization Above x%
  • Volume Utilization
  • Volume Utilization Growth (x days)
  • Volume Snapshot Status
  • Volume Backup Status
  • Volume Replication Status

Remediation

ANFHealthCheck can remediate some health issues that it finds.

ANFVolumeCapacityRemediation

This function will reduce the volume quotas if the headroom is above a desired threshold. Headroom is defined as the percent free space in the volume. To specify a volume's desired headroom, apply the tag titled 'anfhealthcheck_desired_headroom' to the volume resource and give it an integer value of the headroom percentage desired for that volume. For example, if 20% free space is desired, set the tag to an integer value of 20.

To enable volume capacity remediation, set the parameter '-volumeRemediation' to $true.

To enable volume capacity remediation 'dry run' mode, set the parameter '-volumeRemediation' to $true and the parameter '-remediationDryRun' to $true. This will provide a report of the remediation actions required, but will not modify any resources.

ANFPoolCapacityRemediation

This function will reduce the capacity pool sizes if the headroom is above a desired threshold. Headroom is defined as the percent free space in the capacity pool that is not allocated to volumes. To specify a capacity pool's desired headroom, apply the tag titled 'anfhealthcheck_desired_headroom' to the capacity pool and give it an integer value of the headroom percentage desired for that capacity pool. For example, if 20% free space is desired, set the tag to an integer value of 20.

To enable pool capacity remediation, set the parameter '-poolRemediation' to $true.

To enable pool capacity remediation 'dry run' mode, set the parameter '-poolRemediation' to $true and the parameter '-remediationDryRun' to $true. This will provide a report of the remediation actions required, but will not modify any resources.

Planned Modules

  • ??? - Please open an issue if you have ideas for new modules!

Requirements

  • An SMTP server to send the emails. You can use SendGrid or any other SMTP server of your choice.
  • Azure NetApp Files - of course! :D

Need help?

Please open an issue here on GitHub and I will try to assist as my schedule permits.

Disclaimer

This script is not supported by NetApp or Microsoft.

Is this useful?

If you find this useful, please share and/or say hello on social media.

anfhealthcheck's People

Contributors

agovi avatar seanluce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

anfhealthcheck's Issues

ANF Capacity Pool | Pool Consumed Size

@seanluce first of all, thank you for providing this ANF Health Check, it is very helpful. it captures almost all the required information.
actually this is not an issue, rather a request. is it possible to include Pool Consumed Size (Current sum of all volume logical sizes) of the capacity pool?

Thank you in advanced.

Run the ANFHealthCheck on local computer

Hi Sean,

I am trying to test the ANFHealthCheck runbook on my local computer first before try it through azure automation but when i run it nothing happened.

I am using the below parameter to run it locally.

.\ANFHealthCheck.ps1 -SubID xxxxxx -OutFile myfile.html

I only see the below msg and nothing happened, its been running for long time without any progress or error.

"Unable to Connect-AzAccount using these parameters" and after this msg it select the subscription and then nothing happened.

Update - ANF Backups Vault

ANF Backup structure was updated by Azure. They now use Azure Backup VAULT.
Some of the volumes now report a 0 count and no entry in the last backups.

This started after August 21st.

The recommended API call now is

az rest --method GET --uri '/subscriptions/*****/resourceGroups/resourcegroupname/providers/Microsoft.NetApp/netAppAccounts/netappaccountname/backupVaults/testVault/backups?api-version=2022-11-01-preview'

Requirement - Need to enable the vault and add all the volumes before this works.

Can you check if the fix that was applied on 23rd August could have impacted this backup reporting issue? and I see this issue only in South Central US as of today and not in other regions.

This issue can be reproduced as well โ€“ see below even the commands are not working โ€“

anf-hc-issue-image-1

Same command I run for volumes ctc019 and ctc018, for volume ctc018 I can see backups but for ctc019 only Null value [ ] even though this volume has backups that are visible in GUI.

anf-hc-issue-image-2

Incorrect variable used for Dry Run control

On line 280 in ANFHealthCheck.ps1 the wrong variable is used.

The line currently reads:
if($enableVolumeCapacityRemediationDryRun -eq $false) {

it needs to be changed to:
if($enablePoolCapacityRemediationDryRun -eq $false) {

ANF Backup Status

Can the ANF Backup status be included on a per volume basis, e.g. completed or failed? For auditing purposes, can we report on ANF backup status over a length of time?

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.