Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate_network_configuration_files flaw if IPADDR in ip_addr/prefix format #1183

Closed
petr-gansel opened this issue Jan 27, 2017 · 12 comments
Closed
Assignees
Labels
bug The code does not do what it is meant to do won't fix / can't fix / obsolete

Comments

@petr-gansel
Copy link

Relax-and-Recover (rear) Issue Template

Please fill in the following items before submitting a new issue (quick response is not guaranteed with free support):

  • rear version (/usr/sbin/rear -V): Relax-and-Recover 2.00 / Git

  • OS version (cat /etc/rear/os.conf or lsb_release -a):
    LSB Version: core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-ppc64:core-3.2-ppc64:core-4.0-ppc64:desktop-4.0-noarch:desktop-4.0-ppc32:desktop-4.0-ppc64:graphics-2.0-noarch:graphics-2.0-ppc32:graphics-2.0-ppc64:graphics-3.2-noarch:graphics-3.2-ppc32:graphics-3.2-ppc64:graphics-4.0-noarch:graphics-4.0-ppc32:graphics-4.0-ppc64
    Distributor ID: SUSE LINUX
    Description: SUSE Linux Enterprise Server 11 (ppc64)
    Release: 11
    Codename: n/a

  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
    OUTPUT=BOOTP
    OUTPUT_URL="nfs://vercaix/install/nim/img/backup"
    BOOTP_TFTP_URL="nfs://vercaix/tftpboot/restobot"
    BOOTP_TFTP_PREFIX=$HOSTNAME.
    #BOOTP_RECOVER_MODE="unattended"
    BOOTP_RECOVER_MODE=
    BOOTP_CONFIG_URL="nfs://vercaix/tftpboot/restobot"
    BOOTP_CONFIG_PREFIX="bootp-"
    BOOTP_REMOVE_OLD_LINKS=1
    BOOTP_CREATE_LINKS=MAC
    BACKUP=NETFS
    BACKUP_URL="nfs://vercaix/install/nim/img/backup"
    USE_STATIC_NETWORKING=1
    WAIT_SEC=10
    BOOT_OVER_SAN=y
    AUTOEXCLUDE_MULTIPATH=n
    PRE_RECOVERY_SCRIPT="/usr/esus/bin/restobot_inject-pre.sh"
    POST_RECOVERY_SCRIPT="/usr/esus/bin/restobot_inject-post.sh"
    ISO_MKISOFS_BIN="/usr/bin/genisoimage"
    REQUIRED_PROGS=(
    "$SCRIPT_FILE"
    bash
    ksh
    awk
    cpio
    dd
    df
    getopt
    ip
    tar
    sort
    mv
    uniq
    grep
    loadkeys
    kbd_mode
    dumpkeys
    diff
    join
    pwd
    file
    pidof
    sync
    strings
    multipath
    multipathd
    parted
    lilo
    sfdisk
    lparstat
    blkid
    )
    COPY_AS_IS=(
    ${COPY_AS_IS[@]} /etc/esus /usr/esus/bin/restobot_inject-post.sh /usr/esus/bin/restobot_inject-pre.sh
    )

  • Are you using legacy BIOS of UEFI boot?
    SMS

  • Brief description of the issue:
    Network configuration modification in $TARGET_FS_ROOT/etc/sysconfig//ifcfg-${dev}* not work correctly if IPADDR variable specified in ip_addr/prefix format.

  • Work-around, if any:

--- finalize/GNU/Linux/420_migrate_network_configuration_files.sh.orig  2017-01-18 15:17:17.420000003 +0100
+++ finalize/GNU/Linux/420_migrate_network_configuration_files.sh       2017-01-27 19:22:59.460000004 +0100
@@ -68,7 +68,11 @@
                 nmask=""
                 nip="$new_ip"           # keep ipaddress/cidr
             else
-                nip="${new_ip%%/*}"     # only keep ipaddress
+               if grep -qE '^NETMASK=' $network_file;then
+                       nip="${new_ip%%/*}"     # only keep ipaddress
+               else
+                       nip="${new_ip}"     # keep ipaddress format
+               fi
             fi
             # TODO: what if NETMASK keyword is not defined? Should be keep new_ip then??
             SED_SCRIPT="s#^IPADDR=.*#IPADDR='${nip}'#g;s#^NETMASK=.*#NETMASK='${nmask}'#g;s#^NETWORK=.*#NETWORK=''#g;s#^BROADCAST=.*#BROADCAST=''#g;s#^BOOTPROTO=.*#BOOTPROTO='static'#g;s#STARTMODE='[mo].*#STARTMODE='auto'#g;/^IPADDR_/d;/^LABEL_/d;/^NETMASK_/d"
@gdha
Copy link
Member

gdha commented Jan 30, 2017

Hum, does it work with OUTPUT=BOOTP?? I cannot remember we ever implemented this. I guess you meant OUTPUT=PXE?
Anyhow, thanks for reporting it and the fix. I will review it soon.

@gdha gdha self-assigned this Jan 30, 2017
@gdha gdha added the bug The code does not do what it is meant to do label Jan 30, 2017
@petr-gansel
Copy link
Author

petr-gansel commented Jan 30, 2017 via email

@jsmeix
Copy link
Member

jsmeix commented Jan 30, 2017

@gdha
I have zero experience with PXE or BOOTP
so that I cannot really help with such issues.
If #1184
looks o.k. for you please merge it.

@jsmeix jsmeix added this to the Rear v2.1 milestone Jan 30, 2017
@jsmeix jsmeix changed the title migrate network configuration flaw migrate_network_configuration_files flaw if IPADDR in ip_addr/prefix format Jan 30, 2017
@gdha
Copy link
Member

gdha commented Jan 30, 2017

@petr-gansel Could you explain the difference between BOOTP and PXE - I am curious...

@jsmeix
Copy link
Member

jsmeix commented Jan 30, 2017

@petr-gansel
regarding your "BOOTP is my extension" in
#1183 (comment)

If you think your extension could be also useful for
other ReaR users, we would very much appreciate it
if you could contribute it to Relax-and-Recover, cf.
https://github.com/rear/rear/blob/master/.github/CONTRIBUTING.md
and see also "How to contribute to Relax-and-Recover" at
https://en.opensuse.org/SDB:Disaster_Recovery

@didacog
Copy link
Contributor

didacog commented Jan 30, 2017

@petr-gansel I am curious also...
I thought that should be the same (no changes) in PXE code in ReaR and just setting: allow bootp; in dhcpd.conf should work for PXE and BOOTP clients.

Or you're only talking about syslinux menu file generation code in ReaR? Because the initrd and kernel should work the same.

Thanks in advance!

@petr-gansel
Copy link
Author

It's really nearly the same as PXE, the only difference is that I'm generating /etc/bootptab entry for bootp server.
The reason why I'm doing this is that I don't have either PXE or DHCP server but using AIX NIM with a BOOTP server as a restore service provider.

@didacog
Copy link
Contributor

didacog commented Jan 30, 2017

Ok, is what I thought. Thanks!

May you can take a look at DRLM Project (www.drlm.org). Is a central management tool for ReaR similar to NIM, but manages ReaR deployments easier.

Regards,

@gdha
Copy link
Member

gdha commented Mar 13, 2017

@petr-gansel What shall we do with your #1184 pull request? Will you update it or shall we just cancel it?

@jsmeix jsmeix modified the milestones: ReaR v2.2, ReaR v2.1 May 22, 2017
@jsmeix
Copy link
Member

jsmeix commented May 22, 2017

Because of possible backward incompatible changes in
#1184
I post-pone it for a later release after 2.1 (for now for 2.2).

@gdha
Copy link
Member

gdha commented Jul 11, 2017

Due to no feedback I remove the release commitment.

@gdha gdha removed this from the ReaR v2.2 milestone Jul 11, 2017
@jsmeix jsmeix removed their assignment Jul 19, 2017
@jsmeix
Copy link
Member

jsmeix commented Dec 1, 2017

According to
#1184
I also close this one as "won't fix / can't fix".

@jsmeix jsmeix closed this as completed Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do won't fix / can't fix / obsolete
Projects
None yet
Development

No branches or pull requests

4 participants