VirtualBox

Changeset 64599 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 8, 2016 4:28:34 PM (8 years ago)
Author:
vboxsync
Message:

updates

Location:
trunk/src/VBox/ValidationKit/docs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/docs/TestBoxImaging.txt

    r64578 r64599  
    5656----------
    5757
    58 To perform one of the above maintenance actions on a testbox copy the
    59 ``do-<action>.cfg`` file over to testbox hex-IP config file name.  Then trigger
    60 a reboot.  The box will then boot the NFS rooted debian image and execute the
    61 maintenance action.  On success, it will remove the testbox hex-IP config file
    62 and reboot again.
    63 
    64 The hex-IP config file name for a testbox is generated by taking the IPv4
    65 address, converting each of the 4 numbers to upper cased hex and remove the
    66 dots.  Given the IP ``10.42.1.96`` you can use the unix ``printf`` command
    67 like this ``printf "%02X%02X02X%02X" 10 42 1 96`` to get the name.
     58To perform one of the above maintenance actions on a testbox, run the
     59``testbox-pxe-conf.sh`` script::
     60
     61    /mnt/testbox-tftp/pxeclient.cfg/testbox-pxe-conf.sh 10.165.98.220 rescue
     62
     63Then trigger a reboot.  The box will then boot the NFS rooted debian image and
     64execute the maintenance action.  On success, it will remove the testbox hex-IP
     65config file and reboot again.
    6866
    6967
     
    126124This will make the default behavior to boot the local disk system.
    127125
    128 Create ``pxelinux.cfg/do-backup``, ``pxelinux.cfg/do-backup-again``,
    129 ``pxelinux.cfg/do-restore``, ``pxelinux.cfg/do-refresh-info``, and
    130 ``pxelinux.cfg/do-rescue`` configuration files on the form::
    131 
    132   PATH bios
    133   DEFAULT maintenance
    134   LABEL maintenance
    135     MENU LABEL Maintenance (NFS)
    136     KERNEL maintenance-boot/vmlinuz-3.16.0-4-amd64
    137     APPEND initrd=maintenance-boot/initrd.img-3.16.0-4-amd64 testbox-action-backup ro ip=any aufs=tmpfs boot=nfs root=/dev/nfs nfsroot=10.42.1.1:/export/testbox-nfsroot,ro,tcp nfsvers=3 nfsrootdebug
    138   LABEL local-boot
    139   LOCALBOOT
    140 
    141 When you want to preform an action on a testbox, copy the ``do-<action>`` to
    142 ``pxeclient.cfg/<HEX-ip-addr>`` and trigger a boot of the testbox.  The machine
    143 config will be removed automatically once the action has been successfully
    144 completed.
    145 
    146 Note! We use ``ip=any`` and not ``ip=dhcp`` as the former seems to work more
    147       reliably in our lab.
     126Copy the ``testbox-pxe-conf.sh`` script file found in the same directory as
     127this document to ``/mnt/testbox-tftp/pxelinux.cfg/``.  Edit the copy to correct
     128the IP addresses near the top, as well as any linux, TFTP and PXE details near
     129the bottom of the file.   This script will generate the PXE configuration file
     130when performing maintenance on a testbox.
    148131
    149132
     
    195178
    196179The testbox-nfsroot share should be read-only and must **not** have root
    197 squashing enabled.
     180squashing enabled.  Also, make sure setting the set-uid-bit is allowed by the
     181server, or ``su` and ``sudo`` won't work
    198182
    199183There are several ways of creating a debian nfsroot, but since we've got a
     
    237221   is quite a bit slower, obviously.
    238222
     223 - Edit ``/etc/ssh/sshd_config`` setting ``PermitRootLogin`` to ``yes`` so we can ssh
     224   in as root later on.
     225
    239226 - chroot into the nfsroot: ``chroot /mnt/``
    240227
     
    249236         proc                             /proc               proc  defaults   0 0
    250237         /dev/nfs                         /                   nfs   defaults   1 1
    251          10.42.1.1:/export/testbox-tftp   /mnt/testbox-tftp   nfs   nfsvers=3  2 2
    252          10.42.1.1:/export/testbox-backup /mnt/testbox-backup nfs   nfsvers=3  3 3
     238         10.42.1.1:/export/testbox-tftp   /mnt/testbox-tftp   nfs   tcp,nfsvers=3,noauto  2 2
     239         10.42.1.1:/export/testbox-backup /mnt/testbox-backup nfs   tcp,nfsvers=3,noauto  3 3
     240
     241       We use NFS version 3 as that works better for our NFS server and client,
     242       remove if not necessary.  The ``noauto`` option is to work around mount
     243       trouble during early bootup on some of our boxes.
    253244
    254245     - Do ``mount /mnt/testbox-tftp && mount /mnt/testbox-backup`` to mount the
  • trunk/src/VBox/ValidationKit/docs/testbox-pxe-conf.sh

    r64583 r64599  
    3131#
    3232MY_NFS_SERVER_IP="10.165.98.50"
    33 MY_GATEWAY_IP="10.165.98.0"
     33MY_GATEWAY_IP="10.165.98.1"
    3434MY_NETMASK="255.255.128.0"
    3535MY_ETH_DEV="eth0"
    36 MY_AUTO_CFG="any"
    37 MY_DNS0_IP="10.165.246.33"
    38 MY_DNS1_IP="192.135.82.44"
     36MY_AUTO_CFG="none"
    3937
    4038# options
     
    7573            fi
    7674            if test -z "${MY_IP}"; then
     75                # Split up the IP if possible, if not do gethostbyname on the argument.
    7776                MY_TMP=`echo "${MY_ARG}" | sed -e 's/\./ /g'`
    78                 if printf "%02X%02X%02X%02X" ${MY_TMP} > /dev/null; then
    79                     MY_IP_HEX=`printf "%02X%02X%02X%02X" ${MY_TMP}`;
    80                     MY_IP="${MY_ARG}";
    81                 else
    82                     echo "syntax error: Invalid IP: ${MY_ARG}" >&2;
    83                     exit 2;
     77                if   test `echo "${MY_TMP}" | wc -w` -ne 4 \
     78                  || ! printf "%02X%02X%02X%02X" ${MY_TMP} > /dev/null 2>&1; then
     79                    MY_TMP2=`getent hosts "${MY_ARG}" | head -1 | cut -d' ' -f1`;
     80                    MY_TMP=`echo "${MY_TMP2}" | sed -e 's/\./ /g'`
     81                    if   test `echo "${MY_TMP}" | wc -w` -eq 4 \
     82                      && printf "%02X%02X%02X%02X" ${MY_TMP} > /dev/null 2>&1; then
     83                        echo "info: resolved '${MY_ARG}' as '${MY_TMP2}'";
     84                        MY_ARG="${MY_TMP2}";
     85                    else
     86                        echo "syntax error: Invalid IP: ${MY_ARG}" >&2;
     87                        exit 2;
     88                    fi
    8489                fi
     90                MY_IP_HEX=`printf "%02X%02X%02X%02X" ${MY_TMP}`;
     91                MY_IP="${MY_ARG}";
    8592            else
    8693                if test -z "${MY_ACTION}"; then
     
    132139echo -n " nfsroot=${MY_NFS_SERVER_IP}:/export/testbox-nfsroot,ro,tcp" >> "${MY_CFG_FILE}";
    133140echo -n " nfsvers=3 nfsrootdebug" >> "${MY_CFG_FILE}";
    134 echo -n " ip=${MY_IP}:${MY_NFS_SERVER_IP}:${MY_GATEWAY_IP}:${MY_NETMASK}:maintenance:${MY_ETH_DEV}:${MY_AUTO_CFG}:${MY_DNS0_IP}:${MY_DNS1_IP}" >> "${MY_CFG_FILE}";
     141if test "${MY_AUTO_CFG}" = "none"; then
     142    # Note! Only 6 arguments to ip! Userland ipconfig utility barfs if autoconf and dns options are given.
     143    echo -n " ip=${MY_IP}:${MY_NFS_SERVER_IP}:${MY_GATEWAY_IP}:${MY_NETMASK}:maintenance:${MY_ETH_DEV}" >> "${MY_CFG_FILE}";
     144else
     145    echo -n " ip=${MY_AUTO_CFG}" >> "${MY_CFG_FILE}";
     146fi
    135147echo "" >> "${MY_CFG_FILE}";
    136148echo "LABEL local-boot" >> "${MY_CFG_FILE}";
    137149echo "LOCALBOOT" >> "${MY_CFG_FILE}";
    138 echo "Successfully generated ${MY_CFG_FILE}."
     150echo "Successfully generated '${MY_CFG_FILE}'."
    139151exit 0;
    140152
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette