​ [RHEL7.1]重新封装系统(制作模板)


 [RHEL7.1]重新封装系统(制作模板) 

标签:rhel7.1封装 rhel7.1模板制作

原文:http://leoshi.blog.51cto.com/152597/1658137            

                 

虚拟化环境需要克隆虚拟主机,新版RHEL7.1重新封装有些变化

下面以 “GUI服务器”环境进行

1
2
rm -rf /etc/ssh/ssh_host*
rm -rf /etc/udev/rules.d/70*

删除 /etc/sysconfig/network-scripts/ifcfg-eno16777736文件中的MAC以及UUID

1
2
3
4
5
cat /dev/null /etc/machine-id
rm -rf /etc/hostname
systemctl enable initial-setup-graphical.service
systemctl enable firstboot-graphical.service
cat /dev/null /etc/sysconfig/firstboot


可以写如下脚本执行即可:(关闭防火墙,关闭SElinux)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#/!bin/bash
systemctl stop firewalld.service 
sleep 3
systemctl disable firewalld.service 
sed -n 's/=enforcing/=permissive/' /etc/selinux/config
setenforce 0
rm -rf /etc/ssh/ssh_host*
rm -rf /etc/udev/rules.d/70*
sed '/^MAC/d' "$(find /etc/ -name 'ifcfg\-eno*' -o -name 'ifcfg\-eth*')"
sed '/^UUID/d' "$(find /etc/ -name 'ifcfg\-eno*' -o -name 'ifcfg\-eth*')"
cat /dev/null /etc/machine-id
rm -rf /etc/hostname
systemctl enable initial-setup-graphical.service
systemctl enable firstboot-graphical.service
cat /dev/null /etc/sysconfig/firstboot
init 0


封装完后启动如下:

​ [RHEL7.1]重新封装系统(制作模板)


​ [RHEL7.1]重新封装系统(制作模板)


​ [RHEL7.1]重新封装系统(制作模板)

​ [RHEL7.1]重新封装系统(制作模板)

本文出自 “知识改变命运科技改变生活” 博客,请务必保留此出处http://leoshi.blog.51cto.com/152597



      本文转自rshare 51CTO博客,原文链接:http://blog.51cto.com/1364952/1968660,如需转载请自行联系原作者