Optimizing Microsoft Azure Virtual Machine Instances

Optimizing Microsoft Azure Virtual Machine Instances

#340550

This use case includes Microsoft Azure cloud infrastructure data collection, analysis, and generation of right-sizing recommendations for Virtual Machine instances using a combination of Densify Console and Densify API operations. The recommendations, which can be downloaded on demand via Densify API, provide extensive details that can be used to feed downstream automation engines in either JSON or terraform-map formats.

A comprehensive PDF report can be downloaded for each instance to supply supporting evidence for a recommendation; this can be reviewed by a system owner before approvals are given for the suggested changes.

The diagram below provides an overview of the three major processes in Densify:

  1. Data Collection—Collect Azure data into Densify.

    Use the Densify API or the Densify Console to initiate this process.

  2. Analysis—Analyze collected data based on pre-defined policies to make recommendations.

    The analysis process is initiated automatically after data collection completes. Results can be immediately pulled from the Densify API or pushed to a webhook URI once the analysis is complete.

  3. Reporting Database Update—Update reporting database tables with analysis results for reporting.

    The reporting database update process is scheduled to run nightly after the analysis refresh process. The Densify Console Azure optimization opportunity report and the Impact Analysis and Recommendation reports are available after the reporting database update is complete.

Note:  Before you can collect Microsoft Azure cloud infrastructure data in Densify, you need to create and configure an Azure account with access to your Azure subscriptions. See Microsoft Azure Data Collection Prerequisites or Microsoft Azure Data Collection Prerequisites for for a Service Principal for details.

The steps below outline a typical workflow to optimize Microsoft Azure Virtual Machine instances:

  1. From the Densify API: Authenticate using JWT—Retrieve token to authenticate each subsequent API call.
  2. Collect Azure data through the Densify API or the Densify Console. See Configuring a Microsoft Azure Connection for details.
  3. After data collection completes, an analysis is initiated for each subscription associated with the Azure account configured for data collection.

  4. API: List All Azure Analyses—Query for the analysis entity of each subscription for which data was collected (from step 1). You can use the returned analysis entity to check for status and recommendations.
  5. API: Poll for Analysis Status—Check for data collection and analysis status. The recommendations are available when analysis is complete.
  6. API: Download Results to Apply Recommendations—Retrieve recommendations to implement, manually or forward to your orchestration engine.
  7. Alternatively, you can Add a Webhook to an Existing Azure Analysis to push recommendations to an external URI once the next analysis process completes.

  8. API/Console (optional): Download Impact Analysis and Recommendation Instance Report for system owners. This can achieved from the Densify API or from the Densify Console. See Viewing the Impact Analysis and Recommendation Report for details of the report from the Densify Console.
  9. Console (optional alternative): Review Azure Virtual Machine optimization opportunity report from the Densify Console. See Azure for details. The optimization opportunity report is available after the nightly reporting database update.
  10. Console (optional): Review Azure optimization policy settings used during analysis from the Densify Console. Contact [email protected] for details.

Postman Collection

Densify provides a Postman collection of sample API requests for working with your public cloud environments. See the Postman Collection.

Authenticate using JWT

Use the /authorize resource to retrieve an authenticated token to make subsequent API calls. See Authorize for details. By default, the token expires in 5 minutes, therefore you will need to ensure that you have an active token for each Densify API request.

Initiate Azure Data Collection and Analysis

The following example shows you how to initiate Azure data collection and analysis, and send the results to a WebHook. See Analysis Azure Analyze.htm for details.

List All Azure Analyses

To see a list of all Azure analyses currently in Densify, use the /analysis/azure resource. See List all analyses for a particular platform and vendor for details of the resource operation.

Poll for Analysis Status

Use the "analysisStatus" resource element from the List All Azure Analyses response to poll for status of the data collection and analysis. See Check for analysis status for details of the resource operation. The analysis is complete and recommendations are available when "analysisStage": "Completed".

Add a Webhook to an Existing Azure Analysis

You can add a webhook definition to an existing Azure analysis. The analysis will push the optimized results to the specified webhook URI. See Add webhook to an analysis for details on adding a webhook.

Download Results to Apply Recommendations

Use the /analysis/cloud/azure/<analysisId>/results resource to retrieve recommendation results and forward to orchestration engine. See Analysis: Azure Recommendations for details.

Download Impact Analysis and Recommendation Instance Report

Use the rptHref resource element provided in the instance recommendation output to download a PDF Impact Analysis and Recommendation Report for each instance. This report is available after a reporting database update, which is scheduled to run nightly. See rptHref and Example: Downloading an Impact Analysis and Recommendation Report for details.