Bug 1324307

Summary: [WALA][rhel6.8] Cannot execute "reset remote access" twice successively
Product: Red Hat Enterprise Linux 6 Reporter: Yuxin Sun <yuxisun>
Component: WALinuxAgentAssignee: Yue Zhang <yuezha>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8CC: huishao, leiwang, lic_interop, lizzha, mingzhan, tmlcoch, wshi, yuezha, yuxisun
Target Milestone: rcKeywords: Extras, Tracking
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-27 07:30:53 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:
Bug Depends On:    
Bug Blocks: 1359574    

Description Yuxin Sun 2016-04-06 05:34:20 UTC
Description of problem:
Cannot execute "reset remote access" twice successively on one VM.

Version-Release number of selected component (if applicable):
WALinuxAgent-2.0.16-1.el6

How reproducible:
Always

Steps to Reproduce:
1. Prepare a VM (ASM mode) and execute "reset remote access" on it through portal.
2. Check the /etc/ssh/sshd_config file. The old file is made a backup and a new file is generated
# ll /etc/ssh/sshd_config*
3. Execute "reset remote access" again.
4. Check the /etc/ssh/sshd_config file.

Actual results:
In step 4, nothing happened to sshd_config file.

The second time I reset remote access, there's no new /var/lib/waagent/Microsoft.OSTCExtensions.VMAccessForLinux-1.4.0.0/config/*.settings, but the latest *.settings file is updated.(For example, if there were 0.settings and 1.settings files, after the second resetting remote access, there's no 2.settings file generated, but the 1.settings file is updated.)

Messages in /var/log/azure/Microsoft.OSTCExtensions.VMAccessForLinux/1.4.0.0/extension.log
"""
2016/04/01 19:19:30 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]sequence number is 1
2016/04/01 19:19:30 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]setting file path is/var/lib/waagent/Microsoft.OSTCExtensions.VMAccessForLinux-1.4.0.0/config/1.settings
2016/04/01 19:19:30 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]JSON config: {"runtimeSettings":[{"handlerSettings":{"protectedSettingsCertThumbprint":"2625AFD02097F7C91D4D3F6EB4EE83AD40A368C2","protectedSettings":"MIIByAYJKoZIhvcNAQcDoIIBuTCCAbUCAQAxggFxMIIBbQIBADBVMEExPzA9BgoJkiaJk/IsZAEZFi9XaW5kb3dzIEF6dXJlIFNlcnZpY2UgTWFuYWdlbWVudCBmb3IgRXh0ZW5zaW9ucwIQeyG63fogirJFbKdj8SfOhjANBgkqhkiG9w0BAQEFAASCAQCJIa/FA5LOeqwX1J4SHD1GkJpCvaDlKYJprN/3BOIb/U39j4OQgNE1CEuTllVDFBrD/NdfYRbhFQMnwtuudzfZFMgNZ6KvpcAldjZcqdDHhPu+XfIrphBABBEcPOAeJn2XkoYXi/cmffXmG84UHJy7AufHNIAohMlrvkO60WEhoMgIwL38pkDeB4DA71xCf1dEhSJ5Xy3Iz+1J/Oy1uw8hpwrPfOY+uP+eG95NdLbaggwKxPnVeiHweYGd8bkhY0MOf7NSmsX6lZtAo22BTiWtPwqyE18Y0VM/YlGxt38IFaRvxYpkBzmU/zpkDEM3NKi3lWb2Fam2nIraCQ+iO5OHMDsGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIsa5EgTd793iAGEGhBY9JCouWHu2hNr+IdKxq2jDFdVsSAg=="}}]}
2016/04/01 19:19:30 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]Config decoded correctly.
2016/04/01 19:19:30 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]Succeeded in check and open ssh port.
2016/04/01 19:19:30 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]set most recent sequence number to 1
2016/04/01 19:19:34 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]Succeeded in reset sshd_config.
2016/04/01 19:19:34 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]Enable,success,0,Enable succeeded.
2016/04/01 19:28:02 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]sequence number is 1
2016/04/01 19:28:02 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]setting file path is/var/lib/waagent/Microsoft.OSTCExtensions.VMAccessForLinux-1.4.0.0/config/1.settings
2016/04/01 19:28:02 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]JSON config: {"runtimeSettings":[{"handlerSettings":{"protectedSettingsCertThumbprint":"2625AFD02097F7C91D4D3F6EB4EE83AD40A368C2","protectedSettings":"MIIByAYJKoZIhvcNAQcDoIIBuTCCAbUCAQAxggFxMIIBbQIBADBVMEExPzA9BgoJkiaJk/IsZAEZFi9XaW5kb3dzIEF6dXJlIFNlcnZpY2UgTWFuYWdlbWVudCBmb3IgRXh0ZW5zaW9ucwIQeyG63fogirJFbKdj8SfOhjANBgkqhkiG9w0BAQEFAASCAQA76EcKNY+3Uome68bEc1Qa1wQ+kGJg4kdJ5lPDYt54J3amJJGEiBs7ZluADCGg4zv9vTA4Pxij1aoLkUSldrH5oo16H752/2SCOKVWmUO/GfJ9Fso4IeOyWKXUnokuZGLioR8lwL5swc8gbsfdQVN5l+VNxunVo85jq+vyO2InxM28P4bbJviAcghRpk0oINZh28svRAnZr9X1xg2JWxGuxu9ESqVMvOh4R0vMuYAlZvbsDGspkyksV3jcWoOY6LMqbEa9tNDGXtYRVRRRvYO1cHFGmSwSDIGZMjEV4WKpKV/opRbUsQ8NpiBVu8254MC18hiJv0LpUi6Vei5+DxBHMDsGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIAdb+anH6GseAGLD4VvYCMfPqFqcEXzMBKA37DdANI/RwvQ=="}}]}
2016/04/01 19:28:02 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]Config decoded correctly.
2016/04/01 19:28:02 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]Succeeded in check and open ssh port.
2016/04/01 19:28:02 [Microsoft.OSTCExtensions.VMAccessForLinux-1.0]Current sequence number, 1, is not greater than the sequnce number of the most recent executed configuration. Exiting...
"""

Expected results:
In step 4, the old sshd_config file is made a backup and a new file is generated.

Additional info:
If execute "reset remote access" several times successively, the sequence number will always the same, so that it will be quit.
If do "reset password" and then do "reset remote access", the "reset remote access" can work well.
If do "reset remote access", than do "reset password", then do "reset remote access" again, it can work well.

Comment 3 Yuxin Sun 2016-08-09 09:41:23 UTC
Still exists in WALinuxAgent-2.1.5

Comment 4 Dave Anderson 2016-08-18 16:00:17 UTC
Setting Devel Conditional NAK: Patch for rhel-6.9

Comment 10 RHEL Program Management 2022-04-27 07:30:53 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.