Browse code

Adding PXE boot server setup how-to md file.

Mahmoud Bassiouny authored on 2015/07/10 07:54:58
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,88 @@
0
+#Network PXE Boot
1
+
2
+Photon supports pxe boot over netwrok, this is describe how you can setup a PXE boot server to install Photon.
3
+
4
+#Server Setup
5
+
6
+To setup PXE server you will need to have:
7
+* DHCP server to allow hosts to get an IP address.
8
+* TFTP server which is file transfer protocol which is similar to FTP with no authintication.
9
+* Optionally http server, this http serevr is going to serve the RPMs yum repo, or you can use the official Photon repo on bintray. Also this http serevr can be used if you want to provide kickstart config for unattended installation.
10
+
11
+Setting up server instruction is based on an Ubuntu 14.04 machine assuming that it has an static IP adderess `172.16.78.134`.
12
+
13
+##DHCP Setup
14
+* Intall dhcp server
15
+```
16
+  sudo apt-get install isc-dhcp-server
17
+```
18
+* Edit ethernet interface in `/etc/default/isc-dhcp-server` to `INTERFACES="eth0"`
19
+* Edit dhcp configuration in `/etc/dhcp/dhcpd.conf`, will allow machines to boot and get IP address via DHCP in the range `172.16.78.230 - 172.16.78.250`
20
+```
21
+  subnet 172.16.78.0 netmask 255.255.255.0 {
22
+    range 172.16.78.230 172.16.78.250;
23
+    option subnet-mask 255.255.255.0;
24
+    option routers 172.16.78.134;
25
+    option broadcast-address 172.16.78.255;
26
+    filename "pxelinux.0";
27
+    next-server 172.16.78.134;
28
+  }
29
+
30
+```
31
+* Restart dhcp server
32
+```
33
+  sudo service isc-dhcp-server restart
34
+```
35
+
36
+##TFTP Setup
37
+* Install TFTP server
38
+```
39
+  sudo apt-get install tftpd-hpa
40
+```
41
+* Enable boot service, and restrat the service
42
+```
43
+  sudo update-inetd --enable BOOT
44
+  sudo service tftpd-hpa restart
45
+```
46
+##Optional: http server setup
47
+This is step is only needed if:
48
+* Planning to serve the ks config file through this server, please refer to [Kickstart suuport](kickstart.md) for more details.
49
+* Serving your local yum repo.
50
+You can install apache http web server
51
+```
52
+sudo apt-get install apache2
53
+```
54
+Mount the photon iso to get the RPMS repo and sample ks config file.
55
+```
56
+mkdir /mnt/photon-iso
57
+sudo mount <photon_iso> /mnt/photon-iso/
58
+```
59
+Copy the RPMS repo.
60
+```
61
+cp -r /mnt/photon-iso/RPMS /var/www/html/
62
+```
63
+To support ks, may be you can copy the sample config from the iso and editing it, please refer to [Kickstart suuport](kickstart.md) for more details.
64
+```
65
+cp /mnt/photon-iso/isolinux/sample_ks.cfg /var/www/html/my_ks.cfg
66
+```
67
+
68
+##PXE boot files setup
69
+* Mount photon.iso to get linux and initrd images
70
+```
71
+mkdir /tmp/photon-iso
72
+sudo mount <photon_iso> /tmp/photon-iso/
73
+```
74
+* Setting the PXE boot files
75
+```
76
+pushd /var/lib/tftpboot
77
+cp -r /tmp/photon-iso/isolinux/* .
78
+cp /usr/lib/syslinux/pxelinux.0 .
79
+mkdir pxelinux.cfg
80
+mv isolinux.cfg pxelinux.cfg/default
81
+```
82
+* Update repo param to point to http yum repo, you may pass official photon bintray repo.
83
+```
84
+sed -i "s/append/append repo=http:\/\/172.16.78.134\/RPMS/g" menu.cfg
85
+popd
86
+```
87
+* Optionally, you can add your ks config file, please refer [Kickstart suuport](kickstart.md) for more details.