Removing WALinuxAgent from your Azure instance

by

in

Azure’s supplied Linux images come preinstalled with the Azure Linux Agent, a process that manages virtual machine interaction with the Azure Fabric Controller, such as providing the oh-so-useful availability status and the VM name to Azure. It also performs self-updates, by the way.

This is great for as long as you are not using the Standard B1ls instance. The instance has a burstable 1 vCPU and 0.5 GiB memory configuration, and so in reality, you will see ~390 MiB memory usable. You will literally hear your Azure instance screams for removing the Azure Linux Agent, when it gets randomly choked periods of memory and CPU spikes, even if you are not doing anything.

With the culprit identified, the following steps would allow you to disable and uninstall WALinuxAgent.

sudo systemctl stop walinuxagent
sudo systemctl disable walinuxagent
sudo waagent -deprovision -force
sudo rm -rf /var/lib/waagent
sudo rm /etc/waagent.conf

Before you do so, you will want to read this and if you are using a custom cloud-init based deployment, read this.

If you regret your decision to remove WALinuxAgent, you may reinstall it by:

sudo apt-get update
sudo apt-get install walinuxagent

Or simply restore an earlier snapshot.


Comments

One response to “Removing WALinuxAgent from your Azure instance”

  1. imydou Avatar
    imydou

    根据官方的文档
    https://github.com/Azure/WALinuxAgent/wiki/VMs-without-WALinuxAgent

    卸载应执行
    systemctl stop walinuxagent
    sudo apt-get remove walinuxagent

    实测Ubuntu20.04不执行apt-get remove walinuxagent,还可执行waagent

Leave a Reply