Update bare_metal_offline.md

Fix format.
This commit is contained in:
Stewart-YU
2017-09-10 18:07:38 +08:00
committed by GitHub
parent 4a55e28166
commit 3e49e008cc
@@ -42,19 +42,14 @@ To setup CentOS PXELINUX environment there is a complete [guide here](http://doc
1. Install packages needed on CentOS 1. Install packages needed on CentOS
```shell
sudo yum install tftp-server dhcp syslinux sudo yum install tftp-server dhcp syslinux
```
2. `vi /etc/xinetd.d/tftp` to enable tftp service and change disable to 'no' 2. `vi /etc/xinetd.d/tftp` to enable tftp service and change disable to 'no'
```conf go get github.com/vmware/photon-controller-cli/photon
disable = no
```
3. Copy over the syslinux images we will need. 3. Copy over the syslinux images we will need.
```shell
su - su -
mkdir -p /tftpboot mkdir -p /tftpboot
cd /tftpboot cd /tftpboot
@@ -67,18 +62,14 @@ cp /usr/share/syslinux/chain.c32 /tftpboot
/sbin/service dhcpd start /sbin/service dhcpd start
/sbin/service xinetd start /sbin/service xinetd start
/sbin/chkconfig tftp on /sbin/chkconfig tftp on
```
4. Setup default boot menu 4. Setup default boot menu
```shell
mkdir /tftpboot/pxelinux.cfg mkdir /tftpboot/pxelinux.cfg
touch /tftpboot/pxelinux.cfg/default touch /tftpboot/pxelinux.cfg/default
```
5. Edit the menu `vi /tftpboot/pxelinux.cfg/default` 5. Edit the menu `vi /tftpboot/pxelinux.cfg/default`
```conf
default menu.c32 default menu.c32
prompt 0 prompt 0
timeout 15 timeout 15
@@ -90,20 +81,17 @@ MENU TITLE Main Menu
LABEL local LABEL local
MENU LABEL Boot local hard drive MENU LABEL Boot local hard drive
LOCALBOOT 0 LOCALBOOT 0
```
Now you should have a working PXELINUX setup to image CoreOS nodes. You can verify the services by using VirtualBox locally or with bare metal servers. Now you should have a working PXELINUX setup to image CoreOS nodes. You can verify the services by using VirtualBox locally or with bare metal servers.
## Adding CoreOS to PXE ## Adding CoreOS to PXE
This section describes how to setup the CoreOS images to live alongside a pre-existing PXELINUX environment. This section describes how to setup the CoreOS images to live alongside a pre-existing PXELINUX environment.
1. Find or create the TFTP root directory that everything will be based on. 1. Find or create the TFTP root directory that everything will be based on.
* For this document we will assume `/tftpboot/` is our root directory. - For this document we will assume `/tftpboot/` is our root directory.
2. Once we know and have our tftp root directory we will create a new directory structure for our CoreOS images. 2. Once we know and have our tftp root directory we will create a new directory structure for our CoreOS images.
3. Download the CoreOS PXE files provided by the CoreOS team. 3. Download the CoreOS PXE files provided by the CoreOS team.
```shell
MY_TFTPROOT_DIR=/tftpboot MY_TFTPROOT_DIR=/tftpboot
mkdir -p $MY_TFTPROOT_DIR/images/coreos/ mkdir -p $MY_TFTPROOT_DIR/images/coreos/
cd $MY_TFTPROOT_DIR/images/coreos/ cd $MY_TFTPROOT_DIR/images/coreos/
@@ -113,11 +101,9 @@ wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_i
wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz.sig wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz.sig
gpg --verify coreos_production_pxe.vmlinuz.sig gpg --verify coreos_production_pxe.vmlinuz.sig
gpg --verify coreos_production_pxe_image.cpio.gz.sig gpg --verify coreos_production_pxe_image.cpio.gz.sig
```
4. Edit the menu `vi /tftpboot/pxelinux.cfg/default` again 4. Edit the menu `vi /tftpboot/pxelinux.cfg/default` again
```conf
default menu.c32 default menu.c32
prompt 0 prompt 0
timeout 300 timeout 300
@@ -142,23 +128,18 @@ MENU BEGIN CoreOS Menu
KERNEL images/coreos/coreos_production_pxe.vmlinuz KERNEL images/coreos/coreos_production_pxe.vmlinuz
APPEND initrd=images/coreos/coreos_production_pxe_image.cpio.gz cloud-config-url=http://<xxx.xxx.xxx.xxx>/pxe-cloud-config-slave.yml APPEND initrd=images/coreos/coreos_production_pxe_image.cpio.gz cloud-config-url=http://<xxx.xxx.xxx.xxx>/pxe-cloud-config-slave.yml
MENU END MENU END
```
This configuration file will now boot from local drive but have the option to PXE image CoreOS. This configuration file will now boot from local drive but have the option to PXE image CoreOS.
## DHCP configuration ## DHCP configuration
This section covers configuring the DHCP server to hand out our new images. In this case we are assuming that there are other servers that will boot alongside other images. This section covers configuring the DHCP server to hand out our new images. In this case we are assuming that there are other servers that will boot alongside other images.
1. Add the `filename` to the _host_ or _subnet_ sections. 1. Add the `filename` to the _host_ or _subnet_ sections.
```conf
filename "/tftpboot/pxelinux.0"; filename "/tftpboot/pxelinux.0";
```
2. At this point we want to make pxelinux configuration files that will be the templates for the different CoreOS deployments. 2. At this point we want to make pxelinux configuration files that will be the templates for the different CoreOS deployments.
```conf
subnet 10.20.30.0 netmask 255.255.255.0 { subnet 10.20.30.0 netmask 255.255.255.0 {
next-server 10.20.30.242; next-server 10.20.30.242;
option broadcast-address 10.20.30.255; option broadcast-address 10.20.30.255;
@@ -189,7 +170,6 @@ subnet 10.20.30.0 netmask 255.255.255.0 {
} }
... ...
} }
```
We will be specifying the node configuration later in the guide. We will be specifying the node configuration later in the guide.