Azure / WALinuxAgent

Microsoft Azure Linux Guest Agent
http://azure.microsoft.com/
Apache License 2.0
534 stars 371 forks source link

[BUG] Provisioning Agent crash when /etc/sysconfig/network-scripts/ifcfg-eth1 is missing #1457

Open jasonzio opened 5 years ago

jasonzio commented 5 years ago

Describe the bug On multi-NIC VMs, under some circumstances when eth1 is the primary NIC, the agent crashes when attempting to update /etc/sysconfig/network-scripts/ifcfg-eth1 to set DHCP_HOSTNAME.

Distro and WALinuxAgent details (please complete the following information):

Additional context

  1. Workaround is to just touch an empty file with that name.
  2. The code fix is in common.osutil.redhat.set_dhcp_hostname() - if filepath isn't an existing file, skip the invocation of fileutil.update_conf_file() or touch the file into existence before calling update_conf_file(). Alternatively, add a new named option to fileutil.fileutil.update_conf_file() which creates the file first if it's entirely missing (overriding the value of chk_err).
jasonzio commented 5 years ago

Proper telemetry should be emitted when this error occurs so we can more easily see which distros and scenarios lead to it.