Changeset 64599 in vbox for trunk/src/VBox
- Timestamp:
- Nov 8, 2016 4:28:34 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/docs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/docs/TestBoxImaging.txt
r64578 r64599 56 56 ---------- 57 57 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. 58 To 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 63 Then trigger a reboot. The box will then boot the NFS rooted debian image and 64 execute the maintenance action. On success, it will remove the testbox hex-IP 65 config file and reboot again. 68 66 69 67 … … 126 124 This will make the default behavior to boot the local disk system. 127 125 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. 126 Copy the ``testbox-pxe-conf.sh`` script file found in the same directory as 127 this document to ``/mnt/testbox-tftp/pxelinux.cfg/``. Edit the copy to correct 128 the IP addresses near the top, as well as any linux, TFTP and PXE details near 129 the bottom of the file. This script will generate the PXE configuration file 130 when performing maintenance on a testbox. 148 131 149 132 … … 195 178 196 179 The testbox-nfsroot share should be read-only and must **not** have root 197 squashing enabled. 180 squashing enabled. Also, make sure setting the set-uid-bit is allowed by the 181 server, or ``su` and ``sudo`` won't work 198 182 199 183 There are several ways of creating a debian nfsroot, but since we've got a … … 237 221 is quite a bit slower, obviously. 238 222 223 - Edit ``/etc/ssh/sshd_config`` setting ``PermitRootLogin`` to ``yes`` so we can ssh 224 in as root later on. 225 239 226 - chroot into the nfsroot: ``chroot /mnt/`` 240 227 … … 249 236 proc /proc proc defaults 0 0 250 237 /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. 253 244 254 245 - Do ``mount /mnt/testbox-tftp && mount /mnt/testbox-backup`` to mount the -
trunk/src/VBox/ValidationKit/docs/testbox-pxe-conf.sh
r64583 r64599 31 31 # 32 32 MY_NFS_SERVER_IP="10.165.98.50" 33 MY_GATEWAY_IP="10.165.98. 0"33 MY_GATEWAY_IP="10.165.98.1" 34 34 MY_NETMASK="255.255.128.0" 35 35 MY_ETH_DEV="eth0" 36 MY_AUTO_CFG="any" 37 MY_DNS0_IP="10.165.246.33" 38 MY_DNS1_IP="192.135.82.44" 36 MY_AUTO_CFG="none" 39 37 40 38 # options … … 75 73 fi 76 74 if test -z "${MY_IP}"; then 75 # Split up the IP if possible, if not do gethostbyname on the argument. 77 76 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 84 89 fi 90 MY_IP_HEX=`printf "%02X%02X%02X%02X" ${MY_TMP}`; 91 MY_IP="${MY_ARG}"; 85 92 else 86 93 if test -z "${MY_ACTION}"; then … … 132 139 echo -n " nfsroot=${MY_NFS_SERVER_IP}:/export/testbox-nfsroot,ro,tcp" >> "${MY_CFG_FILE}"; 133 140 echo -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}"; 141 if 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}"; 144 else 145 echo -n " ip=${MY_AUTO_CFG}" >> "${MY_CFG_FILE}"; 146 fi 135 147 echo "" >> "${MY_CFG_FILE}"; 136 148 echo "LABEL local-boot" >> "${MY_CFG_FILE}"; 137 149 echo "LOCALBOOT" >> "${MY_CFG_FILE}"; 138 echo "Successfully generated ${MY_CFG_FILE}."150 echo "Successfully generated '${MY_CFG_FILE}'." 139 151 exit 0; 140 152
Note:
See TracChangeset
for help on using the changeset viewer.