RHEL7 Kickstart deploying multiple operating systems simultaneously
#在日常企业运维环境中, it is inevitable to encounter the use of multiple Linux operating systems, the previous kickstart can only install a Linux version of the system, if you need to install a different version of the Linux system every day, how to do? So here's how to deploy different versions of the Linux operating system at the same time using kickstart, and deploy the Rhel6,rhel7,kickstart RHEL7 system at the same time;
#配置yum源
Vim/etc/yum.repos.d/server.repo
[Base]
Name=rhel
Baseurl=file:///mnt
Enabled=1
Gpgcheck=0
#挂在光盘
Mount/dev/cdrom/mnt
#安装配置DHCP
Yum-y Install DHCP
Cp/usr/share/doc/dhcp-4.2.5/dhcpd.conf.example/etc/dhcp/dhcpd.conf
vim/etc/dhcp/dhcpd.conf#dhcp根据实际环境配置
Subnet 192.168.1.0 netmask 255.255.255.0 {
Range 192.168.1.100 192.168.1.200;
Option Domain-name-servers server.example.com;
Option Domain-name "8.8.8.8";
Option routers 192.168.1.254;
Option broadcast-address 192.168.1.255;
Next-server 192.168.1.89;
FileName "pxelinux.0";
Default-lease-time 60000;
Max-lease-time 720000;
}
Systemctl Restart Dhcpd.service#启动dhcp服务
Systemctl Enable Dhcpd.service#随下次开机自动启动该服务
#安装配置tftp-server Syslinux
Yum-y Install Syslinux Tftp-server
Vim/etc/xinetd.d/tftp
Disable=no#将yes修改no
Systemctl Restart Xinetd.service
Systemctl Enable Xinetd.service
#复制多系统启动文件
Cd/var/lib/tftpboot
mkdir rhel6 rhel7#因为是多系统引导安装所以创建两个不同版本的文件夹, store different boot files
CD Rhel7#rhel7文件夹里面存放rhel7的引导文件, need to manually mount RHEL7 system disc copy boot file
Cp/mnt/isolinux/init.img. #复制到当前
Cp/mnt/isolinux/vmlinuz.
Cd.. #放回上一级目录
CD rhel6#rhel6文件夹里面存放rhel6的引导文件, need to manually mount Rhel6 system disc copy copy file
Cp/mnt/isolinux/init.img.
Cp/mnt/isolinux/vmlinuz.
Cd.. #放回上一级目录
mkdir pxelinux.cfg
CD pxelinux.cfg
Cp/mnt/isolinux/isolinux.cfg./default#随便使用哪个系统版本的引导菜单都可以使用, copy to change the name to the default to make the corresponding changes
Vim default#编辑default文件
Label RHEL7
Kernel rhel7/vmlinuz#刚才创建了对应系统版本文件夹, all Vmlinuz front plus RHEL7
Append initrd=rhel7/initrd.img inst.ks=nfs:192.168.1.89:/rhel7/ks.cfg#initrd. IMG in front of the same plus RHEL7
Label Rhel6
Kernel Rhel6/vmlinuz
Append initrd=rhel6/initrd.img ks=nfs:192.168.1.89:/rhel6/ks.cfg#rhel6的ks命令不一样, there is no inst in front.
Cd.. #返回上一级目录
Vim boot.msg#创建一个安装提示文件
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++please Enter rhel6 and rhel6 install system++++++
#安装配置NFS
Yum-y Install nfs*#系统默认没有安装则安装nfs服务
Mkdir/rhel6/rhel7#创建不同目录存放系统对应版本的安装文件
Cd/rhel6
Nohup cp-a/mnt/*. &#挂载rhel6光盘, copying system files in the background
Cd/rhel7
Nohup cp-a/mnt/*. &#挂载rhel7光盘, copying system files in the background
Vim/etc/exports#nfs共享不同版本系统的文件
/rhel6192.168.1.0/24 (Rw,sync)
/rhel7192.168.1.0/24 (Rw,sync)
Systemctl Restart Nfs-server.service
Systemctl Enable Nfs-server.service
#配置Kickstart一键安装应答文件
Yum-y Install System-config-kickstgart
System-config-kickstart#图形化配置参数, you can also use the one-click installation answer file I generated below, rhel7.0 there is no image of the installation package selection
#可以到/root/anaconda-ks.cfg to copy and install the graphical commands to your own manually created Ks.cfg file at the end of the line and save
#rhel6一键安装文件
#platform =x86, AMD64, or Intel EM64T
#version =devel
# Firewall Configuration
Firewall--disabled
# Install OS instead of upgrade
Install
# Use Network Installation
NFS--server=192.168.1.89--DIR=/RHEL6
# Root Password
ROOTPW--iscrypted $1$w4pthaju$ru3maeqhsmcqk6kdigdea.
# System Authorization Information
Auth--useshadow--passalgo=sha512
# Use graphical Install
Graphical
Firstboot--disable
# System Keyboard
Keyboard US
# System Language
Lang en_US
# SELinux Configuration
SELinux--enforcing
# Installation Logging Level
Logging--level=info
# Reboot after installation
Reboot
# System TimeZone
TimeZone Africa/abidjan
# Network Information
Network--bootproto=dhcp--device=eth0--onboot=on
# System Bootloader Configuration
Bootloader--LOCATION=MBR
# Clear the Master Boot Record
Zerombr
# Partition Clearing Information
Clearpart--all--initlabel
# Disk Partitioning Information
Part/--fstype= "EXT4"--size=20000
Part swap--fstype= "swap"--size=2048
Part/boot--fstype= "Ext4"--size=1024
%packages
@basic-desktop
@desktop-debugging
@desktop-platform
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@kde-desktop
@legacy-X
@remote-desktop-clients
@x11
%end
#rhel7一键安装文件
#platform =x86, AMD64, or Intel EM64T
#version =devel
# Install OS instead of upgrade
Install
# Keyboard Layouts
Keyboard ' US ' # Reboot after installation
Reboot
# Root Password
ROOTPW--iscrypted $1$6W4GNGL7$CTA9ZJHDCGJ3OBRD.INSU1
# System TimeZone
TimeZone Africa/abidjan--ISUTC
# System Language
Lang en_US
# Firewall Configuration
Firewall--disabled
# Network Information
Network--bootproto=dhcp--device=eth0
# System Authorization Information
Auth--useshadow--passalgo=sha512
# Use graphical Install
Graphical
Firstboot--disable
# SELinux Configuration
SELinux--enforcing
# Use NFS installation media
NFS--server=192.168.1.89--DIR=/RHEL7
# System Bootloader Configuration
Bootloader--LOCATION=MBR
# Clear the Master Boot Record
Zerombr
# Partition Clearing Information
Clearpart--all--initlabel
# Disk Partitioning Information
Part/--fstype= "XFS"--size=20000
Part swap--fstype= "swap"--size=4096
Part/boot--fstype= "XFS"--size=1024
%packages
@base
@core
@desktop-debugging
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@input-methods
@internet-browser
@multimedia
@print-client
@x11
%end
#复制生成的一键安装应答文件到不同版本文件夹中
CP ks.cfg/rhel6#这是rhel6系统的一键安装应答文件
CP Ks.cfg/rhel7#这是rhel7系统的一键安装应答文件
#修改SELinux状态
Vim/etc/sysconfig/selinux
Selinux=permissive#默认的enforcing修改为permissive
Setenforce 0#或者重启系统
#防火墙开放服务和端口号
Firewall-cmd--permanent--add-port=111/tcp
Firewall-cmd--permanent--ADD-PORT=111/UDP
Firewall-cmd--permanent--add-port=20048/tcp
Firewall-cmd--permanent--ADD-PORT=20048/UDP
Firewall-cmd--permanent--ADD-PORT=69/UDP
Firewall-cmd--permanent--add-service=nfs
Firewall-cmd--permanent--add-service=dhcp
Firewall-cmd--reload
#客户端从网络引导做安装测试, enter rhel6 or RHEL7 to install the system in the Black dialog box that pops up
This article is from the "Wu Shanqiang" blog, make sure to keep this source http://shanqiangwu.blog.51cto.com/8067564/1627379
Kickstart deploying multiple operating systems at the same time