PXE INSTALL
Contents
Requirements
install "dnsmasq nfs-utils syslinux"
emerge dnsmasq nfs-utils syslinux OR yum install -y dnsmasq nfs-utils syslinux
dnsmasq setting
$ sed '/^#/d;/^$/d' /etc/dnsmasq.conf interface=vboxnet0 server=10.20.0.1 dhcp-range=10.20.0.3,10.20.0.100,86400 dhcp-authoritative enable-tftp tftp-root=/tftpboot/ pxe-service=x86PC, "PXELINUX (BIOS)", "lpxelinux" pxe-service=X86-64_EFI, "PXELINUX (EFI)", "syslinux/efi64/syslinux.efi" log-queries log-dhcp cache-size=1500000 dhcp-host=08:00:27:ad:59:ac,10.20.0.60
mkdir -pv /tftpboot/pxelinux/pxelinux.cfg
cp -ar /usr/share/syslinux/ /tftpboot/
cp /usr/share/syslinux/{lpxelinux.0,libcom32.c32,libutil.c32,menu.c32} /tftpboot/
NFS setting & Mount installation ISO
$ cat /etc/exports /home/ftp/pub *(rw,no_root_squash,no_subtree_check) /home/ftp/pub/centos7-iso *(rw,no_root_squash,no_subtree_check) # exportfs -av exporting *:/home/ftp/pub/ exporting *:/home/ftp/pub/centos7-iso
mount -vo loop /mnt/play/Downloads/CentOS-7-x86_64-DVD-1708.iso /home/ftp/pub/centos7-iso cd /home/ftp/pub/centos7-iso cp images/pxeboot/vmlinuz /tftpboot/boot/vmlinuz_centos7 cp images/pxeboot/initrd.img /tftpboot/boot/initrd.img_centos7
/tftpboot/pxelinux.cfg/default
DEFAULT menu.c32 timeout 30 label pxe-autoinstall-CentOS7 kernel /boot/vmlinuz_centos7 append vga=773 initrd=/boot/initrd.img_centos7 ks=nfs:10.20.0.1:/home/ftp/pub/ks_CentOS7.cfg label ESXi6-DELL-Autoinstall kernel /ESXi6-DELL/mboot.c32 append -c /ESXi6-DELL/boot.cfg
CentOS7 ks.cfg
/home/ftp/pub/ks_CentOS7.cfg
install text # No graphic lang en_US.UTF-8 keyboard us timezone Asia/Shanghai authconfig --enableshadow --passalgo=sha512 # openssl passwd -1 rootpw --iscrypted $1$SP7ay3Ah$OkjZC25vIVMhp3zALurEt0 auth useshadow passalgo=sha512 selinux --disabled firewall --disabled services --enabled=sshd,rmda,opensm services --disable kdump eula --agreed network --onboot=yes --device=enp0s3 --bootproto=dhcp reboot # System bootloader configuration bootloader --location=mbr zerombr autopart --type=lvm # Partition clearing information, only sda. #clearpart --all --initlabel clearpart --drives=sda --all ignoredisk --only-use=sda url --url="nfs:10.20.0.1:/home/ftp/pub/centos7-iso" # Notice that base environment is specified with @^ and groups are specified with @. %packages --excludedocs @^minimal @core screen tcpdump wget bind-utils net-tools @Infiniband Support ibutils opensm rdma-core.x86_64 %end
ESXi6 autoinstall
/ESXi6-DELL/boot.cfg
cat /tftpboot/ESXi6-DELL/boot.cfg
bootstate=0 title=Loading ESXi installer timeout=2 prefix=/ESXi6-DELL/ kernelopt=ks=ftp://192.168.128.111/pub/ks_ESXi6_VSAN.cfg kernel=tboot.b00 #kernelopt=runweasel modules=b.b00 --- jumpstrt.gz --- useropts.gz --- k.b00 --- chardevs.b00 --- a.b00 --- user.b00 --- uc_intel.b00 --- uc_amd.b00 --- sb.v00 --- s.v00 --- lsi_mr3.v00 --- scsi_meg.v00 --- net_tg3.v00 --- elxnet.v00 --- ima_be2i.v00 --- lpfc.v00 --- scsi_be2.v00 --- net_ixgb.v00 --- net_i40e.v00 --- net_igb.v00 --- nmlx4_co.v00 --- nmlx4_en.v00 --- ima_qla4.v00 --- misc_cni.v00 --- net_bnx2.v00 --- net_bnx2.v01 --- net_cnic.v00 --- net_qlcn.v00 --- net_qlge.v00 --- qlnative.v00 --- scsi_bnx.v00 --- scsi_bnx.v01 --- scsi_qla.v00 --- mtip32xx.v00 --- ata_pata.v00 --- ata_pata.v01 --- ata_pata.v02 --- ata_pata.v03 --- ata_pata.v04 --- ata_pata.v05 --- ata_pata.v06 --- ata_pata.v07 --- block_cc.v00 --- ehci_ehc.v00 --- emulex_e.v00 --- weaselin.t00 --- esx_dvfi.v00 --- ipmi_ipm.v00 --- ipmi_ipm.v01 --- ipmi_ipm.v02 --- lsi_msgp.v00 --- lsu_hp_h.v00 --- lsu_lsi_.v00 --- lsu_lsi_.v01 --- lsu_lsi_.v02 --- lsu_lsi_.v03 --- lsu_lsi_.v04 --- misc_dri.v00 --- net_e100.v00 --- net_e100.v01 --- net_enic.v00 --- net_forc.v00 --- net_mlx4.v00 --- net_mlx4.v01 --- net_nx_n.v00 --- net_vmxn.v00 --- nmlx4_rd.v00 --- nvme.v00 --- ohci_usb.v00 --- rste.v00 --- sata_ahc.v00 --- sata_ata.v00 --- sata_sat.v00 --- sata_sat.v01 --- sata_sat.v02 --- sata_sat.v03 --- sata_sat.v04 --- scsi_aac.v00 --- scsi_adp.v00 --- scsi_aic.v00 --- scsi_fni.v00 --- scsi_hps.v00 --- scsi_ips.v00 --- scsi_meg.v01 --- scsi_meg.v02 --- scsi_mpt.v00 --- scsi_mpt.v01 --- scsi_mpt.v02 --- uhci_usb.v00 --- xhci_xhc.v00 --- tools.t00 --- dell_con.v00 --- xorg.v00 --- vsanheal.v00 --- imgdb.tgz --- imgpayld.tgz build= updated=0
ks_ESXi6_VSAN.cfg
vmaccepteula rootpw PASSWORD network --bootproto=dhcp --device=vmnic0 install --firstdisk --overwritevmfs --novmfsondisk #autopart --firstdisk --overwritevmfs reboot %firstboot --interpreter=busybox # SSH and ESXi shell vim-cmd hostsvc/enable_ssh vim-cmd hostsvc/start_ssh vim-cmd hostsvc/enable_esx_shell vim-cmd hostsvc/start_esx_shell esxcli system snmp set --communities public esxcli system snmp set --enable true
