运维部署自动化实践(一)利用PXE远程自动化安装Ubuntu16.04 server

运维部署自动化实践(一)利用PXE远程自动化安装Ubuntu16.04 server,第1张

因为项目需要(实际是没有人手。。。),需要搞开发的我自己来搭建服务器集群环境,并完成软件服务的自动化部署。本文及后续文章,记录运维部署自动化实践中的每一步工作,便于以后追踪参考。

本文先完成第一步工作:远程自动化安装Linux系统

技术方案选择:PXE+dhcp+tftp+kickstart 安装ubuntu16.04 server

宿主机:ubuntu16.04 desktop

目标服务器:(1)Dell Poweredge R540

(2)VMware虚拟机

安装镜像: ubuntu-16.04.5-server-amd64.iso

安装isc-dhcp-server

sudo apt-get install isc-dhcp-server

修改/etc/default/isc-dhcp-server

修改/etc/dhcp/dhcpd.conf,添加如下配置

运行dhcp服务

sudo service isc-dhcp-server start

安装tftpd-hpa

sudo apt-get install tftpd-hpa

修改/etc/default/tftpd-hpa

创建tftp目录

sudo mkdir /var/lib/tftpboot

sudo chmod 777 /var/lib/tftpboot

运行tftp

sudo service tftp-hpa start

安装apache2

sudo apt-get install apache2

apache 默认的根目录是/var/www/html ,使用默认配置启动apache

sudo service apache2 start

通过浏览器访问http://192.168.1.110 测试http服务已开启

从修改内容看出,主要是为了添加pxe服务器的地址,以便目标机能够找到对应的ks.cfg以及seed文件。

将ks.cfg文件拷贝至http根目录

sudo cp ks.cfg /var/www/html/

Dell服务器与虚拟机均可自动开启安装过程,虚拟机全程无干扰安装完毕。

Dell服务器安装过程中报错:

the partition table format in use on your disks normally requires you to create a separate partition for boot loader code. this partition should de marked for use as a "reserved bios boot area" and should de at least 1 mb in size. note that this is not same as a partition mounted in /boot.

if you do not go back to the partitioning menu and correct,boot loader installation may fail later,although it may still be possible to install the loader to a partition.

在这一步卡住后安装程序无法自动执行,我手工点击忽略后系统也能够继续安装完毕。

网上各种搜,看到一些评论说debian系的linux不建议用kickstart安装,建议直接使用preseed配置来安装,接下来研究下看看能不能解决问题。

问题链接: https://serverfault.com/questions/658070/kickstarting-ubuntu-14-04-how-do-i-create-an-efi-boot-partition-from-my-ks-cf

下一章: 运维部署自动化实践(二)PXE+Preseed自动安装Ubuntu16.04 server

1. 配置DHCP 1,安装dhcpdyum install dhcp2,...

2. 配置TFTP 4,安装TFTPyum install tftp-server5,...

3. 配置引导内核

4. 配置kickstart

5. 验证 12,修改CentOS65虚拟配置文件CentOS65.vmx,增加一行bios.bootDelay= "10000",即表示在启动bios的时候停留10秒(否则你根本来不及按任何键的)


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/7518509.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-06
下一篇2023-04-06

发表评论

登录后才能评论

评论列表(0条)

    保存