azurepowershellvirtual-machineremote-desktop

Virtual machine agent status is not ready- Not able to take RDP in Azure


Suddenly I am not able to take the RDP of the azure Machine. There is error that the virtual machine agent status is not ready

I checked that RDP connectivity is OK.

Tried to find from the internet to re-install the agent in that VM but not found any solution yet.

Even i can not reset the password from the Portal also. Not sure how to get in the machine.

Appreciate the help if anyone knows any solution to this.

enter image description here


Solution

  • We've had this a few times, where simply rebooting isn't enough. There seem to be various fixes, listed in the order I'd consider attempting them:

    If you stop and then start the VM, the stop causes it to be deallocated (which a reboot doesn't) - in most cases that will resolve the issue.

    Similarly, redeploy and reapply as suggested in Aatif Akhter's answer will stop-start the device, and also helps the VM get back to a valid/healthy state. Note: this is not deploying a new, blank VM, but rather fixing the existing VM (just to reassure those who find the term redeploy a bit scary).

    If you still have issues, you can resize the VM (pick something similar); again, that seems to give it a bit more of a push (likely it makes it more likely that the VM will be reprovisioned on a different host, thus more likely to avoid the underlying issue.

    Beyond that, check the Boot Diagnostics page - sometimes that will show you a screenshot explaining the issue (e.g. a System Recovery Options screen or similar). In this case the issue seems more at OS level than just a hosting glitch. For this, you're probably best off restoring the VM from an old backup... Before doing this consider the impact - i.e. a lot of servers just run logic / don't hold data, so going back a week will have negligable impact - but some servers will hold stateful data (obvious examples are database servers and file servers; though application/web servers can have stateful content too); so this comes with risk.

    If your system has multiple disks and you know that only the OS is on your C drive (or only your OS and easy-to-reinstall programs), whilst anything stateful is on data disks, you can issue a fresh VM, then detach your data disks from your unhealthy VM and attach them to the new, healthy one.

    We've also found issues with the VM's resource definition, rataher than on the OS disk... To fix that we recover the VM from a healthy backup using the create new virtual machine option, then switch the OS and DataDisks from the faulty VM with those in the recovered VM, and the recovered VM works without any loss of data (as the disks contain the stateful content we care about).

    Beyond this you're in really painful territory. Raise a support ticket with MS for their assistance to see if they can give you any options not suggested here / shed more light on what's causing your issues. ... Or these documents have some other good tips to help you progress with issue invesigation: