Azure VM Start / Stop / Restart Management (In-bulk)Author - Aammir MirzaUse to manage Azure VMs Start / Stop / Restart operations in bulk. For un-used VMs or Development environment VMs, AzDO pipeline can be schedule run to Shutdown/Startup of VMs based on required hours. As a best prectice in cost savings it reduces the cost for un-used compute. Microsoft best practice (recommendation) for cost savingOptimize virtual machine spend by resizing or shutting down underutilized instances Although certain application scenarios can result in low utilization by design, you can often save money by scheduling shutdown of your virtual machines. The recommended actions are shut down or resize, specific to the resource being evaluated. The advanced evaluation model in Advisor considers shutting down virtual machines when all of these statements are true: The current load doesn’t go above 80% utilization for workloads that aren't user facing. The load doesn't go above 40% for user-facing workloads. Here, Advisor determines the type of workload by analyzing the CPU utilization characteristics of the workload. Also, extension supports Startup of the VMs which can be schedules as the same way like Shut down Automate schedule with Azure DevOps pipeline using AzureVMStart/Stop task. It can reduce the overhead of maintaining / modifying individual Virtual Machine schedules every now and then from Portal or AzCLI. By scheduling the AzDO pipeline with this extension we can Shutdown / Startup computes based on requirement. Extension also provides flexibility to manage VMs based on below possible condition:
Sample evaluation of cost saving within a weekHow much could you save shutting down Non-Production VMs ?
Platform
InstallationDownload the Free 'Azure VM Start/Stop Tasks' from here and populate the below mentioned parameters to get it working ConfigurationClassic Pipeline (UI)Adding the extension using classic pipeline (UI-Based pipeline in AzDO)
Eg:
Eg:
YAML Usage
GIF for referenceRunning STOP action for all the VMs in a single ResourceGroup (or multiple RGs). Using the scheduled (cron) yml pipeline. If you cannot see GIF follow the link Running START action on all VMs within a single ResourceGroup, excluding VM (using VM exclusion). In example used a single VM from single RG. It could be multiple VMs from multiple RGs. If you cannot see GIF follow the link ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. Limitation
UpdatesIssue fixed for incocorrectly giving ERROR at the output/console of the task completion. LicenseSupportemailto: aammir.mirza@hotmail.com |