码迷,mamicode.com
首页 > 其他好文 > 详细

IPXE搭建底层装机系统

时间:2020-05-23 00:30:33      阅读:91      评论:0      收藏:0      [点我收藏+]

标签:tle   OLE   float   innodb   embed   tty   arc   nod   names   

IPXE 开发

1: 上报安装进度
curl http://localhost:8083/api/osinstall/v1/report/deviceInstallLog -X POST -d ‘{"Sn":"xxxxxxx","Title":"dwasd","InstallProgres":0.4}‘
2: 生成MAC 文件
curl http://localhost:8083/api/osinstall/v1/device/createIpxeConfig -X POST -d ‘{"Sn":"xxxxxx","OsVersion":"bms_centos7.5-x86_64_Base"}‘
3: 增加机器
curl http://localhost:8083/api/osinstall/v1/machine/newadd -X POST -d ‘{"Sn":"xxxxxx","Mac":"68:05:CA:A2:5F:B8,68:05:CA:A2:5F:B9"}‘
4: 查询机器
curl http://localhost:8083/api/osinstall/v1/machine/newlist -X POST -d ‘{"Sn":"xxxxxx"}‘

1:数据库维护,
2:

待定
5: 接收参数
curl http://100.71.70.47:8083/api/osinstall/v1/device/parameter -X POST -d ‘{"Sn":"xxxxxxx","IP":"192.168.3.10"}‘

6: 生成OS配置文件

DROP TABLE IF EXISTS new_macs;
CREATE TABLE new_macs ( id int(11) unsigned NOT NULL AUTO_INCREMENT,created_at timestamp NULL DEFAULT NULL,deleted_at timestamp NULL DEFAULT NULL,updated_at timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, sn varchar(255) NOT NULL, mac varchar(512) NOT NULL, status varchar(255) NOT NULL, installProgres float NULL, PRIMARY KEY (id),UNIQUE KEY sn (sn)) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;

insert INTO new_macs (created_at,updated_at,sn,mac,status,installProgres) values(NOW(),NOW(),"xxxxxxxx","68:05:CA:A2:5F:B8,68:05:CA:A2:5F:B9,68:05:CA:A2:6D:E8,68:05:CA:A2:6D:E9","stat",0);

insert INTO os_configs (id,created_at,updated_at,deleted_at,name,pxe) values("17",NOW(),NOW(),NULL,"bms_centos7.5-x86_64_Base","#!ipxe
kernel http://30.138.250.65/centos7.5/images/pxeboot/vmlinuz initrd=initrd.img ksdevice=bootif ks=http://30.138.250.65/centos7.5/ks.cfg console=tty0 selinux=0 net.ifnames=0 biosdevname=0
initrd http://30.138.250.65/centos7.5/images/pxeboot/initrd.img
boot
");

make bin-x86_64-efi/ipxe.efi EMBED=uefi.ipxe
#!ipxe
dhcp
chain pxelinux.cfg/01-${netX/mac:hexhyp}
#iset ${pxelinux.cfg/01-${netX/mac:hexhyp}} && chain ${pxelinux.cfg/01-${netX/mac:hexhyp}} || chain pxelinux.cfg/default_uefi

#!ipxe
kernel http://192.168.255.133/centos/7.5/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img ksdevice=bootif ks=http://192.168.255.133/centos/ks.cfg console=tty0 selinux=0 net.ifnames=0 biosdevname=0
initrd http://192.168.255.133/centos/7.5/os/x86_64/images/pxeboot/initrd.img
boot

tftp
https://www.cnblogs.com/miaocbin/p/11314702.html

IPXE搭建底层装机系统

标签:tle   OLE   float   innodb   embed   tty   arc   nod   names   

原文地址:https://blog.51cto.com/12768454/2497733

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!