Bug 879162

Summary: [RFE] targetcli configuration save/restore enhancement
Product: Red Hat Enterprise Linux 7 Reporter: Xiaowei Li <xiaoli>
Component: targetcliAssignee: Andy Grover <agrover>
Status: CLOSED UPSTREAM QA Contact: Xiaowei Li <xiaoli>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: qcai
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: targetcli-2.1.fb25-1 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-04 00:10:00 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:

Description Xiaowei Li 2012-11-22 09:00:40 UTC
Description of problem:
The targetcli configuration is easy to lost since it only backup the latest configuration.


Version-Release number of selected component (if applicable):


How reproducible:


Consider the following scenario.
Steps to Reproduce:
1. /> set global auto_save_on_exit=true
2. service targetcli stop
>> this will execute 'targetcli clearconfig confirm=true' to cleanup the current targetcli configuration
3. run targetcli then exit, the current configuration will saved and the users will lost their previous configuration.

So we should have several enhancement.
1. when execute 'service targetcli stop' please notice the users what happens.
It should tell the user the current configuration is cleaned and if they want to restore it please run 'service targetcli start' or targetcli restoreconfig

2. please don't overwrite the /etc/target/saveconfig.json.backup, rename it to saveconfig.json.backup.2012xxxx etc and move it to /etc/target/backup.

The /etc/target/saveconfig.json is important so we should keep tracking the its changes.
  
Actual results:


Expected results:


Additional info:

Comment 1 Xiaowei Li 2012-12-10 09:41:34 UTC
It's better to automatically archive/backup existing targetcli configuration.

Comment 3 Andy Grover 2013-01-15 20:05:00 UTC
1. I don't know if systemd has capabilities to output messages to the user when units are started/stopped.

2. Yes it would be nice to keep maybe X last configurations (X=10 maybe), labeled by date. I'll work on that.

Comment 4 Xiaowei Li 2013-01-23 02:48:16 UTC
(In reply to comment #3)
> 1. I don't know if systemd has capabilities to output messages to the user
> when units are started/stopped.
> 
> 2. Yes it would be nice to keep maybe X last configurations (X=10 maybe),
> labeled by date. I'll work on that.

I vote for keeping multiple last configurations.

Comment 5 Andy Grover 2013-06-04 00:10:00 UTC
we now keep 10 previous configs.