#1624 PR merged: Ignore disk size of multipath slave in 205_compare_disk.sh

Labels: fixed / solved / done, minor bug

schabrolles opened issue at 2017-12-05 18:39:

@jsmeix, as explain directly in
https://github.com/rear/rear/issues/1596#issuecomment-349390805
I got the following small bug ...

RESCUE rear-rhel-142:~ # rear -D recover
Relax-and-Recover 2.2 / Git
Using log file: /var/log/rear/rear-rear-rhel-142.log
Running workflow recover within the ReaR rescue/recovery system
Starting required daemons for NFS: RPC portmapper (portmap or rpcbind) and rpc.statd if available.
Started RPC portmapper 'rpcbind'.
RPC portmapper 'rpcbind' available.
Started rpc.statd.
RPC status rpc.statd available.
Started rpc.idmapd.
Using backup archive '/tmp/rear.xAzGbMuWwaH3TfJ/outputfs/rear-rhel-142/backup.tar.gz'
Calculating backup archive size
Backup archive size is 1003M    /tmp/rear.xAzGbMuWwaH3TfJ/outputfs/rear-rhel-142/backup.tar.gz (compressed)
Setting up multipathing
Activating multipath
multipath activated
Listing multipath device found
mpatha  (253, 0)
Comparing disks
Ambiguous possible target disks need manual configuration (more than one with same size found)
Switching to manual disk layout configuration
Using /dev/mapper/mpatha (same name and same size) for recreating /dev/mapper/mpatha
Current disk mapping table (source -> target):
    /dev/mapper/mpatha /dev/mapper/mpatha
UserInput -I LAYOUT_MIGRATION_CONFIRM_MAPPINGS needed in /usr/share/rear/layout/prepare/default/300_map_disks.sh line 211
Confirm or edit the disk mapping
1) Confirm disk mapping and continue 'rear recover'
2) Edit disk mapping (/var/lib/rear/layout/disk_mappings)
3) Use Relax-and-Recover shell and return back to here
4) Abort 'rear recover'
(default '1' timeout 10 seconds)

/dev/mapper/maptha is the original device (means NO MIGRATION)
but I think the change you introduced in 1e3b0d9 produce this bug:
Ambiguous possible target disks need manual configuration (more than one with same size found)

I think the reason is the fact all disk size are put into the replacement_hardware_disk_sizes array; even the disk which are slaves of a multipathed device.

extract from my disklayout.conf

multipath /dev/mapper/mpatha 53687091200 /dev/sda,/dev/sdb,/dev/sdc,/dev/sdd,/dev/sde,/dev/sdf,/dev/sdg,/dev/sdh

In the example above, sda, sdb, sdc, sdd, sde, sdf, sdg, sdh are different PATH to the same disk device. mpatha .... So, in the current code, their sized will be stored several times .... Which conduct to the following message: (more than one with same size found) and require a User interaction even if only one multipath device (SAN LUN) is presented to the system.

This PR avoid to add device size into the |replacement_hardware_disk_sizes` array if they are a multipath slave.

schabrolles commented at 2017-12-05 19:01:

@jsmeix
Seems to work now, but I still have a strange message printed (I don't know if it is normal)

UserInput -I DISK_LAYOUT_PROCEED_RECOVERY needed in /usr/share/rear/layout/prepare/default/250_compare_disks.sh line 146

jsmeix commented at 2017-12-06 09:31:

@schabrolles
regarding the "UserInput ... needed" message in
https://github.com/rear/rear/pull/1624#issuecomment-349406390
In debug mode ('-d' or '-D') and only in that mode
it is intentional so that the user can see what UserInput ID
value each particular UserInput call has because otherwise
the user would have to dig in the code and find the right
UserInput function call before he could specify a predefined
UserInput value, see the UserInput() function description
comments in lib/_input-output-functions.sh and the
USER_INPUT_user_input_ID variables description
in default.conf


[Export of Github issue for rear/rear.]