#634 Issue closed: Still output in /var/lib/rear when using BACKUP=TSM

Labels: enhancement, needs sponsorship

eholtz opened issue at 2015-08-12 13:06:

Hi,

I updated to rear-1.17.1 and read about the OUTPUT_URL=null option. I thought that would work out great for me and activated it, but I still see two disk images in my environment.

I have default config files for local.conf and os.conf and:

[@machine ~]# find / -iname "*.iso"
[@machine ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)
[@machine ~]# rpm -qa | grep rear
rear-1.17.1-1.el7.noarch
[@machine ~]# cat /etc/rear/site.conf
# configuration file for relax and recover
# don't upload to tsm directly as this is scheduled somewhere else
BACKUP=TSM
TSM_RESULT_SAVE=n
OUTPUT_URL=null
[@machine ~]# /usr/sbin/rear mkrescue
[@machine ~]# find / -iname "*.iso"
/opt/tivoli/tsm/rear/rear-machine.iso
/var/lib/rear/output/rear-machine.iso
[@machine ~]#

gdha commented at 2015-08-12 17:51:

could you run rear -vD mkrescue to see where it goes wrong? Is linked to issue #501

eholtz commented at 2015-08-13 05:54:

Sure, no problem. Unfortunately I'm not seeing any option to upload the logfile, therefore I put it here:
http://eholtz.de/rear-machine.log.xz

[@machine ~]# find / -iname "*.iso" -exec rm {} \;
[@machine ~]# /usr/sbin/rear -vD mkrescue
Relax-and-Recover 1.17.1 / Git
Using log file: /var/log/rear/rear-machine.log
Creating disk layout
Creating root filesystem layout
Copying files and directories
Copying binaries and libraries
Copying kernel modules
Creating initramfs
Making ISO image
Wrote ISO image: /var/lib/rear/output/rear-machine.iso (201M)
Saving result files with TSM
[@machine ~]# find / -iname "*.iso"
/opt/tivoli/tsm/rear/rear-machine.iso
/var/lib/rear/output/rear-machine.iso
[@machine ~]#

gdha commented at 2015-08-13 08:42:

@eholtz thank you for the log. Apparently the OUTPUT_URL=null was designed to work well with BACKUP=NTEFS scheme and was not implemented for other backup methods. This is not a bug, but a missing feature of the patch kindly donated by an user.
We need to enhance the code to make this happen in a generic way.

gdha commented at 2015-08-13 08:47:

@eholtz if you define TSM_RM_ISOFILE=1 in /etc/rear/site.conf file then /opt/tivoli/tsm/rear/rear-machine.iso will be removed.
PS: I rather use the generic code for OUTPUT_URL=null everywhere

gdha commented at 2015-08-13 08:52:

@eholtz One last remark: by defining TSM_RESULT_SAVE=n you will not make a backup of the iso file towards TSM. Is this what you want? As you want all ISOs to be removed on the local system? I don't think so...

eholtz commented at 2015-08-13 09:37:

@gdha Thank you for your replies. The TSM-Backup is scheduled elsewhere, so as long as I have one copy left the iso will be saved once a day to the server. I don't want to upload it directly to TSM after the cronjob, because I would produce a heavy load on the server when multiple VMs are starting their jobs at the same time.
I will try if the TSM_RM_ISOFILE=1 works out for me and let you know.

eholtz commented at 2015-08-14 05:29:

@gdha I tried using

# configuration file for relax and recover
# don't upload to tsm directly as this is scheduled somewhere else
BACKUP=TSM
TSM_RESULT_SAVE=n
TSM_RM_ISOFILE=1

But I'm still left with two iso files:

[root@lxf101p001 ~]# find / -iname "*.iso" -exec rm {} \;
[root@lxf101p001 ~]# rear mkrescue
[root@lxf101p001 ~]# find / -iname "*.iso"
/opt/tivoli/tsm/rear/rear-lxf101p001.iso
/var/lib/rear/output/rear-lxf101p001.iso

Apparently the iso gets only removed when it has been uploaded to TSM (which I believe is kind of useful for standard environments)

gdha commented at 2015-08-19 18:46:

@eholtz Is your question answered? The OUTPUT_URL is only honored with BACKUP=NETFS scheme. If you would like it different then I would prefer another issue - to keep 2 discussions apart.

eholtz commented at 2015-08-20 05:14:

@gdha Thanks for your reply. I do understand that OUTPUT_URL is only honored with BACKUP=NETFS scheme. The documentation should be updated to reflect that, maybe I'm not the only one who misunderstood that.
Nevertheless I think there should be an option to do a BACKUP=TSM in combination with TSM_RESULT_SAVE=n where I'm not left with two ISO images. I would like to contribute this myself, but I need a couple of hours to look into the code so I won't be able to do that in the next days.

gdha commented at 2015-08-20 06:52:

@eholtz @schlomo Well the OUTPUT_URL was never a concern (in most cases with external backup), but I agree you can use it to have second copy.
Wonder what Schlomo idea is about the scope of OUTPUT_URL=null: shall we stick to NETFS mechanism or go broader?

schlomo commented at 2015-08-20 08:35:

@gdha grepping through our code makes me think that the actual challange is that there is no single tool to handle all types of OUTPUT_URL which means that we need lots of code to handle the different types of URLs.

Another questions: Why do we need OUTPUT_URL=null if the default of OUTPUT_URL is empty? So far most ReaR variables can be set to empty or unset to disable a feature.

gdha commented at 2015-10-02 15:08:

@schlomo Sorry for the delay - if OUTPUT_URL is empty it will get the same value as BACKUP_URL (which is mandatory) and it makes sense as you want your iso image saved (most likely on the same location as the tar archive)

gdha commented at 2016-02-05 15:42:

Re-open this issue when we found a sponsor to implement this missing feature

gdha commented at 2017-03-08 17:19:

The solution is described in issue #802


[Export of Github issue for rear/rear.]