Difference between revisions of "Set up PXE boot VM"
From HallCWiki
(→Set up the PXE boot) |
(→Set up the filesystem and NFS export) |
||
(12 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
== Set up the PXE boot == | == Set up the PXE boot == | ||
* Install required packages: yum install nfs-utils tftp-server syslinux-tftpboot syslinux | * Install required packages: yum install nfs-utils tftp-server syslinux-tftpboot syslinux | ||
− | * Enable tftp as root: | + | * Enable tftp as root: (an explanation about tftp.service and tftp.socket: [https://blog.thewatertower.org/2019/05/01/tftp-part-3-replacing-xinetd-with-systemd/]) |
<pre> | <pre> | ||
systemctl enable tftp.socket | systemctl enable tftp.socket | ||
Line 17: | Line 17: | ||
<pre> | <pre> | ||
cd /tftpboot/linux-diskless | cd /tftpboot/linux-diskless | ||
− | cp /usr/share/syslinux/pxelinux.0 . | + | cp /usr/share/syslinux/pxelinux.0 . (This turns out not working. Instead, do: scp root@cdaqfs1:/tftpboot/linux-diskless/pxelinux.0 ) |
scp -r root@cdaqfs1:/tftpboot/linux-diskless/pxelinux.cfg . | scp -r root@cdaqfs1:/tftpboot/linux-diskless/pxelinux.cfg . | ||
</pre> | </pre> | ||
− | * Copy boot images from cdaqfs1 to /tftpboot/linux-diskless/: | + | * Copy x86_64 boot images from cdaqfs1 to /tftpboot/linux-diskless/: |
<pre> | <pre> | ||
scp -r root@cdaqfs1:/tftpboot/linux-diskless/boot . | scp -r root@cdaqfs1:/tftpboot/linux-diskless/boot . | ||
</pre> | </pre> | ||
+ | * Copy armv7 boot images from cdaqfs1 to /tftpboot/linux-diskless/: | ||
+ | <pre> | ||
+ | scp -r root@cdaqfs1:/tftpboot/linux-diskless/CentOS7-armv7-Diskless . | ||
+ | </pre> | ||
+ | * Edit tftp systemd configuration file to let the tftp directory point to the /tftpboot: | ||
+ | <pre> | ||
+ | vi /usr/lib/systemd/system/tftp.service | ||
+ | </pre> | ||
+ | and change: | ||
+ | <pre> | ||
+ | ExecStart=/usr/sbin/in.tftpd -s /tftpboot | ||
+ | </pre> | ||
+ | |||
+ | == Set up the filesystem and NFS export == | ||
+ | === x86_64 === | ||
+ | * The root/ NFS mount is defined in /tftpboot/linux-diskless/pxelinux.cfg/default | ||
+ | * Copy the file system over from cdaqfs1 to cdaqpxe: | ||
+ | <pre> | ||
+ | cdaqfs1: /diskless/CentOS7/x86_64 | ||
+ | </pre> | ||
+ | * Change the root mount NFS server IP to cdaqpxe in /tftpboot/linux-diskless/pxelinux.cfg/default | ||
+ | * Change the snapshot mount NFS server at /diskless/CentOS7/x86_64/root/etc/sysconfig/readonly-root | ||
+ | * Copy the home mount directory over from cdaqfs1 to cdaqpxe: | ||
+ | <pre> | ||
+ | cdaqfs1: /home/diskless/hccoda | ||
+ | </pre> | ||
+ | * Somehow, CODA running at coda@cdaql* is connecting to the ROCs using startROC.sh scripts under /home/coda/coda/coda_scripts/. So /home/coda/ needs to be mounted on the ROCs as well. Create a soft link | ||
+ | <pre> | ||
+ | cdaqfs: ln -s /coda-home /home/diskless/coda | ||
+ | </pre> | ||
+ | * Change the home mount NFS server at /diskless/CentOS7/x86_64/root/etc/auto.master.d/auto.home | ||
+ | * Set up the NFS exports at cdaqpxe: /etc/exports | ||
+ | ==== Switch from cdaqfs1 to cdaqfs ==== | ||
+ | * Create "cdaqfs" dir under root@cdaqpxe:/diskless/CentOS7/x86_64/root/net | ||
+ | * Remove "coda.autofs" and "cdaqfs1.autofs" in /diskless/CentOS7/x86_64/root/etc/auto.master.d/ | ||
+ | * Add "cdaqfs.autofs" and "auto.cdaqfs" in /diskless/CentOS7/x86_64/root/etc/auto.master.d/ | ||
+ | * Restart autofs at the crate as root: systemctl restart autofs | ||
+ | === armv7 === | ||
+ | * change the tftp server IP by interrupting the VTP boot process to get the 'Zynq" prompt. Then use "setenv" and "saveenv" to modify the tftp server ip | ||
+ | * The rest of the changes are similar to "x86_64" listed above | ||
+ | ==== Switch from cdaqfs1 to cdaqfs ==== | ||
+ | * Remove "coda.autofs" and "cdaqfs1.autofs" in /diskless/CentOS7/armv7/root/etc/auto.master.d/ | ||
+ | * Add "cdaqfs.autofs" and "auto.cdaqfs" in /diskless/CentOS7/armv7/root/etc/auto.master.d/ | ||
+ | * Restart autofs at the crate as root: systemctl restart autofs |
Latest revision as of 11:55, 24 July 2024
Contents
PXE boot VM
- The ROCs and VTPs are booted using PXEboot. The PXEboot is hosted in a virtual machine located at the Hall ESX clusters. The VM name is "cdaqpxe.jlab.org"
Set up the PXE boot
- Install required packages: yum install nfs-utils tftp-server syslinux-tftpboot syslinux
- Enable tftp as root: (an explanation about tftp.service and tftp.socket: [1])
systemctl enable tftp.socket systemctl start tftp.socket
- Create PXE boot directory:
cd /tftpboot mkdir linux-diskless
- Set up PXE boot configurations
cd /tftpboot/linux-diskless cp /usr/share/syslinux/pxelinux.0 . (This turns out not working. Instead, do: scp root@cdaqfs1:/tftpboot/linux-diskless/pxelinux.0 ) scp -r root@cdaqfs1:/tftpboot/linux-diskless/pxelinux.cfg .
- Copy x86_64 boot images from cdaqfs1 to /tftpboot/linux-diskless/:
scp -r root@cdaqfs1:/tftpboot/linux-diskless/boot .
- Copy armv7 boot images from cdaqfs1 to /tftpboot/linux-diskless/:
scp -r root@cdaqfs1:/tftpboot/linux-diskless/CentOS7-armv7-Diskless .
- Edit tftp systemd configuration file to let the tftp directory point to the /tftpboot:
vi /usr/lib/systemd/system/tftp.service
and change:
ExecStart=/usr/sbin/in.tftpd -s /tftpboot
Set up the filesystem and NFS export
x86_64
- The root/ NFS mount is defined in /tftpboot/linux-diskless/pxelinux.cfg/default
- Copy the file system over from cdaqfs1 to cdaqpxe:
cdaqfs1: /diskless/CentOS7/x86_64
- Change the root mount NFS server IP to cdaqpxe in /tftpboot/linux-diskless/pxelinux.cfg/default
- Change the snapshot mount NFS server at /diskless/CentOS7/x86_64/root/etc/sysconfig/readonly-root
- Copy the home mount directory over from cdaqfs1 to cdaqpxe:
cdaqfs1: /home/diskless/hccoda
- Somehow, CODA running at coda@cdaql* is connecting to the ROCs using startROC.sh scripts under /home/coda/coda/coda_scripts/. So /home/coda/ needs to be mounted on the ROCs as well. Create a soft link
cdaqfs: ln -s /coda-home /home/diskless/coda
- Change the home mount NFS server at /diskless/CentOS7/x86_64/root/etc/auto.master.d/auto.home
- Set up the NFS exports at cdaqpxe: /etc/exports
Switch from cdaqfs1 to cdaqfs
- Create "cdaqfs" dir under root@cdaqpxe:/diskless/CentOS7/x86_64/root/net
- Remove "coda.autofs" and "cdaqfs1.autofs" in /diskless/CentOS7/x86_64/root/etc/auto.master.d/
- Add "cdaqfs.autofs" and "auto.cdaqfs" in /diskless/CentOS7/x86_64/root/etc/auto.master.d/
- Restart autofs at the crate as root: systemctl restart autofs
armv7
- change the tftp server IP by interrupting the VTP boot process to get the 'Zynq" prompt. Then use "setenv" and "saveenv" to modify the tftp server ip
- The rest of the changes are similar to "x86_64" listed above
Switch from cdaqfs1 to cdaqfs
- Remove "coda.autofs" and "cdaqfs1.autofs" in /diskless/CentOS7/armv7/root/etc/auto.master.d/
- Add "cdaqfs.autofs" and "auto.cdaqfs" in /diskless/CentOS7/armv7/root/etc/auto.master.d/
- Restart autofs at the crate as root: systemctl restart autofs