Share via

Azure migrate to managed disks but "Operation is not allowed since VM has an extension in failed state"

Moya 0 Reputation points
2026-03-31T09:33:37.53+00:00

We have received an email saying we need to migrate our Azure VMs to managed disks.

However, when we try to migrate to managed disks, we get told:

"Operation is not allowed since VM has an extension in failed state"

There are several extensions, the most troublesome seems to be OmsAgentForLinux. We never installed this nonsense, it seems to have been added automatically; we just want it gone.

We tried uninstalling from the azure portal, but it timed out and said it did not uninstall successfully. Ever since it has been hanging in state "Transitioning."

We have then also tried out the purge script directly on the affected VMs; the purge script executed successfully, but still the portal shows OmsAgentForLinux as Transitioning and prevents us from migrating to managed disks.

We do not actually want managed disks, we are just migrating because we got an email saying that we need to; but we also do not want any of these extensions that are now blocking us from migrating.

How can we get rid of them?

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.


1 answer

Sort by: Most helpful
  1. Ankit Yadav 13,215 Reputation points Microsoft External Staff Moderator
    2026-04-01T15:45:16.3466667+00:00

    Hello Moya,

    Thank you for getting back to me.

    I tried to reproduce the issue but for me the extension was installed successfully and thus was removed successfully both from Portal UI and via Az-cli commands.
    Can you please try to re-provision the extension, this will get the extension in successful provisioning state then you can easily remove the extension?

    Steps to provision the extension:

    1. Create a Log Analytics Work-space (let's say test-oms-workspace) in same region as your VM.
    2. Get the work-space id and the workspace key using below commands respectively.
    az monitor log-analytics workspace show --resource-group <rg> --workspace-name test-oms-workspace --query customerId -o tsv   
    
    az monitor log-analytics workspace get-shared-keys --resource-group <rg> --workspace-name test-oms-workspace --query primarySharedKey -o tsv
    
    1. Install extension using below command,
    az vm extension set \
    --resource-group <rg-name> \
    --vm-name <vm-name> \
    --name OmsAgentForLinux \
    --publisher Microsoft.EnterpriseCloud.Monitoring \
    --version 1.13.0 \
    --settings '{"workspaceId":"<id>"}' \
    --protected-settings '{"workspaceKey":"<key>"}'
    
    
    1. Goto to VM portal and see if the extension is in successful provisioning state or not. If yes try to delete it, if not, let us know about it.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.