云计算 python PXE+KS无人值守安装

PXE是一个预启动环境 是由inter公司开发的,可以让计算机在网络中去启动操作系统

主要是用于安装客户机的引导系统

Kickstart:无人值守安装方式,其工作原理就是将运维人员的操作,保存到一个ks.cfg的一个文件当中,在安装过程当中会自动执行里面的步骤

需要的服务:

DHCP:主要是用来分配IP,让两台主机之间进行联通

TFTP:简单文件传输协议,负责传输小的文件,其特点:是不需要经过认证,可以直接用来进行传输,用的是UDP协议(传输层),端口号69

FTP:将完整的操作系统进行传输,通过共享目录的方式进行传输,共享目录在/var/ftp下面,还可以使用httpd,共享目录在/var/www/,还有nfs

一台2G的虚拟机

安装配置DHCP:给需要安装操作系统的主机分配IP

[root@localhost yum.repos.d]# yum -y install dhcp

[root@localhost yum.repos.d]# vim /etc/dhcp/dhcpd.conf

 

启动服务:

[root@localhost yum.repos.d]# systemctl restart dhcpd

安装配置TFTP

[root@localhost yum.repos.d]# yum -y install tftp xinetd tftp-server //xinetd:管理tftp的组件

[root@localhost yum.repos.d]# vim /etc/xinetd.d/tftp

 

安装拷贝启动程序需要的东西:

[root@localhost yum.repos.d]# yum -y install syslinux //包含了引导程序,syslinux提供pxelinux.0文件生成ks.cfg

将所有的引导文件放到这个下面就可以进行传输:

[root@localhost yum.repos.d]# cd /var/lib/tftpboot/

[root@localhost tftpboot]# cp /usr/share/syslinux/pxelinux.0 . //pxeboot:远程安装系统,引导程序内容,提供生成ks.cfg文件的用syslinux软件进行拷贝

[root@localhost tftpboot]# cp /media/images/pxeboot/vmlinuz . //tftp传输文件包含pxe网络安装系统的虚拟的根目录和虚拟的内核

[root@localhost tftpboot]# cp /media/images/pxeboot/initrd.img . //镜像

[root@localhost tftpboot]# cp /media/isolinux/vesamenu.c32 . //图形安装界面程序

[root@localhost tftpboot]# cp /media/isolinux/splash.png .  //背景图片

[root@localhost tftpboot]# cp /media/isolinux/boot.* . //提示信息,启动选项

[root@localhost tftpboot]# mkdir pxelinux.cfg 创建pxelinux引导目录

[root@localhost tftpboot]# cp /media/isolinux/isolinux.cfg pxelinux.cfg/default //创建default引导文件

修改配置文件:

[root@localhost tftpboot]# vim pxelinux.cfg/default

 

 

网络安装包的位置,ks:虚拟机的什么分区时区都在ks.cfg里面

重新启动:

[root@localhost tftpboot]# systemctl restart xinetd

[root@localhost tftpboot]# systemctl restart tftp

配置安装ftp:

[root@localhost tftpboot]# yum -y install vsftpd

匿名用户的共享目录:

[root@localhost tftpboot]# cd /var/ftp/

[root@localhost ftp]#ls

[root@localhost ftp]# mkdir centos //创建安装文件目录

复制挂载点里面的全部内容:

[root@localhost centos]# cp -r /media/* . //将光盘中的文件拷贝到安装文件

[root@localhost centos]# cp /root/anaconda-ks.cfg ./ks.cfg //把原有的启动分区里面所有东西都拷贝到pxe里面

[root@localhost centos]# chmod +r ks.cfg

[root@localhost centos]# vim ks.cfg

 

 

 

[root@localhost centos]# systemctl restart vsftpd

[root@localhost centos]# systemctl stop firewalld

[root@localhost centos]# setenforce 0

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

数据库从删库到跑路

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值