Azure / Azure/WALinuxAgent

VM Agent Status Perpetually "Not Ready" if user has dhcp disabled for a VM.

Open
#2,781 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
581
Forks
397
Avg merge
2d 15h
Merged PRs (30d)
9

Description

VM is using static IP, DHCP is disabled.
waagent is version v2.8.0.11 installed on Centos 8.2 (upgrading to rocky shortly).

waagent is running, getting this log:
2023-03-08T15:51:58.451299Z WARNING Daemon Daemon Failed to send DHCP request: [DhcpError] timed out

Agent Status for VM in Azure portal is "not ready".

Core Issue:
Agent is hard coded to think dhcp is always enabled, which is not the case here.

Temporary fix that resolves:
cd /usr/local/lib/python/site-packages/azurelinuxagent/common
vi dhcp.py
#Change the following line to the one at the bottom.
#dhcp_available = self.osutil.is_dhcp_available() -- always seems to return true....
dhcp_available = None

systemctl restart waagent

Immediately agent status becomes ready in Azure portal.

Contributor guide

Open the contributing guide

Research direction

Read common/dhcp.py, especially the is_dhcp_available() path, and reproduce the reported warning with DHCP disabled on a static-IP VM. Done means waagent no longer remains Not Ready in the Azure portal for that configuration after restarting it with systemctl restart waagent.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, centos, linux, python
Domain
cloud, networking, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.