Documentation and Best Practices

Learn how to use Cloudability and get the most out of our cloud cost management tool.

Follow

Stage 2: Enable memory metrics collection

About Utilization Metrics

Apptio Cloudability leverages performance data sourced from Azure Monitor Metrics to provide insightful and accurate rightsizing recommendations for Azure Compute Virtual Machines. There are two levels of metrics available from Azure Monitor Metrics - Platform and Guest OS metrics.

  • Platform metrics -
  • Guest OS metrics -
    • Key Metrics: Memory Utilization
    • Requires a Guest OS agent and diagnostic data sync
    • Enabled after completing the steps below

Please note, that Guest OS metrics are not required for Rightsizing Recommendations, but strongly encouraged. Our analysis has shown that by understanding memory usage, we can make even better informed and sized recommendations, typically resulting in 10-20% additional cost savings.

Setup

The following steps detail how to enable memory metrics in Azure Monitor Metrics for Cloudability.  Some steps vary base on the resource's operating system.

A. Enable Azure Monitor 

  1. In the Azure portal search, type “virtual machines”.
  2. Under Services, click Virtual machines.
  3. In the Virtual machines page, select the desired virtual machine

    2-vm-list.jpg

  4. In the left panel, under Monitoring, click Insights.
  5. Click Enable.


    a-enable-azure-monitor.png
  6. In the Workspace Subscription dropdown, select the subscription you want.

    5-vm-insights-config.jpg

  7. In the Choose a Log Analytics Workspace dropdown, select or create a log analytics workspace.
  8. Click Enable
  9. Alternatively,  you can enable this via Azure Policy for Virtual Machines 

 

B. Enable managed identity

A system-assigned managed identity enables Azure resources to authenticate to cloud services without storing credentials in code. For more information, see What are managed identities for Azure resources?

  1. In the Azure portal search, type “virtual machines”.
  2. Under Services, click Virtual machines.
  3. In the Virtual machines page, select the virtual machine you want.
  4. In the left panel, click Identity.
  5. Under Status, select On.

    b-managed-identity.png

  6. Click Save.

 

C. Enable diagnostic data sink

  1. In the Azure portal search, type “virtual machines”.
  2. Under Services, click Virtual machines.
  3. In the Virtual machines page, select the virtual machine you want.
  4. In the left panel, under Monitoring, click Diagnostic Settings.
  5. In the Overview tab, under the Diagnostics storage account drop-down, select or create a diagnostics storage account.

    10-vm-diagnostics-landingpage.jpg

  6. Click Enable guest-level monitoring.
    • NOTE: If the Enable guest-level monitoring option is disabled, you must enable managed identity for this resource. 

  7. Click Save.

D. Send diagnostic data to Azure Monitor (Windows Only)

  1. In the Azure portal search, type “virtual machines”.
  2. Under Services, click Virtual machines.
  3. In the Virtual machines page, select the virtual machine you want.
  4. In the left panel, click Diagnostic settings.
  5. In the Sinks tab, under Send diagnostic data to Azure Monitor, select Enabled.

    13-vm-diag-sink-config.jpg

  6. Click Save.

NOTE: If the Send diagnostic data to Azure Monitor option is disabled, you must enable managed identity for this resource.

 

E. Install Diagnostics Agent (Linux Only)

For Linux virtual machines, a diagnostics agents is required. For more information, see Collect custom metrics for a Linux VM with the InfluxData Telegraf agent.

  1. Remotely log into the VM (SSH).
  2. Copy and run one of the following scripts to download, install, and start the agent.

For Ubuntu and Debian:

  # 1. download telegraf package
  wget https://dl.influxdata.com/telegraf/releases/telegraf_1.13.4-1_amd64.deb
  # 2. install the package
  sudo dpkg --install --force-confnew telegraf_1.13.4-1_amd64.deb
  # 3. generate the new Telegraf config file in the current directory
  telegraf --input-filter cpu:mem --output-filter azure_monitor config > azm-telegraf.conf
  # 4. replace the example config with the new generated config
  sudo cp azm-telegraf.conf /etc/telegraf/telegraf.conf
  # 5. stop the telegraf agent on the VM
  sudo systemctl stop telegraf
  # 6. start the telegraf agent on the VM to ensure it picks up the latest configuration
  sudo systemctl start telegraf

For RedHat and CentOS:

  # 1. download telegraf package
  wget https://dl.influxdata.com/telegraf/releases/telegraf-1.13.4-1.x86_64.rpm
  # 2. install the package
  sudo yum localinstall -y telegraf-1.13.4-1.x86_64.rpm
  # 3. generate the new Telegraf config file in the current directory telegraf
  --input-filter cpu:mem --output-filter azure_monitor config > azm-telegraf.conf
  # 4. replace the example config with the new generated config
  sudo cp azm-telegraf.conf /etc/telegraf/telegraf.conf
  # 5. stop the telegraf agent on the VM
  sudo systemctl stop telegraf
  # 6. start the telegraf agent on the VM to ensure it picks up the latest configuration
  sudo systemctl start telegraf

 

Troubleshooting

A. Linked to Log Analytics Workspace

The virtual machine resources need to be connected to a log analytics workspace, to verify this:

  1. In the Azure portal search, type “log analytics workspaces”.
  2. Under Name, click the desired Log Analytics Workspace
  3. Under the Workspace Data Source section, click Virtual Machines In the left panel
  4. View the grid to verify each resource is associated with a Log Analytics Workspace.

ts-vm-associated-with-law.png

 

B. Required Metrics Namespace

Ensure the metrics namespace has been enabled, by following these steps:

  1. In the Azure portal search, type “virtual machines”.
  2. Under Monitoring, click Metrics
  3. In the Metrics panel, click the Metric Namespace dropdown.
    • For Windows resources, you should see three:
      -- Virtual Machine Host
      -- Guest (classic)
      -- Virtual Machine Guest  <-- Source of memory metrics

      ts-metrics-namespace-windows.png

    • For Linux resources, you should see four:
      -- Virtual Machine Host
      -- Guest (classic)
      -- telegraf/mem   <--- Source of memory metrics
      -- telegraf/cpu

      ts-metrics-namespace-linux.png

 

 

 

Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.