Event ID 2: Session "WindowsAzure-GuestAgent-Metrics" failed to start with the following error: 0xC0000035

You may notice the following error on an Azure VM in the event log under Applications and Services Logs, Microsoft, Windows, Kernel-EventTracing, Admin:

Log Name: Microsoft-Windows-Kernel-EventTracing/Admin
Source: Microsoft-Windows-Kernel-EventTracing
Event ID: 2
Task Category: Session
Level: Error
Keywords: Session
Computer: CLJul8WS08R2A
Session "WindowsAzure-GuestAgent-Metrics" failed to start with the following error: 0xC0000035

This error can be safely ignored. In scenarios where you are monitoring for event log errors and want to prevent the error from being logged, you can use the following steps.

Run the following commands from an elevated PowerShell prompt.

  1. Set the MetricsSelfSelectionSelected value in the registry to 2.

    New-ItemProperty -path HKLM:\SOFTWARE\Microsoft\GuestAgent -name 'MetricsSelfSelectionSelected' -value 2 -type dword –force

  2. Restart the Windows Azure Telemetry Service service.

    Restart-Service WindowsAzureTelemetryService

  3. Stop the WindowsAzure-GuestAgent-Metrics event trace session.

    logman stop 'WindowsAzure-GuestAgent-Metrics' -ets

Note that setting MetricsSelfSelectionSelected to 2 in the registry and stopping the WindowsAzure-GuestAgent-Metrics event trace session has no impact on the normal functioning of the VM agent.

The logman command achieves the same as clicking Stop on the WindowsAzure-GuestAgent-Metrics under Event Trace Sessions in Performance Monitor: