Dean Troyer | 54b9732 | 2014-06-20 17:53:55 -0500 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <title>PXE Boot Server Guide - DevStack</title> |
| 6 | <meta name="description" content=""> |
| 7 | <meta name="author" content=""> |
| 8 | |
| 9 | <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> |
| 10 | <!--[if lt IE 9]> |
| 11 | <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> |
| 12 | <![endif]--> |
| 13 | |
| 14 | <!-- Le styles --> |
| 15 | <link href="../assets/css/bootstrap.css" rel="stylesheet"> |
| 16 | <link href="../assets/css/local.css" rel="stylesheet"> |
| 17 | <style type="text/css"> |
| 18 | body { padding-top: 60px; } |
| 19 | dd { padding: 10px; } |
| 20 | </style> |
| 21 | |
| 22 | <!-- Le javascripts --> |
| 23 | <script src="../assets/js/jquery-1.7.1.min.js" type="text/javascript" charset="utf-8"></script> |
| 24 | <script src="../assets/js/bootstrap.js" type="text/javascript" charset="utf-8"></script> |
| 25 | </head> |
| 26 | |
| 27 | <body> |
| 28 | |
| 29 | <div class="navbar navbar-fixed-top"> |
| 30 | <div class="navbar-inner"> |
| 31 | <div class="container"> |
| 32 | <a class="brand" href="/">DevStack</a> |
| 33 | <ul class="nav pull-right"> |
| 34 | <li><a href="../overview.html">Overview</a></li> |
| 35 | <li><a href="../changes.html">Changes</a></li> |
| 36 | <li><a href="../faq.html">FAQ</a></li> |
| 37 | <li><a href="http://github.com/openstack-dev/devstack">GitHub</a></li> |
| 38 | <li><a href="https://review.openstack.org/#/q/status:open+project:openstack-dev/devstack,n,z">Gerrit</a></li> |
| 39 | </ul> |
| 40 | </div> |
| 41 | </div> |
| 42 | </div> |
| 43 | |
| 44 | <div class="container"> |
| 45 | <section id="overview"> |
| 46 | <h1>PXE Boot Server Guide: Magic Dust for Network Boot</h1> |
| 47 | <p>Boot DevStack from a PXE server to a RAM disk.</p> |
| 48 | </section> |
| 49 | |
| 50 | <section id="requirements"> |
| 51 | <div class="page-header"> |
| 52 | <h2>Prerequisites <small>Hardware & OpenWRT</small></h2> |
| 53 | </div> |
| 54 | |
| 55 | <h3>Hardware</h3> |
| 56 | <p>The whole point of this exercise is to have a highly portable boot server, so using a small router with a USB port is the desired platform. This guide uses a Buffalo WZR-HP-G300NH as an example, but it is easily generalized for other supported platforms. See openwrt.org for more.</p> |
| 57 | |
| 58 | <h3>OpenWRT</h3> |
| 59 | <p>Any recent 'Backfire' build of OpenWRT will work for the boot server project. We build from trunk and have made the images available at <a href="http://openwrt.xr7.org/openwrt">http://openwrt.xr7.org/openwrt</a>.</p> |
| 60 | </section> |
| 61 | |
| 62 | <section id="installation"> |
| 63 | <div class="page-header"> |
| 64 | <h2>Installation <small>bit blasting</small></h2> |
| 65 | </div> |
| 66 | |
| 67 | <h3>Install the Image</h3> |
| 68 | <p>This process follows <a href="http://wiki.openwrt.org/toh/buffalo/wzr-hp-g300h">the OpenWRT doc OEM Install</a> to tftp the new image onto the router. You need a computer to set up the router, we assume it is a recent Linux or OS/X installation.</p> |
| 69 | <ul> |
| 70 | <li>Get openwrt-ar71xx-wzr-hp-g300nh-squashfs-tftp.bin |
| 71 | <pre>wget http://openwrt.xr7.org/openwrt/ar71xx/openwrt-ar71xx-wzr-hp-g300nh-squashfs-tftp.bin</pre> |
| 72 | </li> |
| 73 | <li>Connect computer to LAN port 4 (closest to WAN port)</li> |
| 74 | <li>Set computer interface to IP address in the 192.168.11.2</li> |
| 75 | <li>Add static arp entry for router |
| 76 | <pre>arp -s 192.168.11.1 <mac-address></pre> |
| 77 | </li> |
| 78 | <li>Start TFTP transfer attempt |
| 79 | <pre>tftp 192.168.11.1 |
| 80 | binary |
| 81 | rexmt 1 |
| 82 | timeout 60 |
| 83 | put openwrt-ar71xx-wzr-hp-g300nh-squashfs-tftp.bin</pre> |
| 84 | </li> |
| 85 | <li>Power on router. Router will reboot and initialize on 192.168.1.1.</li> |
| 86 | <li>Delete static arp entry for router |
| 87 | <pre>arp -d 192.168.11.1</pre> |
| 88 | </li> |
| 89 | <li>Set computer to DHCP, connect and telnet to router and set root password.</li> |
| 90 | </ul> |
| 91 | |
| 92 | <h3>Configure the Router</h3> |
| 93 | <ul> |
| 94 | <li>Update <code>/etc/opkg.conf</code> to point to our repo: |
| 95 | <pre>src/gz packages http://192.168.5.13/openwrt/build/ar71xx/packages</pre> |
| 96 | </li> |
| 97 | <li>Configure anon mounts: |
| 98 | <pre>uci delete fstab.@mount[0] |
| 99 | uci commit fstab |
| 100 | /etc/init.d/fstab restart</pre> |
| 101 | </li> |
| 102 | <li>Reset the DHCP address range. DevStack will claim the upper |
| 103 | /25 of the router's LAN address space for floating IPs so the |
| 104 | default DHCP address range needs to be moved: |
| 105 | <pre>uci set dhcp.lan.start=65 |
| 106 | uci set dhcp.lan.limit=60 |
| 107 | uci commit dhcp</pre> |
| 108 | </li> |
| 109 | <li>Enable TFTP: |
| 110 | <pre>uci set dhcp.@dnsmasq[0].enable_tftp=1 |
| 111 | uci set dhcp.@dnsmasq[0].tftp_root=/mnt/sda1/tftpboot |
| 112 | uci set dhcp.@dnsmasq[0].dhcp_boot=pxelinux.0 |
| 113 | uci commit dhcp |
| 114 | /etc/init.d/dnsmasq restart</pre> |
| 115 | </li> |
| 116 | </ul> |
| 117 | |
| 118 | <h3>Set Up tftpboot</h3> |
| 119 | <ul> |
| 120 | <li>Create the <code>/tmp/tftpboot</code> structure and populate it: |
| 121 | <pre>cd ~/devstack |
| 122 | tools/build_pxe_boot.sh /tmp</pre> |
| 123 | This calls <code>tools/build_ramdisk.sh</code> to create a 2GB ramdisk |
| 124 | containing a complete development Oneiric OS plus the |
| 125 | OpenStack code checkouts. |
| 126 | </li> |
| 127 | <li>Copy <code>tftpboot</code> to a USB drive: |
| 128 | <pre>mount /dev/sdb1 /mnt/tmp |
| 129 | rsync -a /tmp/tftpboot/ /mnt/tmp/tftpboot/ |
| 130 | umount /mnt/tmp</pre> |
| 131 | </li> |
| 132 | <li>Plug USB drive into router. It will be automounted and is ready to serve content.</li> |
| 133 | </ul> |
| 134 | |
| 135 | <p>Now <a href="ramdisk.html">return</a> to the RAM disk Guide to kick |
| 136 | off your DevStack experience.</p> |
| 137 | |
| 138 | </section> |
| 139 | |
| 140 | <footer> |
| 141 | <p>© Openstack Foundation 2011-2013 — this is not an official OpenStack project...</p> |
| 142 | </footer> |
| 143 | |
| 144 | </div> <!-- /container --> |
| 145 | |
| 146 | </body> |
| 147 | </html> |