systemctl disable NetworkManager
systemctl stop NetworkManager
setenforce 0
sed -i "s#SELINUX=enforcing#SELINUX=disabled#g" /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
yum install vim nc wget lrzsz telnet net-tools epel-release bind-utils tree cifs-utils ntpdate -y
###修改网卡文件名和配置
cd /etc/sysconfig/network-scripts
cp ifcfg-ens192 /tmp/ifcfg-ens192_bak
sed -i "s#NAME=.*#NAME='eth0'#g" ifcfg-ens192
sed -i "s#DEVICE=.*#DEVICE='eth0'#g" ifcfg-ens192
mv ifcfg-ens192 ifcfg-eth0
###修改grub配置
sed -i 's#GRUB_CMDLINE_LINUX=.*#GRUB_CMDLINE_LINUX=\"rhgb quiet net.ifnames=0 biosdevname=0\"#g' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
#cat >> /etc/security/limits.conf <> /etc/security/limits.conf <
#sed -i "/*/s#* soft nproc.*#* soft nproc 65535#g" /etc/security/limits.d/20-nproc.conf
/tupian/20230521/home
2)安装ovftool工具
双击VMware-ovftool-4.3.0-7948156-win.x86_64.msi,默认下一步,完成即可
3)用ovftool命令导出ova模板
PS >cd C:\Program Files\VMware\VMware OVF Tool
PS >.\ovftool.exe -dm=thin "vi://10.10.90.239/centos-template" d:\centos-template\centos-template.ova #10.10.90.239为宿主机ip
Fingerprint will be added to the known host file
Write 'yes' or 'no'
yes #输入yes
Enter login information for source vi://10.10.90.239/
Username: root #用户名
Password: ********* #密码
Opening VI source: vi://root@10.10.90.239:443/centos-template
Opening OVA target: d:\centos-template\centos-template.ova
Writing OVA package: d:\centos-template\centos-template.ova
Transfer Completed
Completed successfully
2.修改ova模板里文件
1)将centos-template.ova后缀名改为centos-template.rar
2)解压缩centos-template.rar
3)删除centos-template.mf和centos-template.nvram
4)修改centos-template.ovf文件,将带有nvram字符的两行删除掉,保存文件
三.导入ovf模板
打开浏览器-->进入vmware esxi6.7 宿主机页面 --> 虚拟机 --> 创建/注册虚拟机 --> 从OVF或OVA文件部署虚拟机 --> test-centos-template(为该虚拟机输入名称。)--> 单击以选择文件或拖放(将centos-template.ovf和centos-template-disk1.vmdk两个文件拖放到此区域) --> 默认下一页 -->完成
注意:请勿在部署此虚拟机时刷新浏览器。
文章题目:centos7esxi6.7模板实际应用-创新互联
标题链接:http://bjjierui.cn/article/dhcpii.html