cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynatrace OneAgent Azure VM extension installation with Terraform

slelann
Newcomer

Hi,

I suceeded in installing Dynatrace OneAgent to monitor a Kubernetes cluster deployed in Azure Container Service and I would like to do the same on Azure Compute VMs.

It was also successful through Azure Portal UI to set the OneAgent extension to VM but I tried to use Hashicorp Terraform for the same purpose and then I encountered an issue.

My terraform resource file looks like this :

resource "azurerm_virtual_machine_extension" "instance" {
name = "vmname_oneAgentLinux"
location = "westeurope"
resource_group_name = "my_resource_group_name"
virtual_machine_name = "vm_name"
publisher = "dynatrace_publisher"
type = "oneAgentLinux"
type_handler_version = "2.3.0.1"
settings = "{ \"tenantId\" : \"mytenant\" , \"token\" : \"mytoken\" }"
}

Firstly I thought type and type_handler_version were not mandatory (as it was not in azure portal) but I found values indicated in https://www.dynatrace.com/support/help/cloud-platf...

So I've got supposed valid values by requesting azure cli:

az vm extension image list --location westeurope -p dynatrace.ruxit -o table

Name Publisher Version
---------------------- --------------- ---------
oneAgentLinux dynatrace.ruxit 1.150.0.0
oneAgentLinux dynatrace.ruxit 1.151.0.0
oneAgentLinux dynatrace.ruxit 1.151.0.1
oneAgentLinux dynatrace.ruxit 1.99.1.1
oneAgentLinux dynatrace.ruxit 1.99.1.2
oneAgentLinux dynatrace.ruxit 1.99.2.0
oneAgentLinux dynatrace.ruxit 1.99.2.1
oneAgentLinux dynatrace.ruxit 2.2.0.0
oneAgentLinux dynatrace.ruxit 2.2.0.1
oneAgentLinux dynatrace.ruxit 2.2.0.2
oneAgentLinux dynatrace.ruxit 2.3.0.0
oneAgentLinux dynatrace.ruxit 2.3.0.1

But whatever value I use, I get the same error when I apply my terraform :

* azurerm_virtual_machine_extension.instance: compute.VirtualMachineExtensionsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidParameter" Message="The value of parameter typeHandlerVersion is invalid." * azurerm_virtual_machine_extension.instance: 1 error(s) occurred:

Did someone here already have same issue with the installation of oneAgent on Azure VMs (not forcibly with terraform but arm or powershell, azure cli... ) ?

Thanks

Sylvain

PS: additional informations : Azure Datacenter Westeurope

Terraform 0.10

terraform provider.azurerm 1.1.2

5 REPLIES 5

slelann
Newcomer

uh uh, just 5 minutes later, I found the trick : type_handler_version parameter value seems to be limited to 2 digits.

So with the value "2.3" my terraform plan goes on... but failed with a new more comprehensible message 🙂

Long running operation terminated with status 'Failed': Code="VMExtensionProvisioningError" Message="VM has reported a failure when processing extension 'oneAgentLinux'. Error message: \"Installation failed: ERROR: Downloading agent installer failed!\"."

Probably a problem of availability of this version of agent in my datacenter location

slelann
Newcomer

Still struggling with versions...

I'm confused with the actual OneAgent version (1.139) and the list of versions provided by Azure extensions (1.99.*, 1.150.*, 1.151.*, 2.2.*, 2.3.*)

Is it resolved ?


nmommaerts
Newcomer

I got the same problem, but I had entered my Azure TenantID in the tenantid field, while it should be the Dynatrace environment id.


S_Wilhelm
Observer

 

Just in case someone else is looking for a way to set additional properties, like host tags, etc.

You can provide even more properties by using the installerArguments property:

\"installerArguments\":\"--set-host-tag=stage=dev --set-host-tag=application=example_application --set-monitoring-mode=fullstack\"

 

Kind regards

Sebastian

Featured Posts