Documentation and Best Practices

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

Follow

Stage 2: Enable utilization metrics collection

Apptio Cloudability leverages performance data via Azure Monitor Metrics to provide insightful and accurate resource optimization recommendations (Rightsizing) for Azure Virtual Machines. The following steps explain how to enable Azure Monitor Metrics for Cloudability.

1. Enable Azure Monitor for VMs
2. Enable managed identity for VMs
3. Enable diagnostic data sink to Azure Monitor
-Step 1: Enable guest-level monitoring via the Azure portal
-Step 2: (Windows only) Enable sync to Azure Monitor via the Azure portal
4. (Linux only) Enable Diagnostics agent

1. Enable Azure Monitor for VMs

Enable Azure Monitor for VMs by using one of the following methods. You can A) enable each VM manually, or B) enable multiple VMs at once via Policy.

A. Enable each VM manually

  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.

    2-vm-list.jpg

  4. In the left panel, under Monitoring, click Insights.
  5. Click Enable.
  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.

B. Enable Multiple VMs via Policy

  1. In the Azure portal search, type “policy”.
  2. Under Services, click Policy.
  3. In the left panel, under Authoring, click Assignments.
  4. Click Assign initiative.

    P3-policy-assignments-landingpage.jpg

  5. Click the ellipsis after Scope.

    P5.assign-initiative-landingpage.jpg

  6. In the right panel, select the Subscription and Resource Group you want from the drop-downs.
  7. Click Select.
  8. Click the ellipsis after Initiative definition.
  9. In the right panel, under Search, type ‘monitor’.

    P8-search-for-monitor.jpg

  10. Select the definition [Preview]: Enable Azure Monitor for VMs.
  11. Click Select.
  12. Click Review + create.
  13. Your new Initiative is added to the Assignments tab.

For more information, see Enable Azure Monitor for VMs (preview) by using Azure Policy.

2. 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?.

You can enable managed identity either A) when creating a virtual machine, or B) afterward, via the Identity option in the Azure portal.

A. Enable managed identity when creating a VM

  1. In the Azure portal search, type “virtual machines”.
  2. Under Services, click Virtual machines.
  3. In the Virtual machines page, click Create virtual machine.
  4. From the Management tab, under Identity, select On.

    identity-creating-vm.jpg

  5. When you’re finished configuring your VM, click Review + create.

B. Enable managed identity via the Identity option in the Azure portal

  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.

    7-vm-identity-landingpage.jpg

  5. Under Status, select On.
  6. Click Save.

3. Enable diagnostic data sink to Azure Monitor

Step 1: Enable guest-level monitoring via the Azure portal

  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.
  7. Click Save.

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

Step 2: (Windows only) Enable sync to Azure Monitor via the Azure portal

  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.

4. Enable Diagnostics Agent (Linux Only)

Enable memory metrics for Linux VM for Azure Monitor

  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

For more information, see Collect custom metrics for a Linux VM with the InfluxData Telegraf agent.

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

0 Comments

Article is closed for comments.