Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When we create a VM base on a specialized image, the /etc/resolv.conf file will be removed and cannot be generated only if restart network or reboot.
Version-Release number of selected component (if applicable):
WALinuxAgent-2.2.12-1
RHEL Version:
RHEL-7.4/6.9
How reproducible:
100%
Steps to Reproduce:
1. Prepare a running VM in Azure. Capture it as a specialized image.
2. Create a VM base on this image.
3. Check /etc/resolv.conf
4. Check /var/log/waagent.log and /var/log/messages
Actual results:
The /etc/resolv.conf doesn't exist.
Expected results:
The /erc/resolv.conf exists.
/var/log/messages:
Jun 8 13:25:26 wala74fips python: 2017/06/08 13:25:26.019325 WARNING VM is provisioned, but the VM unique identifier has changed -- clearing cached state
Jun 8 13:25:26 wala74fips python: WARNING! Cached DHCP leases will be deleted.
Jun 8 13:25:26 wala74fips python: WARNING! /etc/resolv.conf will be deleted.
Additional info:
1. Root cause is when creating a VM and the /var/lib/waagent/provisioned file exists, wala runs "deprovision_handler.run_changed_unique_id()", it calls "del_resolv"(Line#212 in pa/deprovision/default.py), which will delete the /etc/resolv.conf.
In my opinion, when we create a new VM, the /etc/resolv.conf will be regenerated my dhclient script or NetworkManager.
2. The WARNING logs "WARNING! Cached DHCP leases will be deleted.", "WARNING! /etc/resolv.conf will be deleted." are only printed in /var/log/messages but not in /var/log/waagent.log. We'd better also print them in /var/log/waagent.log.
Verify in WALinuxAgent-2.2.14-1.el7
RHEL version: RHEL-7.4-20170621.0
Result: Issue 1(remove /etc/resolv.conf issue) is passed.
Issue 2(print WARNING logs into /var/log/waagent.log) is failed
Steps:
1. Prepare a running VM in Azure. Capture it as a specialized image.
2. Create a VM base on this image.
3. Check /etc/resolv.conf
4. Check /var/log/waagent.log and /var/log/messages
Actual result:
1. /etc/resolv.conf is not removed.
2. The "WARNING! Cached DHCP leases will be deleted." message only exists in /var/log/messages but not in /var/log/waagent.log
Description of problem: When we create a VM base on a specialized image, the /etc/resolv.conf file will be removed and cannot be generated only if restart network or reboot. Version-Release number of selected component (if applicable): WALinuxAgent-2.2.12-1 RHEL Version: RHEL-7.4/6.9 How reproducible: 100% Steps to Reproduce: 1. Prepare a running VM in Azure. Capture it as a specialized image. 2. Create a VM base on this image. 3. Check /etc/resolv.conf 4. Check /var/log/waagent.log and /var/log/messages Actual results: The /etc/resolv.conf doesn't exist. Expected results: The /erc/resolv.conf exists. /var/log/messages: Jun 8 13:25:26 wala74fips python: 2017/06/08 13:25:26.019325 WARNING VM is provisioned, but the VM unique identifier has changed -- clearing cached state Jun 8 13:25:26 wala74fips python: WARNING! Cached DHCP leases will be deleted. Jun 8 13:25:26 wala74fips python: WARNING! /etc/resolv.conf will be deleted. Additional info: 1. Root cause is when creating a VM and the /var/lib/waagent/provisioned file exists, wala runs "deprovision_handler.run_changed_unique_id()", it calls "del_resolv"(Line#212 in pa/deprovision/default.py), which will delete the /etc/resolv.conf. In my opinion, when we create a new VM, the /etc/resolv.conf will be regenerated my dhclient script or NetworkManager. 2. The WARNING logs "WARNING! Cached DHCP leases will be deleted.", "WARNING! /etc/resolv.conf will be deleted." are only printed in /var/log/messages but not in /var/log/waagent.log. We'd better also print them in /var/log/waagent.log.