Επεξεργασία

Κοινή χρήση μέσω


Azure Monitor Dependency virtual machine extension for Linux

The Azure Monitor for VMs Map feature gets its data from the Microsoft Dependency agent. The Azure VM Dependency agent virtual machine extension for Linux installs the Dependency agent on Azure virtual machines. This document details the supported platforms, configurations, and deployment options for the Azure VM Dependency agent virtual machine extension for Linux.

Prerequisites

Operating system

Because the Azure VM Dependency agent works at the kernel level, operating system support is also dependent on the kernel version. As of Dependency agent version 9.10.* the agent supports * kernels. The following table lists the major and minor Linux OS release and supported kernel versions for the Dependency agent.

Note

With Dependency agent 9.10.15 and above, installation is not blocked for unsupported kernel versions, but the agent will run in degraded mode. In this mode, connection and port data stored in VMConnection and VMBoundport tables is not collected. The VMProcess table may have some data, but it will be minimal.

Distribution OS version Kernel version
Red Hat Linux 8 8.6 4.18.0-372.*el8.x86_64, 4.18.0-372.*el8_6.x86_64
8.5 4.18.0-348.*el8_5.x86_644.18.0-348.*el8.x86_64
8.4 4.18.0-305.*el8.x86_64, 4.18.0-305.*el8_4.x86_64
8.3 4.18.0-240.*el8_3.x86_64
8.2 4.18.0-193.*el8_2.x86_64
8.1 4.18.0-147.*el8_1.x86_64
8.0 4.18.0-80.*el8.x86_64
4.18.0-80.*el8_0.x86_64
Red Hat Linux 7 7.9 3.10.0-1160
7.8 3.10.0-1136
7.7 3.10.0-1062
7.6 3.10.0-957
7.5 3.10.0-862
7.4 3.10.0-693
Red Hat Linux 6 6.10 2.6.32-754
6.9 2.6.32-696
CentOS Linux 8 8.6 4.18.0-372.*el8.x86_64, 4.18.0-372.*el8_6.x86_64
8.5 4.18.0-348.*el8_5.x86_644.18.0-348.*el8.x86_64
8.4 4.18.0-305.*el8.x86_64, 4.18.0-305.*el8_4.x86_64
8.3 4.18.0-240.*el8_3.x86_64
8.2 4.18.0-193.*el8_2.x86_64
8.1 4.18.0-147.*el8_1.x86_64
8.0 4.18.0-80.*el8.x86_64
4.18.0-80.*el8_0.x86_64
CentOS Linux 7 7.9 3.10.0-1160
7.8 3.10.0-1136
7.7 3.10.0-1062
CentOS Linux 6 6.10 2.6.32-754.3.5
2.6.32-696.30.1
6.9 2.6.32-696.30.1
2.6.32-696.18.7
Ubuntu Server 20.04 5.8
5.4*
18.04 5.3.0-1020
5.0 (includes Azure-tuned kernel)
4.18*
4.15*
16.04.3 4.15.*
16.04 4.13.*
4.11.*
4.10.*
4.8.*
4.4.*
14.04 3.13.*-generic
4.4.*-generic
SUSE Linux 12 Enterprise Server 12 SP5 4.12.14-122.*-default, 4.12.14-16.*-azure
12 SP4 4.12.* (includes Azure-tuned kernel)
12 SP3 4.4.*
12 SP2 4.4.*
SUSE Linux 15 Enterprise Server 15 SP1 4.12.14-197.*-default, 4.12.14-8.*-azure
15 4.12.14-150.*-default
Debian 9 4.9

Note

Dependency agent is not supported for Azure Virtual Machines with Ampere Altra ARM–based processors.

Extension schema

The following JSON shows the schema for the Azure VM Dependency agent extension on an Azure Linux VM.

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
      "vmName": {
        "type": "string",
        "metadata": {
            "description": "The name of existing Linux Azure VM."
      }
    }
  },
  "variables": {
      "vmExtensionsApiVersion": "2017-03-30"
  },
  "resources": [
    {
      "type": "Microsoft.Compute/virtualMachines/extensions",
      "name": "[concat(parameters('vmName'),'/DAExtension')]",
      "apiVersion": "[variables('vmExtensionsApiVersion')]",
      "location": "[resourceGroup().location]",
      "dependsOn": [],
      "properties": {
          "publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
          "type": "DependencyAgentLinux",
          "typeHandlerVersion": "9.5",
          "autoUpgradeMinorVersion": true,
          "settings": {
              "enableAMA": "true"
        }
      }
    }
  ],
    "outputs": {
    }
}

Property values

Name Value/Example
apiVersion 2015-01-01
publisher Microsoft.Azure.Monitoring.DependencyAgent
type DependencyAgentLinux
typeHandlerVersion 9.5
settings "enableAMA": "true"

Important

Be sure to add enableAMA to your template if you're using Azure Monitor Agent; otherwise, Dependency agent attempts to send data to the legacy Log Analytics agent.

Template deployment

You can deploy Azure VM extensions with Azure Resource Manager templates. You can use the JSON schema detailed in the previous section in an Azure Resource Manager template to run the Azure VM Dependency agent extension during an Azure Resource Manager template deployment.

The JSON for a virtual machine extension can be nested inside the virtual machine resource. Or, you can place it at the root or top level of a Resource Manager JSON template. The placement of the JSON affects the value of the resource name and type. For more information, see Set name and type for child resources.

The following example assumes the Dependency agent extension is nested inside the virtual machine resource. When you nest the extension resource, the JSON is placed in the "resources": [] object of the virtual machine.

{
	"type": "extensions",
	"name": "DAExtension",
	"apiVersion": "[variables('apiVersion')]",
	"location": "[resourceGroup().location]",
	"dependsOn": [
      "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
	],
	"properties": {
        "publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
        "type": "DependencyAgentLinux",
        "typeHandlerVersion": "9.5",
        "autoUpgradeMinorVersion": true,
        "settings": {
            "enableAMA": "true"
        }
	}
}

When you place the extension JSON at the root of the template, the resource name includes a reference to the parent virtual machine. The type reflects the nested configuration.

{
	"type": "Microsoft.Compute/virtualMachines/extensions",
	"name": "<parentVmResource>/DAExtension",
	"apiVersion": "[variables('apiVersion')]",
	"location": "[resourceGroup().location]",
	"dependsOn": [
      "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
	],
	"properties": {
        "publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
        "type": "DependencyAgentLinux",
        "typeHandlerVersion": "9.5",
        "autoUpgradeMinorVersion": true,
        "settings": {
            "enableAMA": "true"
        }
	}
}

Azure CLI deployment

You can use the Azure CLI to deploy the Dependency agent VM extension to an existing virtual machine.


az vm extension set \
    --resource-group myResourceGroup \
    --vm-name myVM \
    --name DependencyAgentLinux \
    --publisher Microsoft.Azure.Monitoring.DependencyAgent \
    --version 9.5

Automatic extension upgrade

A new feature to automatically upgrade minor versions of Dependency extension is now available.

To enable automatic extension upgrade for an extension, you must ensure the property enableAutomaticUpgrade is set to true and added to the extension template. This property must be enabled on every VM or VM scale set individually. Use one of the methods described in the enablement section enable the feature for your VM or VM scale set.

When automatic extension upgrade is enabled on a VM or VM scale set, the extension is upgraded automatically whenever the extension publisher releases a new version for that extension. The upgrade is applied safely following availability-first principles as described here.

The enableAutomaticUpgrade attribute's functionality is different from that of the autoUpgradeMinorVersion. The autoUpgradeMinorVersion attribute doesn't automatically trigger a minor version update when the extension publisher releases a new version. The autoUpgradeMinorVersion attribute indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension won't upgrade minor versions unless redeployed, even with this property set to true.

To keep your extension version updated, we recommend using enableAutomaticUpgrade with your extension deployment.

Important

If you add the enableAutomaticUpgrade to your template, make sure that you use at API version 2019-12-01 or higher.

Troubleshoot and support

Troubleshoot

Data about the state of extension deployments can be retrieved from the Azure portal and by using the Azure CLI. To see the deployment state of extensions for a given VM, run the following command by using the Azure CLI:

az vm extension list --resource-group myResourceGroup --vm-name myVM -o table

Extension execution output is logged to the following file:

/var/opt/microsoft/dependency-agent/log/install.log

Support

If you need more help at any point in this article, contact the Azure experts on the Microsoft Q & A and Stack Overflow forums. Or, you can file an Azure support incident. Go to the Azure support site and select Get support. For information about how to use Azure Support, read the Microsoft Azure support FAQ.