Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] waagent delete resolv.conf between reboots #1878

Closed
alv000h opened this issue Apr 30, 2020 · 9 comments
Closed

[BUG] waagent delete resolv.conf between reboots #1878

alv000h opened this issue Apr 30, 2020 · 9 comments

Comments

@alv000h
Copy link

alv000h commented Apr 30, 2020

Description:

in our RHEL7.7 systems DNS resolution is missing between reboots because waagent deletes /etc/resolv.conf always... the unique available fix to circumvent this behavior is set immutable flag in /etc/resolv.conf (this is fairly very problematic, nobody else imagine setting that flag in that file...)

So, that is the same as in #1151 #1164 #1215 #754 and #855 (cloud-init, fixed by not deleting cloud-init files that waagent have not created)

waagent should not be deleting files that it didn't create At least not system critical files.

resolv.conf belongs to a package in the network stack and if waagent messes with it this will generate system malfunction and system package problems (if we check integrity of package it will report that the package have problems because some files were deleted).

Distro and WALinuxAgent details

  • Distro and Version: RHEL 7.7
  • WALinuxAgent version 2.2.38-2 (latest version available from official RedHat extras channel)
@pgombar
Copy link
Contributor

pgombar commented May 1, 2020

Hey @trstringer, @anhvoms could you take a look at this? Thanks.

@pgombar pgombar added the triaged label May 1, 2020
@alv000h
Copy link
Author

alv000h commented Jun 3, 2020

Any news on this? @trstringer, @anhvoms

@trstringer
Copy link
Contributor

walinuxagent should only be deleting this file on deprovisioning. Can you provide the scenario that this is happening to you with?

@alv000h
Copy link
Author

alv000h commented Jun 4, 2020

@trstringer we have following all steps described here to upload our custom vhd:
https://docs.microsoft.com/bs-cyrl-ba/azure/virtual-machines/linux/create-upload-generic?view=azurestackps-1.7.0

This guide requires deprovision before vhd upload to azure...

We are deploying using terraform (azureRM) and every reboot /etc/resolv.conf is deleted (we are using chattr +i as a workaround)

@trstringer
Copy link
Contributor

trstringer commented Jun 4, 2020

Do you mean more specifically these steps (Prepare a Red Hat-based virtual machine for Azure)?

Can you share your /var/log/waagent.log content? If yes, please ensure that any sensitive or environment-specific information is removed or modified.

@alv000h
Copy link
Author

alv000h commented Jun 4, 2020

Yes that is the document.

Please let me reproduce the error and post the logs...

@trstringer
Copy link
Contributor

Is your machine running NetworkManager? It appears as though NetworkManager should be managing and updating /etc/resolv.conf as well, unless you've set dns=none in NetworkManager conf..?

@trstringer
Copy link
Contributor

Closing this issue, but if you want to continue troubleshooting please feel free to re-open.

@amorton-netapp
Copy link

amorton-netapp commented Apr 19, 2024

I'd like to reopen this issue, as I've encountered the same odd behavior, and had to use the same workaround to set the file immutable. This feature only works correctly if you're presuming that NetworkManager is handling that file's contents - in which case it would replace it anyway. If you need to retain a static DNS configuration, then waagent blows it away with no option to exclude that file. It's fine as a default, but there really should be a waagent.conf setting that controls this or overrides it.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants