Bug 1571316

Summary: targetcli: Need improvements in configuration backup [rhel-7.5.z]
Product: Red Hat Enterprise Linux 7 Reporter: Oneata Mircea Teodor <toneata>
Component: targetcliAssignee: Maurizio Lombardi <mlombard>
Status: CLOSED ERRATA QA Contact: Storage QE <storage-qe>
Severity: urgent Docs Contact: Marek Suchánek <msuchane>
Priority: urgent    
Version: 7.4CC: amukherj, coughlan, mchristi, mhoyer, mlombard, pkarampu, prasanna.kalever, rcyriac, rhandlin, sanandpa, vanhoof, vbellur
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: targetcli-2.1.fb46-4.el7 Doc Type: If docs needed, set a value
Doc Text:
* Previously, the targetcli utility did not create the /etc/target/ and /etc/target/backup/ directories if they were missing. As a consequence, if the user deleted the directories, the "targetcli saveconfig" command failed. With this update, targetcli recreates the directories if they are missing. As a result, the described problem no longer occurs. * With this update, the "targetcli saveconfig" command backs up the /etc/target/saveconfig.json file only if it is different from the most recent copy. This avoids creating duplicate backups. * With this update, the targetcli utility now provides the backup_files_limit global configuration option, which limits the maximum number of backup files.
Story Points: ---
Clone Of: 1537998 Environment:
Last Closed: 2018-05-14 16:12:42 UTC Type: ---
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: 1537998    
Bug Blocks: 1570535    

Description Oneata Mircea Teodor 2018-04-24 13:49:52 UTC
This bug has been copied from bug #1537998 and has been proposed to be backported to 7.5 z-stream (EUS).

Comment 3 Sweta Anandpara 2018-05-04 09:16:16 UTC
Tested and validated this on a RHGS cluster with targetcli-2.1.fb46-4.el7.noarch.

Was successfully able to modify the limit of /etc/target/backup/saveconfig.json, and validated that the limit set worked as expected. Was always able to have 1 config more than the limit set, but there is an existing bugzilla for the same.. will be mentioning that in my next comment. 

Deleted /etc/target/backup directory, and tried to saveconfig. That directory was successfully created. 

Tried saveconfig multiple times when there was no change in the targetcli configuration, and validated that backup files were not repeatedly created for every 'targetcli saveconfig' executed. A single backup file remained and continued to remain if there was no change in the configuration. 

Did a change in the configuration and validated that a new backup copy was then created (when 'targetcli / saveconfig' was executed), as expected. 

Positive with the validation of the patches that have gone in, in this bug. 

Please feel free to move this bug to verified after a round of regression. Thanks!

Comment 4 Martin Hoyer 2018-05-04 10:00:19 UTC
Thank you Sweta and Storage-QA!
My manual testing on RHEL-7.5 with targetcli-2.1.fb46-4.el7 confirms this. We are also aware of the 1 extra backup as described in https://github.com/open-iscsi/targetcli-fb/pull/111
Our regression tests have not found any issues.

Comment 9 errata-xmlrpc 2018-05-14 16:12:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:1403