Upgraded ubuntu on VM, the VM stops working after 15 mins of uptime and has to be restarted

Saral Joshi 20 Reputation points
2025-04-15T08:31:14.8866667+00:00

Hello everyone.

I received an email from azure "Action recommended: Upgrade to Ubuntu 22.04 LTS, Ubuntu 24.04 LTS, or Ubuntu Pro before 31 May 2025"

So I followed the link in the documentation to upgrade my ubuntu from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS https://documentation.ubuntu.com/server/how-to/software/upgrade-your-release/index.html

I normally ssh into this machine and do development work on it. The upgrade went normally, and I was able to connect via ssh. However, when I actually started working on it, after 15-20 mins the connection broke. I checked the portal and saw the warning "virtual machine agent status is not ready". This machine was working normally prior to the upgrade. I debugged the ssh settings/ ssh config etc. but found no issues.

I then deallocated the machine, and started it again. The warning went away and I was able to connect and work again for 15/20 more mins until the warning came back. This time I restarted the machine, and got the same results (able to connect for 15/20 mins) until the warning came back. I then went into the troubleshooter, it recommended redeploy, I did that and then reapply -- I did those separately. But the issue still persists.

I've been working on this machine for around 2 years, only after the upgrade the issue has come up. I came across this post where it is recommended to create a new VM rather than follow ubuntu upgrade process. However, there was no mention of a possible problem in the email from azure, similar for the 18 to 20 upgrade.

What can I do to troubleshoot this issue? I have other VM's where I need to upgrade, so I need to make a solid process. Thank you.

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

Accepted answer
  1. Dharani Reguri 345 Reputation points Microsoft External Staff
    2025-04-15T11:07:07.6233333+00:00

    Hi Saral Joshi,

    I understood that you have done in-place upgrade from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS to one of your VMs and after upgrading you have notified that VM agent is not ready but after deallocation of the machine it worked but only for 15-20 min.

    An in-place upgrade to a new major version breaks the connection between the data plane and the control plane of the VMs. Consequently, Azure capabilities such as Auto guest patching, Auto OS image upgrades, Hotpatching, and Azure Update Manager won't be available. To access these features, we recommend that you create a VM instead of performing an in-place upgrade for the other VMs. Before creating new VM, please take a disk backup of old VM and attach it to new VM.

    So, I suggest checking the current version of the walinuxagent and installing the latest update and also configure auto update for agent and then restart the waagent service.

    Please refer to the documents below:

    https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/upgrade-canonical-ubuntu-18dot04-lts#upgrade-to-ubuntu-2004-lts-or-ubuntu-2204

    https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/update-linux-agent?tabs=ubuntu

    Please let me know if you have further questions.

    If it was helpful, please click "Upvote" on this post and "Accept" the answer for the benefit of community.

    User's image

    Thank you.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.