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.

Bug 1371063

Summary: [WALA]The updated WALA will be used after restart waagent twice even if its version is lower than the local version
Product: Red Hat Enterprise Linux 7 Reporter: Yuxin Sun <yuxisun>
Component: WALinuxAgentAssignee: Miroslav Rezanina <mrezanin>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: leiwang, salmy, wshi, yuxisun
Target Milestone: rcKeywords: Extras, Tracking
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: WALinuxAgent-2.2.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1429325 (view as bug list) Environment:
Last Closed: 2017-03-07 08:52:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1429325    

Description Yuxin Sun 2016-08-29 09:26:47 UTC
This bug is used to track the issue on bugzilla:
https://github.com/Azure/WALinuxAgent/issues/387

Description of problem:
If enable AutoUpdate, WALA will always use the updated WALA after restart waagent service twice, even if its version is echo to or lower than the local version.

Version-Release number of selected component (if applicable):
WALinuxAgent-2.1.6 (Upstream build)

RHEL Version:
RHEL-7.3-20160817.1

How reproducible:
100%

Steps to Reproduce:
1. Prepare a RHEL7.3 VM on Azure East US location(ASM mode) with WALA-2.1.6 installed. Enable wala auto-update in the /etc/waagent.conf:
# AutoUpdate.Enabled=y
# AutoUpdate.GAFamily=Prod
2. restart waagent service
# systemctl restart waagent
3. Wait until the new WALA package is downloaded.
(Now WALA still use the local version)
# ps aux|grep -E "waagent|WALinux"
python -u /usr/sbin/waagent -run-exthandlers
4. restart waagent service again
# systemctl restart waagent
5. Check the -run-exthandler process
# ps aux|grep -E "waagent|WALinux"
python -u bin/WALinuxAgent-2.1.6-py2.7.egg -run-exthandlers


Actual results:
WALA uses the updated version(2.1.6), not the local version(2.1.6).

Expected results:
WALA uses the local version because the new version is not higher than the local version.


Additional info:
1. If change the local version to 2.1.7 in the /usr/lib/python2.7/site-packages/azurelinuxagent/common/version.py, this issue also exists.
2. If I delete the /var/lib/waagent/WALinuxAgent-2.1.6/ and then restart waagent service, it will use the local version(python -u /usr/sbin/waagent -run-exthandlers)

Comment 2 Yuxin Sun 2016-11-29 09:15:09 UTC
Verify in WALA-2.2.1 RHEL-7.3 ondemand and RHEL-6.9-20161110.2. Result is pass.

Steps:
1. Prepare a VM on Azure with WALA-2.2.1 installed. Set AutoUpdate.enabled=y
2. Check wala process. Doesn't use the new WALA because the local version is equal to the new version.
# ps aux|grep -E "waagent|WAL"
root     24993  6.2  0.6 203652 11076 pts/0    S    17:10   0:00 python /usr/sbin/waagent -daemon
root     24998 11.2  0.8 368708 14328 pts/0    Sl   17:10   0:00 python -u bin/WALinuxAgent-2.2.1-py2.7.egg -run-exthandlers
3. Modify AGENT_VERSION = '2.2.0' in /usr/lib/python2.6/site-packages/azurelinuxagent/common/version.py. Remove /var/lib/waagent/current_version. Restart waagent service.
4. Check wala process. Use the new WALA because the local version is lower than the new version
# ps aux|grep -E "waagent|WAL"
root     24993  6.2  0.6 203652 11076 pts/0    S    17:10   0:00 python /usr/sbin/waagent -daemon
root     24998 11.2  0.8 368708 14328 pts/0    Sl   17:10   0:00 python -u bin/WALinuxAgent-2.2.1-py2.7.egg -run-exthandlers
5. Modify AGENT_VERSION = '2.2.2'and repeat step3-4. Doesn't use the new WALA because the local version is higher than the new version.
root     25031  7.5  0.6 203604 11084 pts/0    S    17:14   0:00 python /usr/sbin/waagent -daemon
root     25036  7.2  0.7 213932 12524 pts/0    S    17:14   0:00 python -u /usr/sbin/waagent -run-exthandlers

Comment 3 Yuxin Sun 2017-03-06 03:16:31 UTC
Change the status to "POST" for developers to add it into ERRATA.