給定一個網絡架構圖
對於安裝過程中有問題的可以互相交流,本人折騰了好幾天了
1.安裝DHCP、tftp、HTTP。
[root@test ~]# yum install dhcp tftp-server httpd xinetd
2.修改DHCP、tftp、HTTP配置文件
[root@test ~]# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
cp: overwrite ‘/etc/dhcp/dhcpd.conf’? y
修改後DHCP文件內容如下:
啓動DHCP服務
安裝syslinux生成pxelinux.0,[root@test ~]# yum install syslinux
配置tftp服務
[root@test ~]# rpm -ql tftp-server
/etc/xinetd.d/tftp
/usr/lib/systemd/system/tftp.service
/usr/lib/systemd/system/tftp.socket
/usr/sbin/in.tftpd
/usr/share/doc/tftp-server-5.2
/usr/share/doc/tftp-server-5.2/CHANGES
/usr/share/doc/tftp-server-5.2/README
/usr/share/doc/tftp-server-5.2/README.security
/usr/share/man/man8/in.tftpd.8.gz
/usr/share/man/man8/tftpd.8.gz
/var/lib/tftpboot
配置HTTP服務
修改配置後,重啓一下HTTP
[root@test conf.d]# systemctl restart httpd.service
關閉selinux,iptables
ks文件也是通過anaconda-ks.cfg修改過來的,內容如下:ks文件的設置可查看文檔Red_Hat_Enterprise_Linux-7-Installation_Guide-en-US.pdf,裏面有詳細的配置過程
此時設定客戶機用網絡啓動,出現如下界面
上面顯示Error因爲在ks文件中寫了兩個nework,修改過後如下
在這裏等一下後,按上下移動鍵就會顯示如下:
出現以上情況的原因是由於在/var/lib/tftpboot/pxelinux.cfg目錄下的default文件中在
menu linux
....
...
append ... inst.stage2=...ks=.. 把stage2=..都刪除
安裝好後會自動重啓的(此時在BIOS調整一下啓動順序即可了),記住也可以設定爲安裝好後關機。
啓動後,登錄界面,登錄後如下 網卡也獲取到了ip地址
ValueError: new value non-existent xfs filesystem is not valid as a default fs type Pane is dead
由於引用的CentOS-7-x86_64-NetInstall-1511.iso這個ISO包比較老,更新後使用老的CentOS-7-x86_64-NetInstall-1511.iso通過網絡安裝新的系統時,存在異常
提供一個ks.cfg的完整內容 #version=DEVEL # System authorization information auth --enableshadow --passalgo=sha512 # Use network installation url --url="http://mirrors.aliyun.com/centos/7/os/x86_64/" # Use graphical install #graphical text # Run the Setup Agent on first boot firstboot --disable ignoredisk --only-use=sda # Keyboard layouts keyboard --vckeymap=us --xlayouts='us' # System language lang en_US.UTF-8 # Network information network --bootproto=dhcp --device=eno16777728 --ipv6=auto --activate --hostname=c7ks firewall --disabled selinux --disabled # Root password rootpw --iscrypted $6$pbOvzICwsWYgm4nU$FNh23fV8tv9jcWE3oe36VcvqeYkVsSxTDI6IS/uTul5Zp4f3BCHzbF0Xl2aogZ48hxEnLpSIVwYTbZ2Dh12oy/ # System services services --disabled="chronyd" # System timezone timezone Asia/Shanghai --isUtc --nontp # System bootloader configuration bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda # Partition clearing information clearpart --none --initlabel # Disk partitioning information part pv.195 --fstype="lvmpv" --ondisk=sda --size=59280 part /boot --fstype="xfs" --ondisk=sda --size=244 volgroup centos --pesize=4096 pv.195 logvol swap --fstype="swap" --size=2048 --name=swap --vgname=centos logvol /home --fstype="xfs" --size=28610 --name=home --vgname=centos logvol / --fstype="xfs" --size=28610 --name=root --vgname=centos reboot %packages @core iptraf vim openssh-server ntp %end #%addon com_redhat_kdump --enable --reserve-mb='auto' #%end
參考
由於磁盤沒有格式化,使用上面的ks進行自動安裝時,報下面的異常
storage configuration failed: Unable to allocate requested partition schema. ..... Not enough space in file systems for the current software selection. An additional 1069.52MiB is needed. ...
只要把ks.cfg文件下面內容改爲 # Partition clearing information clearpart --none --initlabel # Partition clearing information clearpart --all --initlabel
即可