#570 Issue closed: PXE_TFTP_PATH behavior different in rear-1.17

Labels: bug

gdha opened issue at 2015-03-29 14:10:

I installed rear 1.17.0 on my SLES 12 VM named vsaps12 and executed rear mkrescue.

3 lines from my /etc/rear/site.conf:

OUTPUT=PXE
PXE_CONFIG_PATH=/clusterdisk/srv/tftpboot/pxelinux.cfg
PXE_TFTP_PATH=/clusterdisk/srv/tftpboot/sap/

The output of rear dump includes:

Output to PXE
               PXE_CONFIG_PATH = /clusterdisk/srv/tftpboot/pxelinux.cfg
             PXE_CONFIG_PREFIX = rear-
              PXE_CREATE_LINKS = MAC
          PXE_REMOVE_OLD_LINKS =
                 PXE_TFTP_PATH = /clusterdisk/srv/tftpboot/sap
               PXE_TFTP_PREFIX = vsaps12.
                 RESULT_MAILTO =

So I expect the output in the $PXE_TFTP_PATH directory, and there it is.
But when I look at pxelinux.cfg/rear-vsaps12, I see the lines

 label rear
        kernel vsaps12/vsaps12.kernel
        append initrd=vsaps12/vsaps12.initrd.cgz root=/dev/ram0
vga=normal rw selinux=0 console=ttyS0,9600 console=ttyS1,9600 console=tty0

Hm, why that? There is no directory vsaps12/, and the file has been
stored correctly into the sap/ directory. Is this a bug or a feature?

BTW, this is not specific for SLES 12. My SLES 11 SP3 boxes create the
same config with "kernel = $(hostname)/$(hostname).kernel" ...

I think it was nice if either
a) rear writes down the correct directory name in the config or
b) symlinks the directory where the files are put to the directory that
is written in the pxe config ;)

Regards,
Werner

schlomo commented at 2015-03-29 14:19:

@gdha maybe do a 1.17.1 release for this one? If we really broke existing setups I would be happy to fix it ASAP.

gdha commented at 2015-03-29 14:25:

@schlomo Indeed I was just looking at the DRLM documentation

We have to manualy add to the client configuration file in the DRLM server called /etc/drlm/clients/client_name.cfg with the next content:

OUTPUT=PXE OUTPUT_PREFIX=PXE BACKUP=NETFS NETFS_PREFIX=BKP BACKUP_URL=nfs://SERVER_IP/DRLM/STORE/client_name OUTPUT_URL=nfs://SERVER_IP/DRLM/STORE/client_name OUTPUT_PREFIX_PXE=client_name/$OUTPUT_PREFIX

You have to replace the SERVER_IP for the IP of the DRLM server and the client_name for the client host name.

I just wonder what the exact link is between OUTPUT_PREFIX_PXE=client_name/$OUTPUT_PREFIX and how our code was changed. Perhaps it was not meant to change?

schlomo commented at 2015-03-29 14:33:

I miss having tests for this kind of stuff :-( Unfortunately I cannot read from the code exactly how the result should look.

gdha commented at 2015-03-29 14:39:

Just made an issue https://github.com/brainupdaters/drlm/issues/12 for DRLM support team so they can verify how serious this issue is for them.

didacog commented at 2015-03-29 20:52:

Hello,
Maybe if set $OUTPUT_PREFIX_PXE="" to /etc/rear/site.conf solve this issue.

81_create_pxelinux_cfg.sh result:

kernel /$PXE_KERNEL
append initrd=/$PXE_INITRD root=/dev/ram0 vga=normal rw $KERNEL_CMDLINE

Updated: brainupdaters/drlm#12

Regards,
Didac (DRLM Team)

schlomo commented at 2015-03-30 08:45:

@didacog we need to fix ReaR so that it behaves like before adding the stuff for DRLM. Forcing users to change their configuration is basically not OK, unless we have a very strong and convincing reason for doing that.

The reason "nobody verified it before release" is not good enough.

Since you also use this code path, could I kindly ask you to look into the question of modifying your patch to keep the old behaviour while enabling your use case?

didacog commented at 2015-03-30 09:06:

@schlomo this behavior is the same since rear 1.16. Is not changed in rear 1.17.

In 1.17 we only changed OUTPUT_PREFIX to OUTPUT_PREFIX_PXE in 81_create_pxelinux_cfg.sh. but remain with same behavior since 1.16.

By default ReaR creates $OUTPUT_PREFIX directory on remote location and without this prefix on 81_create_pxelinux_cfg.sh never found kernel and initrd.

This is true without overwriting PXE_CONFIG_PATH or PXE_TFTP_PATH. We never had the need to overwrite these variables.

Regards,
Didac

schlomo commented at 2015-03-30 09:10:

I see. Maybe nobody really used this stuff since before 1.16, who knows.

Next question for me would be then: Which behaviour do we actually want to have?

didacog commented at 2015-03-30 09:19:

setting OUTPUT_PREFIX_PXE="" maintain 1.15 behaviour and works well with the other rear defaults.

by default is OUTPUT_PREFIX_PXE=$OUTPUT_PREFIX on default.conf and works well if no overwritting any variables.

gdha commented at 2015-04-07 14:22:

@didacog in pull request https://github.com/rear/rear/commit/d711f877efe62e2640c50492aae761984cdeb327 the following was added to the default.conf file:

+# DRLM need this in order to PXE, at boot, can find kernel and initrd files. We initialize with OUTPUT_PREFIX just to maintain same behaviour without DRLM.
+OUTPUT_PREFIX_PXE="$OUTPUT_PREFIX"
+

If I understand the discussion above well then it is OK for you to make variable OUTPUT_PREFIX_PXE empty in default.conf , right?
Perhaps, it would be better to initialize this variable, if you need it, in script init/default/01_set_drlm_env.sh?

didacog commented at 2015-04-08 08:07:

@gdha we have no need to initialize this variable in "init/default/01_set_drlm_env.sh".

If it's defined in default.conf. We can provide a value for it throught the DRLM http config service.

But if initialized empty in default.conf, this breaks some ReaR default behaviors fixed in 1.16.

On the other hand, there is no problem for DRLM if OUTPUT_PREFIX_PXE="" in default.conf, we can overwrite this on our centralized config files.


[Export of Github issue for rear/rear.]