Hide Forgot
Created attachment 477830 [details] targets.conf file Description of problem: Currently there is no way to add/edit/remove the target and store the new configuration in targets.conf file using CLI (the only way is manually modify the file). Simple service reload or host reboot will restore the old configuration stored in targets.conf. Looks like tgt-admin utility unable to store the modifications made on targets. Version-Release number of selected component (if applicable): scsi-target-utils-1.0.4-3.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. Create lv 2. Create target 3. Add lun 4. Service tgtg reload 5. tgt-admin --force --delete tid=1 Actual results: The target with id 1 remains in targets.conf file Expected results: Should remove the target with id 1 from the targets.conf file Additional info: Attached targets.conf file
Hi, please list exact commands used for steps 1-3, thanks.
(In reply to comment #2) > Hi, please list exact commands used for steps 1-3, thanks. 1. lvcreate -L 50G -n /dev/vg_autofiler01/test_lv 2 and 3. vim /etc/tgt/targets.conf and add the following: <target iqn.2001-04.com.test_target> <backing-store /dev/vg_autofiler01/test_lv> scsi_id 11223344 scsi_sn 99887766 </backing-store> </target>
Since RHEL 6.1 External Beta has begun, and this bug remains unresolved, it has been rejected as it is not proposed as exception or blocker. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
I think this is working as intended, targets.conf should only be modified by the user, not by the daemon.
(In reply to comment #5) > I think this is working as intended, targets.conf should only be modified by > the user, not by the daemon. Are you seriously? Should be modified by the user? But this is a wrong way, users are error-prone and may destroy targets mistakenly or introduce a typo that will affect the whole tgt service. I faced such situations several times since multiple users had granted access to the targets.conf file on a storage machine. Of course you can say that the access to this file should be restricted to a single administrator only, but why to edit it manually at all? As an effort of our RHEV Automation team I wrote a simple parser which handles this file, so I believe that such experienced programmers as you are guys can handle this file from the code also. Let's take NetApp [1] for example or stmfadm [2] on Solaris. They are not exposing any kind of configuration file to the end user, they are using CLI to change and update target/lun configurations persistently. IMHO such persistent CLI for TGT is a MUST HAVE feature. [1]: http://ecserv1.uwaterloo.ca/netapp/man/man1/na_lun.1.html [2]: http://www.unix.com/man-page/OpenSolaris/1m/stmfadm/
The good news is that TCM, the new target arch, will have persistent configuration like you describe. That's what we're moving towards. But, tgt-admin was not designed for this. If it was, targets.conf would be under /var instead of /etc, and wouldn't be user-editable, similar to the two other utilities you mentioned. It's extremely unlikely tgt-admin will make this change. I'm going to retarget this bug towards the feature being in our TCM support.
This will be there in RHEL 7 when we move to kernel target.