Unable to uninstall extension for azure linux VM

Ashwini kumar 6 Reputation points
2022-03-09T14:38:10.427+00:00

Not been able to work on azure linux VM as enablevmaccess extension is in failed state.VM start is taking 30 mins. not able to take RDP or session of the VM.Tried powershell command to uninstall the extension and tried other powershell commands as well but getting below error:

az : ERROR: (VMAgentStatusCommunicationError) VM 'AZVM' has not reported status for VM agent or extensions. Verify that the OS
is up and healthy, the VM has a running VM agent, and that it can establish outbound connections to Azure storage. Please refer to
https://aka.ms/vmextensionlinuxtroubleshoot for additional VM agent troubleshooting information.
At line:1 char:1

  • az vm run-command invoke -g "AZVM" -n "AZVM" --command-id ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (ERROR: (VMAgent...ng information.:String) [], RemoteException
  • FullyQualifiedErrorId : NativeCommandError

Code: VMAgentStatusCommunicationError
Message: VM 'AZVM' has not reported status for VM agent or extensions. Verify that the OS is up and healthy, the VM has a
running VM agent, and that it can establish outbound connections to Azure storage. Please refer to
https://aka.ms/vmextensionlinuxtroubleshoot for additional VM agent troubleshooting information.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,991 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 25,156 Reputation points
    2022-03-25T07:17:54.46+00:00

    Hello @Ashwini kumar ,

    Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question.
    The main issue here is not only with the extension "enablevmaccess". The reason for not being able to SSH in to this VM could be anything else like there is an issue with teh VM guest agent itself as this error indicates "VMAgentStatusCommunicationError"

    You will not be able to uninstall this extension in case the agent itself is not running as uninstall workflow communicates with the guest agent. This extension is used for resetting the password for VM. So, I suggest focussing on the SSH issue first and then you can fix guest agent issue then the extension issue. Adding troubleshooting steps to fix the SSH issue

    Quick troubleshooting steps:
    Note: After each troubleshooting step, try reconnecting to the VM.

    • Reset the SSH configuration.
    • Reset the credentials for the user.
    • Verify the network security group rules permit SSH traffic.
    • Ensure that a Network Security Group rule exists to permit SSH traffic (by default, TCP port 22).
    • You cannot use port redirection / mapping without using an Azure load balancer.
    • Check the VM resource health.
    • Ensure that the VM reports as being healthy.
    • If you have boot diagnostics enabled, verify the VM is not reporting boot errors in the logs.
    • Restart the VM.
    • Redeploy the VM.

    Reference: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection

    For installation of Vmaccessextension using PS, you can follow https://learn.microsoft.com/en-us/powershell/module/az.compute/set-azvmaccessextension?view=azps-7.3.2

    *If the answer provided on this thread was helpful, please kindly click on **"Accept Answer" and upvote it. If you have extra questions about this answer, please click "Comment" and write your query.**
    What is the impotance of accepting answers in case they helped you:-
    You as original poster by accepting answers will be helping other community members in finding the appropriate solutions in an effective way.*

    0 comments No comments

Your answer

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