CentOS6和CentOS7更高的内核 一键安装[lotServer] 锐速 Vicer

1.支持更高的Linux内核一键安装[lotServer] 锐速.
2.支持一键完全卸载[lotServer] 锐速 (此脚本安装的无残留).
3.不支持自动更换内核. CentOS6和CentOS7 一键更换内核,一键安装锐速[lotServer]
4.不支持OpenVZ.
所有内容均来自互联网.本人不负任何法律责任,仅供学习使用.
Update:2019.04.15

一键安装[lotServer] 锐速:
bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) install

一键卸载[lotServer] 锐速:
bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) uninstall

使用方法:
启动命令 /appex/bin/lotServer.sh start
停止加速 /appex/bin/lotServer.sh stop
状态查询 /appex/bin/lotServer.sh status
重新启动 /appex/bin/lotServer.sh restart

1.更新许可证(有效期为6个月)
wget -qO '/appex/etc/apx.lic' "https://api.moeclub.org/lotServer?ver=1&mac=00:00:00:00:00:00"
使用 ifconfig 查看网卡 mac 地址,替换 00:00:00:00:00:00 (当内核版本号小于等于 3.11.20.10 时, 请设置 ver=0)

2.使用KeyGen, 更新许可证(lic文件)(有效期到2099年)
git clone https://github.com/Tai7sy/LotServer_KeyGen
cd LotServer_KeyGen
php keygen.php 00:00:00:00:00:00 (使用 ifconfig 查看网卡 mac 地址,替换 00:00:00:00:00:00)
cp out.lic /appex/etc/apx.lic
状态查询 /appex/bin/lotServer.sh status

3.CentOS7启动自动运行lotServer
chmod +x /etc/rc.local
vi /etc/rc.local
添加su - root -c "/appex/bin/lotServer.sh start"

图为CentOS Linux release 7.5.1804 安装[lotServer] 锐速

使用CLI命令行安装部署vCSA 7 (vCenter Server Appliance 7)

如何使用CLI命令行部署VMware VCSA 7 \ vCSA 7 (vCenter 7)
使用CLI 部署 vCenter Server Appliance 7
使用CLI命令行安装部署 vCenter Server Appliance 7

1、使用CLI命令行安装部署,embedded_vCSA_on_ESXi.json (ESXi 7未加入集群)


# embedded_vCSA_on_ESXi.json ESXi 7 未加入vCenter集群

{
    "__version": "2.13.0",
    "__comments": "Sample template to deploy a vCenter Server Appliance with an embedded Platform Services Controller on an ESXi host.",
    "new_vcsa": {
        "esxi": {
            "hostname": "10.33.201.202",                 #esxi的fqdn或ip
            "username": "root",
            "password": "ESXi的密码",
            "deployment_network": "VM Network",
            "datastore": "Datastore"                     #存放的数据存储
        },
        "appliance": {
            "thin_disk_mode": true,                      #硬盘模式:精简制备
            "deployment_option": "medium",               #部署大小:tiny small medium large,分别为 微、小、中、大
            "name": "www.zhangfangzhou.cn"  #vCenter-Server-Appliance的名字
        },
        "network": {
            "ip_family": "ipv4",
            "mode": "static",
            "ip": "10.33.201.80",
            "prefix": "22",                               #网络前缀24位
            "gateway": "10.33.200.1",
            "dns_servers": [
                "10.33.123.60"
            ]
        },
        "os": {
            "password": "密码",
            "ntp_servers": "ntp.aliyun.com",
            "ssh_enable":  true                            #ssh开启
        },
        "sso": {
            "password": "密码",
            "domain_name": "zhangfangzhou.cn"                     #sso域名
        }
    },
    "ceip": {
        "description": {
            "__comments": [
                "++++VMware Customer Experience Improvement Program (CEIP)++++",
                "--acknowledge-ceip in the command line.",
                "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
            ]
        },
        "settings": {
            "ceip_enabled": false           #不参加(CEIP)客户体验改善计划
        }
    }
}

​注意事项
"system.name": "10.0.0.30"      #系统名称,全域名,例vc.vsphere.local如果FQDN不能解析,请使用IP地址作为系统名称,不然会Firstboot Error

vcsa-deploy.exe install --accept-eula --no-ssl-certificate-verification -t E:\ISO\ESXi\VMware-VCSA-all-7.0.3-18700403\vcsa-cli-installer\templates\install\embedded_vCSA_on_ESXi.json

DRS Warning:  The target ESXi host '10.33.201.202' is managed by vCenter Server
'10.33.201.200'.  If any of these hosts are in a cluster, and DRS is enabled,
vMotion can take effect and adversely impact the installation, upgrade, or
migration processes.  It is recommended that you use the *_on_VC.json template
file for the target ESXi host if it is managed by a vCenter Server, and ensure
the ESXi hosts you have specified are not members of clusters with DRS set to
Fully Automated during the installation, upgrade, or migration processes.

2 、使用CLI命令行安装部署,embedded_vCSA_on_VC.json ESXi 7已经加入vCenter集群

"deployment_option": "medium",               #部署大小:tiny small medium large,分别为 微、小、中、大
#######################################################################################################
例子1
{
    "__version": "2.13.0",
    "__comments": "Sample template to deploy a vCenter Server Appliance with an embedded Platform Services Controller on a vCenter Server instance.",
    "new_vcsa": {
        "vc": {
            "hostname": "10.33.201.66",
            "username": "administrator@zhangfangzhou.cn",
            "password": "vCenter Server 的密码",
            "deployment_network": "VM Network",
            "datacenter": [
                "Datacenter"                    #数据中心名称
            ],
            "datastore": "NFS1",                #存储
            "target": [
            "Cluster1", "10.33.220.99"          #集群名称和目标ESXi主机
            ]
        },
        "appliance": {
            "thin_disk_mode": true,
            "deployment_option": "medium",
            "name": "www.zhangfangzhou.cn"
        },
        "network": {
            "ip_family": "ipv4",
            "mode": "static",
            "system_name": "10.33.220.82",
            "ip": "10.33.220.82",
            "prefix": "24",
            "gateway": "10.33.220.1",
            "dns_servers": [
                "223.5.5.5,114.114.114.114"
            ]
        },
        "os": {
            "password": "密码",
            "ntp_servers": "ntp.aliyun.com",
            "ssh_enable":  true
        },
        "sso": {
            "password": "密码",
            "domain_name": "zhangfangzhou.cn"
        }
    },
    "ceip": {
        "description": {
            "__comments": [
                "++++VMware Customer Experience Improvement Program (CEIP)++++",
                "--acknowledge-ceip in the command line.",
                "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
            ]
        },
        "settings": {
            "ceip_enabled": false
        }
    }
}

#######################################################################################################
C:\Users\Administrator>e:
E:\>cd E:\ISO\ESXi\VMware-VCSA-all-7.0.3-18778458\vcsa-cli-installer\win32

E:\ISO\ESXi\VMware-VCSA-all-7.0.3-18778458\vcsa-cli-installer\win32>
vcsa-deploy.exe install --accept-eula --no-ssl-certificate-verification -t E:\ISO\ESXi\VMware-VCSA-all-7.0.3-18778458\vcsa-cli-installer\templates\install\embedded_vCSA_on_VC.json

vCenter Server Appliance 的 CLI 部署
https://docs.vmware.com/cn/VMware-vSphere/7.0/vsphere-vcenter-server-703-installation-guide.pdf
CLI 部署命令的语法
https://docs.vmware.com/cn/VMware-vSphere/7.0/com.vmware.vcenter.install.doc/GUID-15F4F48B-44D9-4E3C-B9CF-5FFC71515F71.html

--accept-eula   接受最终用户许可协议(最终用户许可协议; End User License Agreement;)。
--no-esx-ssl-verify 跳过 ESXi 连接的 SSL 验证。
--no-ssl-certificate-verification   跳过所有服务器连接的安全证书验证。
-v, --verbose   将调试信息添加到控制台输出。
-t, --terse 隐藏控制台输出。仅显示警告消息和错误消息。
--verify-template-only  对 JSON 文件中的配置参数执行基本模板验证。不部署设备。
--precheck-only 仅执行基本模板验证和 OVF Tool 参数验证。不部署设备。

基于DHCP服务器使用 PXE 引导和 kickstart (UEFI) 自动安装 ESXi 7

基于DHCP服务器使用 PXE 引导和 kickstart (UEFI) 自动安装 ESXi 7
基于UEFI的PXE安装 ESXi 7
PXE网络引导自动化安装 ESXi 7 详解
PXE+Kickstart 批量安装 ESXi 7
使用PXE 和TFTP 引导ESXi 安装ESXi 7 程序

1 基于DHCP服务器使用 PXE 引导和 kickstart (UEFI) 自动安装 ESXi 7 录制视频

2 浪潮NF5280M5服务器基于DHCP服务器使用 PXE 引导和 kickstart (UEFI) 自动安装 ESXi 7 录制视频

#CentOS 7 系统 安装dhcp服务器 、 tftp-server服务器 、 web服务器
yum install -y dhcp tftp-server httpd

1、配置DHCP服务器

守护进程 :/etc/sbin/dhcpd
脚本:/etc/init.d/dhcpd
端口:67(bootps) 服务端,68(bootpc) 客户端
配置文件:/etc/dhcp/dhcpd.conf
租约信息:/var/lib/dhcpd/dhcpd.leases
配置文件:cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
修改DHCP监听特定端口 vi /etc/sysconfig/dhcpd

#编辑DHCP服务器配置文件
vi /etc/dhcp/dhcpd.conf

default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 10.53.220.0 netmask 255.255.255.0 {
  range 10.53.220.41 10.53.220.49;
  option domain-name-servers 10.1.0.1, 114.114.114.114;   #DNS服务器IP地址
  option routers 10.53.220.1;                             #网关地址
  next-server 10.53.220.224;                              # 指定TFTP服务器地址
  filename "/mboot.efi";                                  # 指定网络引导映像文件
}
#绑定IP地址
host zhangfangzhou {                                      #zhangfangzhou 随意指定,但必须唯一
  hardware ethernet 00:50:56:99:06:b7;
  fixed-address 10.53.220.48;
}

#DHCP的服务设置开机启动、启动DHCP服务
systemctl enable dhcpd && systemctl start dhcpd

########防火墙设置
firewall-cmd --zone=public --add-port=67/udp --permanent
firewall-cmd --zone=public --add-port=68/udp --permanent
#重新载入配置
firewall-cmd --reload
firewall-cmd --list-all #查看防火墙规则,只显示/etc/firewalld/zones/public.xml中防火墙策略

2、配置 tftp 服务器

启用 tftp 服务
vi /etc/xinetd.d/tftp

# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot # TFTP服务器顶级目录
        disable                 = no    # 从yes修改为no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

#tftp的服务设置开机启动、启动tftp服务
systemctl enable tftp && systemctl start tftp

########防火墙设置
firewall-cmd --zone=public --add-port=69/tcp --permanent
firewall-cmd --zone=public --add-port=69/udp --permanent
#重新载入配置
firewall-cmd --reload
firewall-cmd --list-all #查看防火墙规则,只显示/etc/firewalld/zones/public.xml中防火墙策略

3、挂载ESXi 7 镜像

#创建文件夹,主要是下载ESXi 7和挂载ESXi 7使用
mkdir -p /var/lib/tftpboot/{iso,ESXi70u2}
wget -P /var/lib/tftpboot/iso  http://10.53.123.144/ISO/ESXi/VMware-VMvisor-Installer-7.0U2a-17867351.x86_64.iso
cd /var/lib/tftpboot
mount /var/lib/tftpboot/iso/VMware-VMvisor-Installer-7.0U2a-17867351.x86_64.iso /var/lib/tftpboot/ESXi70u2     #重启后需要重新mount

#1、UEFI启动 ESXi 7
将上面DHCP服务器指定的启动镜像文件复制到指定目录下。上面的设置示例名为“mboot.efi”,因此将其复制为该名称。
cd /var/lib/tftpboot/
cp -p /var/lib/tftpboot/ESXi70u2/efi/boot/bootx64.efi /var/lib/tftpboot/mboot.efi

直接在 tftpboot 下复制名为 boot.cfg 的文件,该文件描述了引导设置。
cp -p /var/lib/tftpboot/ESXi70u2/efi/boot/boot.cfg /var/lib/tftpboot/boot.cfg
 #2、传统BIOS启动 ESXi 7
如果要使用旧版 BIOS,则需要3.86版的 syslinux 软件包。从 https://www.kernel.org/pub/linux/utils/boot/syslinux/ 下载包
cd /tmp
wget https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/3.xx/syslinux-3.86.tar.gz
tar xvzf syslinux-3.86.tar.gz
cp -p syslinux-3.86/core/mboot.efi /var/lib/tftpboot/
#3、修改boot.cfg
删除 boot.cfg 中文件路径的“/”
sed -i 's|/||g' boot.cfg

4、检查boot.cfg

根据您的环境更改“标题”和“前缀”。为“title”使用一个描述性名称是个好主意,它是自动安装过程中显示的标题字符。“前缀prefix”指定存储 ESXi 安装程序的目录。在这种情况下,它将是“ESXi70u2”。

修改title和refix名称
prefix=ESXi70u2 (ESXi70u2就是上面ESXi ISO文件mount的文件夹)

# vi /var/lib/tftpboot/boot.cfg
bootstate=0
title=Loading ESXi installer www.zhangfangzhou.cn
timeout=5
prefix=ESXi70u2
kernel=b.b00
kernelopt=runweasel cdromBoot
modules=jumpstrt.gz --- useropts.gz --- features.gz --- k.b00 --- uc_intel.b00 --- uc_amd.b00 --- uc_hygon.b00 --- procfs.b00 --- vmx.v00 --- vim.v00 --- tpm.v00 --- sb.v00 --- s.v00 --- atlantic.v00 --- bnxtnet.v00 --- bnxtroce.v00 --- brcmfcoe.v00 --- brcmnvme.v00 --- elxiscsi.v00 --- elxnet.v00 --- i40enu.v00 --- iavmd.v00 --- icen.v00 --- igbn.v00 --- irdman.v00 --- iser.v00 --- ixgben.v00 --- lpfc.v00 --- lpnic.v00 --- lsi_mr3.v00 --- lsi_msgp.v00 --- lsi_msgp.v01 --- lsi_msgp.v02 --- mtip32xx.v00 --- ne1000.v00 --- nenic.v00 --- nfnic.v00 --- nhpsa.v00 --- nmlx4_co.v00 --- nmlx4_en.v00 --- nmlx4_rd.v00 --- nmlx5_co.v00 --- nmlx5_rd.v00 --- ntg3.v00 --- nvme_pci.v00 --- nvmerdma.v00 --- nvmxnet3.v00 --- nvmxnet3.v01 --- pvscsi.v00 --- qcnic.v00 --- qedentv.v00 --- qedrntv.v00 --- qfle3.v00 --- qfle3f.v00 --- qfle3i.v00 --- qflge.v00 --- rste.v00 --- sfvmk.v00 --- smartpqi.v00 --- vmkata.v00 --- vmkfcoe.v00 --- vmkusb.v00 --- vmw_ahci.v00 --- clusters.v00 --- crx.v00 --- elx_esx_.v00 --- btldr.v00 --- esx_dvfi.v00 --- esx_ui.v00 --- esxupdt.v00 --- tpmesxup.v00 --- weaselin.v00 --- loadesx.v00 --- lsuv2_hp.v00 --- lsuv2_in.v00 --- lsuv2_ls.v00 --- lsuv2_nv.v00 --- lsuv2_oe.v00 --- lsuv2_oe.v01 --- lsuv2_oe.v02 --- lsuv2_sm.v00 --- native_m.v00 --- qlnative.v00 --- vdfs.v00 --- vmware_e.v00 --- vsan.v00 --- vsanheal.v00 --- vsanmgmt.v00 --- tools.t00 --- xorg.v00 --- gc.v00 --- imgdb.tgz --- basemisc.tgz --- resvibs.tgz --- imgpayld.tgz
build=7.0.2-0.0.17867351
updated=0

到这一步可以实现通过PXE网络安装ESXi

5、配置web 服务器

#默认网站目录/var/www/html

systemctl enable httpd && systemctl start httpd

########防火墙设置
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
#重新载入配置
firewall-cmd --reload
firewall-cmd --list-all #查看防火墙规则,只显示/etc/firewalld/zones/public.xml中防火墙策略

6、配置 ESXi 7 的 kickstart

示例 kickstart 文件存储在 ESXi 的 /etc/vmware/weasel/ks.cfg 中。将此复制到 http 服务器上的 /var/www/html

#示例 1 kickstart 文件,给ESXi 7 配置 静态IP地址
vi /var/www/html/ks.cfg
#####################
# Accept the VMware End User License Agreement
vmaccepteula
 
# Set the root password for the DCUI and Tech Support Mode
rootpw P@ssw0rd
 
# The install media is in the CD-ROM drive
install --firstdisk --overwritevmfs
 
# Set the network on the first network adapter
network --bootproto=static --device=vmnic0 --ip=10.53.220.199 --netmask=255.255.255.0 --vlanid=0 --gateway=10.53.220.1 --hostname=10.53.220.199 --nameserver=10.1.0.1

#vmserialnum
vmserialnum --esx=5U4TK-DML1M-M8550-XK1QP-1A052
# reboot after install
reboot
 
# run the following command only on the firstboot
%firstboot --interpreter=busybox

sleep 10
# enable & start remote ESXi Shell (SSH)
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
sleep 1
# enable & start ESXi Shell (TSM)
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell
sleep 1
# enable High Performance
esxcli system settings advanced set --option=/Power/CpuPolicy --string-value="High Performance"
sleep 1
#Disable ipv6
esxcli network ip set --ipv6-enabled=0
sleep 1
#不加入体验
esxcli system settings advanced set -o /UserVars/HostClientCEIPOptIn -i 2
sleep 1
#enable ntp
/bin/esxcli system ntp set --server=ntp.aliyun.com
sleep 1
/bin/chkconfig ntpd on
sleep 1
#Disable ShellWarning
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1
sleep 1
cat << EOF > /etc/ssh/keys-root/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA6PP8/RDdYIqUq6DE3zj9Qs8AF3uzfYH5lYrB+mMxxfI8kq2NIzQlsW1KDaH/fWYTkkK120lPUu97lWic9Li3Z3iFR6Nh4q6PVTfBNt4xOx754Ipqtpefk+9sLZAYEPK8pnRP0QZv7CtDFv842tfUYIrVNnecRQTFfNtnGDcXnO1u2RE1kq6Tr5N3595PbPLDKczjOFnS+jy0MeKKHPJcZfYz7TUTSzTwTHYbPRRaQ8/0eihUwzpAmXRo9NYNle26qp6+SlRsjGSBcUr0rh0wSe6r/C2btnpOUd//aFvcl8plhyb++nivlhB71v+6I0UcPoSXOIVs/1QuHEMbv7Ircjb2emqHtZDpk8KSYhgV0ZdbAq9XOcux76eok//xtjbleKPAcDMY/KotIEh7QX4NLQxSJOm5gCLkn5kbrHfVx6nWlGzVVds1sDlcnSAWul5lFiI5ZkArXFKcnm+aCnStPpx5SSCpZpMUdZvt8ZA7vLx3xjMDFwv5HTuTFwB9mlZrdfqp5USC2mWC3eAAPE7GxDSfJv9epteIYywIP9NVT3Z4ng9z6jrcFfA4GFlfLrk8J71cnxZ/AWZXXUwp3ooE/Cp3jc473VpK7FZwjQ7Xz9PD8WQgMOO4xnGQhPWlxhRuoTYyQVa0xOBO9gh9Cuc6zq5FQgYQEcSB+/FBJ/YNDIc= www.zhangfangzhou.cn
EOF
sleep 1
date > /finished.stamp

# Restart a last time
reboot


#示例 2 kickstart 文件,ESXi 7 通过 DHCP 服务器获得IP地址
​vi /var/www/html/ks.cfg

# Accept the VMware End User License Agreement
vmaccepteula
 
# Set the root password for the DCUI and Tech Support Mode
rootpw P@ssw0rd
 
# The install media is in the CD-ROM drive
install --firstdisk --overwritevmfs
 
# Set the network on the first network adapter
network --bootproto=dhcp

#vmserialnum
vmserialnum --esx=5U4TK-DML1M-M8550-XK1QP-1A052
# reboot after install
reboot
 
# run the following command only on the firstboot
%firstboot --interpreter=busybox

sleep 10
# enable & start remote ESXi Shell (SSH)
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
sleep 1
# enable & start ESXi Shell (TSM)
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell
sleep 1
# enable High Performance
esxcli system settings advanced set --option=/Power/CpuPolicy --string-value="High Performance"
sleep 1
#Disable ipv6
esxcli network ip set --ipv6-enabled=0
sleep 1
#不加入体验
esxcli system settings advanced set -o /UserVars/HostClientCEIPOptIn -i 2
sleep 1
#enable ntp
/bin/esxcli system ntp set --server=ntp.aliyun.com
sleep 1
/bin/chkconfig ntpd on
sleep 1
#Disable ShellWarning
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1
sleep 1
cat << EOF > /etc/ssh/keys-root/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA6PP8/RDdYIqUq6DE3zj9Qs8AF3uzfYH5lYrB+mMxxfI8kq2NIzQlsW1KDaH/fWYTkkK120lPUu97lWic9Li3Z3iFR6Nh4q6PVTfBNt4xOx754Ipqtpefk+9sLZAYEPK8pnRP0QZv7CtDFv842tfUYIrVNnecRQTFfNtnGDcXnO1u2RE1kq6Tr5N3595PbPLDKczjOFnS+jy0MeKKHPJcZfYz7TUTSzTwTHYbPRRaQ8/0eihUwzpAmXRo9NYNle26qp6+SlRsjGSBcUr0rh0wSe6r/C2btnpOUd//aFvcl8plhyb++nivlhB71v+6I0UcPoSXOIVs/1QuHEMbv7Ircjb2emqHtZDpk8KSYhgV0ZdbAq9XOcux76eok//xtjbleKPAcDMY/KotIEh7QX4NLQxSJOm5gCLkn5kbrHfVx6nWlGzVVds1sDlcnSAWul5lFiI5ZkArXFKcnm+aCnStPpx5SSCpZpMUdZvt8ZA7vLx3xjMDFwv5HTuTFwB9mlZrdfqp5USC2mWC3eAAPE7GxDSfJv9epteIYywIP9NVT3Z4ng9z6jrcFfA4GFlfLrk8J71cnxZ/AWZXXUwp3ooE/Cp3jc473VpK7FZwjQ7Xz9PD8WQgMOO4xnGQhPWlxhRuoTYyQVa0xOBO9gh9Cuc6zq5FQgYQEcSB+/FBJ/YNDIc= www.zhangfangzhou.cn
EOF
sleep 1
date > /finished.stamp

# Restart a last time
reboot

7、最终boot.cfg配置文件

# vi /var/lib/tftpboot/boot.cfg
bootstate=0
title=Loading ESXi installer www.zhangfangzhou.cn
timeout=5
prefix=ESXi70u2
kernel=b.b00
kernelopt=ks=http://10.53.220.224/ks.cfg
modules=jumpstrt.gz --- useropts.gz --- features.gz --- k.b00 --- uc_intel.b00 --- uc_amd.b00 --- uc_hygon.b00 --- procfs.b00 --- vmx.v00 --- vim.v00 --- tpm.v00 --- sb.v00 --- s.v00 --- atlantic.v00 --- bnxtnet.v00 --- bnxtroce.v00 --- brcmfcoe.v00 --- brcmnvme.v00 --- elxiscsi.v00 --- elxnet.v00 --- i40enu.v00 --- iavmd.v00 --- icen.v00 --- igbn.v00 --- irdman.v00 --- iser.v00 --- ixgben.v00 --- lpfc.v00 --- lpnic.v00 --- lsi_mr3.v00 --- lsi_msgp.v00 --- lsi_msgp.v01 --- lsi_msgp.v02 --- mtip32xx.v00 --- ne1000.v00 --- nenic.v00 --- nfnic.v00 --- nhpsa.v00 --- nmlx4_co.v00 --- nmlx4_en.v00 --- nmlx4_rd.v00 --- nmlx5_co.v00 --- nmlx5_rd.v00 --- ntg3.v00 --- nvme_pci.v00 --- nvmerdma.v00 --- nvmxnet3.v00 --- nvmxnet3.v01 --- pvscsi.v00 --- qcnic.v00 --- qedentv.v00 --- qedrntv.v00 --- qfle3.v00 --- qfle3f.v00 --- qfle3i.v00 --- qflge.v00 --- rste.v00 --- sfvmk.v00 --- smartpqi.v00 --- vmkata.v00 --- vmkfcoe.v00 --- vmkusb.v00 --- vmw_ahci.v00 --- clusters.v00 --- crx.v00 --- elx_esx_.v00 --- btldr.v00 --- esx_dvfi.v00 --- esx_ui.v00 --- esxupdt.v00 --- tpmesxup.v00 --- weaselin.v00 --- loadesx.v00 --- lsuv2_hp.v00 --- lsuv2_in.v00 --- lsuv2_ls.v00 --- lsuv2_nv.v00 --- lsuv2_oe.v00 --- lsuv2_oe.v01 --- lsuv2_oe.v02 --- lsuv2_sm.v00 --- native_m.v00 --- qlnative.v00 --- vdfs.v00 --- vmware_e.v00 --- vsan.v00 --- vsanheal.v00 --- vsanmgmt.v00 --- tools.t00 --- xorg.v00 --- gc.v00 --- imgdb.tgz --- basemisc.tgz --- resvibs.tgz --- imgpayld.tgz
build=7.0.2-0.0.17867351
updated=0

到这里可以基于DHCP实现通过PXE自动安装 ESXi 7、自动设置系统密码、自动接受许可、自动添加产品密钥、自动启用SSH服务、自动启用shell服务、电源模式自动设置为高性能、禁用IPV6、不参加(CEIP)客户体验改善计划、自动配置NTP、自动添加私钥。

在Ubuntu 20.04 LTS安装Docker,使用Docker安装Minio存储服务器

在Ubuntu 20.04 LTS安装Docker,使用Docker安装Minio存储服务器,使用Minio Docker镜像,在4块盘中启动基于纠删码的Minio服务
MinIO 是一个基于Apache License v2.0开源协议的对象存储服务( High Performance Object Storage)。
它兼容亚马逊S3云存储服务接口,非常适合于存储大容量非结构化的数据,MinIO是一个非常轻量的服务,可以很简单的和其他应用的结合。
Build high performance data infrastructure for machine learning, analytics and application data workloads with MinIO。
Minio使用纠删码erasure code和checksum来保护数据免受硬件故障和无声数据损坏。 即便您丢失一半数量(N/2)的硬盘,您仍然可以恢复数据。

a、在Ubuntu 20.04我们将启用Docker存储库,导入存储库GPG密钥,然后安装该软件包。
首先,更新程序包索引并安装添加新的HTTPS仓库所需的依赖项:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

b、使用以下curl命令导入存储库的GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

c、将Docker APT存储库添加到您的系统中
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

d、现在已启用Docker存储库,您可以安装存储库中可用的任何Docker版本
要安装最新版本的Docker,请运行以下命令。如果要安装特定的Docker版本,请跳过此步骤并转到下一个。
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

e、要安装特定版本,请首先列出Docker存储库中的所有可用版本
sudo apt update
apt list -a docker-ce

可用的Docker版本打印在第二列中。在撰写本文时,官方Docker存储库中只有一个Docker版本(5:19.03.9~3-0~ubuntu-focal)。
docker-ce/focal 5:19.03.9~3-0~ubuntu-focal amd64

安装完成后,Docker服务将自动启动。您可以通过键入以下内容进行验证:
sudo systemctl status docker

f、当发布新版本的Docker时,您可以使用标准sudo apt update && sudo apt upgrade过程来更新软件包

g、如果要阻止更新Docker软件包,请将其标记为“阻止”:
sudo apt-mark hold docker-ce

h、以非root用户身份执行Docker命令
默认情况下,只有具有sudo特权的 root和用户可以执行Docker命令。
要以非root用户身份执行Docker命令,您需要将用户添加到在Docker CE软件包安装过程中创建的docker组中。
sudo usermod -aG docker $USER
$USER是保存您的用户名的环境变量。
注销并重新登录,以便刷新组成员身份

i、卸载Docker
在卸载Docker之前,最好删除所有容器,映像,卷和网络。

运行以下命令以停止所有正在运行的容器并删除所有docker对象:
docker container stop $(docker container ls -aq)
docker system prune -a --volumes

g、Docker卸载
sudo apt purge docker-ce
sudo apt autoremove
--------------------------------------------------------------------------------------
k、使用Minio Docker镜像,在4块盘中启动基于纠删码的Minio服务
docker run -itd -p 9000:9000 --name minio \
-e "MINIO_ACCESS_KEY=user" \
-e "MINIO_SECRET_KEY=zhangfangzhou" \
-v /data1:/data1 \
-v /data2:/data2 \
-v /data3:/data3 \
-v /data4:/data4 \
minio/minio server /data{1..4}

-i 以交互模式运行容器,通常与 -t 同时使用
-t 为容器重新分配一个伪输入终端,通常与 -i 同时使用
-d 后台运行容器,并返回容器ID
-p 表示映射容器的端口,hostPort:containerPort(服务器端口:容器端口)
-v 挂载宿主机的一个目录,(前面的目录是服务器目录,后面的目录是容器内目录)
data1,data2,data3,data4(服务器的存储目录)
/dev/sdb1 /data1 ext4 defaults 0 0
/dev/sdc1 /data2 ext4 defaults 0 0
/dev/sdd1 /data3 ext4 defaults 0 0
/dev/sde1 /data4 ext4 defaults 0 0


l、打开浏览器输入http://www.zhangfangzhou.cn:9000/minio
输入账户密码
账户user
密码 zhangfangzhou

m、在右下角找到Create bucket,创建一个新的 bucket,然后上传文件

n、 验证是否设置成功
你可以随意拔掉硬盘,看Minio是否可以正常读写。
n、查看存储文件

ESXi7u1设置NVIDIA GEFORCE RTX 2080TI显卡直通(passthrough)

ESXi7u1设置NVIDIA GEFORCE RTX 2080TI 显卡直通(passthrough),ESXi7.x设置直通NVIDIA GEFORCE RTX 2080TI 显卡,ESXi7.x设置直通 英伟达 RTX 2080TI 显卡,ESXi7.x直通N卡设置。

a、进入到ESXI管理、硬件、PCI设备里面把显卡硬件切换直通(在搜索框里输入需要直通的设备型号)也可以SSH登录到ESXi,把显卡的PCI直通设备添加进去

vi /etc/vmware/esx.conf
/device/显卡设备号/owner = “passthru”
/device/0000:01:00:0/owner = "passthru"
/device/0000:01:00:1/owner = "passthru"


b、创建虚拟机的时候内存需要**设置预留资源**或者**预留所有客户机内存(全部锁定)**,否则会提示失败 - 内存设置无效: 内存预留 (sched.mem.min) 应该等于内存大小 (16384)。

c、创建虚拟机的时候添加PCI 设备

d、编辑虚拟机选项、高级、配置参数,添加如下参数

hypervisor.cpuid.v0 = "FALSE" #hypervisor.cpuid.v0 FALSE 设置成FALSE的意义为欺骗虚拟Windows系统没有运行在虚拟机中
mce.enable = "TRUE" #虚拟化嵌套,启用了嵌套硬件辅助的虚拟化时,无法添加 PCI 直通设备

#屏蔽检测tools
isolation.tools.setVersion.disable = "TRUE"
isolation.tools.getVersion.disable = "TRUE"

#屏蔽检测是否为虚拟机(可以过网易mumu,无法过腾讯 游戏无法运行在虚拟环境中,请更换设备后重试)
monitor_control.restrict_backdoor = "TRUE"
disable_acceleration = "TRUE"



e、如果安装完成vm-tools,需要禁用掉VMware svga 3D,不然每次重启都需要重新安装显卡驱动才能使用显卡,否则设备管理器中显卡提示由于该设备有问题,Windows 已将其停止。 (代码 43)

f、启用了嵌套硬件辅助的虚拟化时,无法添加 PCI 直通设备


CentOS 7.8使用devtoolset-9使用高版本gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)编译安装Redis 6.0.5

CentOS 7.8 编译安装Redis 6.0.5报错
In file included from server.c:30:0:
server.h:1045:5: error: expected specifier-qualifier-list before ‘_Atomic’
_Atomic unsigned int lruclock; /* Clock for LRU eviction */
^
server.c: In function ‘serverLogRaw’:
server.c:1028:31: error: ‘struct redisServer’ has no member named ‘logfile’
int log_to_stdout = server.logfile[0] == '\0';
^
server.c:1031:23: error: ‘struct redisServer’ has no member named ‘verbosity’
if (level < server.verbosity) return;
^
server.c:1033:47: error: ‘struct redisServer’ has no member named ‘logfile’
fp = log_to_stdout ? stdout : fopen(server.logfile,"a");
^
server.c:1046:47: error: ‘struct redisServer’ has no member named ‘timezone’
nolocks_localtime(&tm,tv.tv_sec,server.timezone,server.daylight_active);
^
server.c:1046:63: error: ‘struct redisServer’ has no member named ‘daylight_active’
nolocks_localtime(&tm,tv.tv_sec,server.timezone,server.daylight_active);
......
......

问题原因
CentOS 7的gcc版本为4.8.5,Redis 6.0.5最低需要gcc4.9,因此需要升级gcc版本
from redis 6.0.5, building redis from source code needs C11 support.The version of gcc in CentOS 7 is 4.8.5, but C11 was introduced in 4.9.

解决办法
1、手动编译gcc大于4.9的版本
2、安装 devtoolset-9(使用高版本gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC))编译安装Redis 6.0.5
yum install centos-release-scl -y
yum install devtoolset-9 -y

临时使用高版本gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC) (推荐使用这个方法)
export CC=/opt/rh/devtoolset-9/root/usr/bin/gcc
export CPP=/opt/rh/devtoolset-9/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-9/root/usr/bin/c++

wget http://download.redis.io/releases/redis-stable.tar.gz
tar zxf redis-stable.tar.gz && cd redis-stable
make -j2 && make install
if [ -f "/root/redis-stable/src/redis-server" ]; then
mkdir -p /usr/local/redis/{bin,etc,var}
/bin/cp /root/redis-stable/src/{redis-benchmark,redis-check-aof,redis-check-rdb,redis-cli,redis-sentinel,redis-server} /usr/local/redis/bin/
/bin/cp /root/redis-stable/redis.conf /usr/local/redis/etc/

cd /root/redis-stable/src
id -u redis >/dev/null 2>&1
[ $? -ne 0 ] && useradd -M -s /sbin/nologin redis

chown -R redis:redis /usr/local/redis/{var,etc}
#
if [ -e /bin/systemctl ]; then
cat > /lib/systemd/system/redis-server.service << "EOF"
[Unit]
Description=Redis In-Memory Data Store
After=network.target

[Service]
Type=forking
PIDFile=/var/run/redis/redis.pid
User=redis
Group=redis

Environment=statedir=/var/run/redis
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p ${statedir}
ExecStartPre=/bin/chown -R redis:redis ${statedir}
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
ExecStop=/bin/kill -s TERM $MAINPID
Restart=always
LimitNOFILE=1000000
LimitNPROC=1000000
LimitCORE=1000000

[Install]
WantedBy=multi-user.target
EOF
systemctl enable redis-server

#确认Redis 6.0.5版本
[www@zhangfangzhou_cn ~]# redis-server -v
Redis server v=6.0.5 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=1987ac006866aa00

CentOS7.7安装 devtoolset-8(使用高版本gcc (GCC) 8.3.1 20190311)编译安装aria2-1.35.0
CentOS6安装devtoolset(使用高版本gcc)GCC 4.8 GCC 4.9 GCC 5.2

如何编译Linux Kernel(linux-5.6.12内核)并制作成rpm文件

如何编译内核及制作RPM包
CentOS 7 编译Linux Kernel(linux-5.6.12内核)并制作成rpm文件
1、下载Latest Stable Kernel
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.12.tar.xz
tar -Jxf linux-5.6.12.tar.xz

2、安装依赖包
yum -y install openssh-devel elfutils-libelf-devel bc

3、从 /boot 目录将现有版本的内核编译config配置文件拷过来到放到新的内核源码解压目录内并重命名为.config的隐藏文件(这个文件保存了在安装系统时内核所安装的模块配置信,否则需要重新手动指定每一个模块的编译配置)
cd linux-5.6.12
cp /boot/config-3.10.0-1062.el7.x86_64 ./.config
或者
cp /boot/config-$(uname -r) ./.config

3、安装开发工具包组
yum -y groupinstall "development tools"

4、安装ncurse-devel包 (make menuconfig 文本界面窗口依赖包)
yum -y install ncurses-devel
运行 make menuconfig,开启文本界面的编译选项菜单窗口,可以对内核加载的模块编译选项进行调整,如修改编译后的内核名称、新添加之前系统缺少的模块等
make menuconfig

(1)修改内核名称
General setup --->local version -append to kernel release #注意不要有空格

-----------
出现空格的话会产生错误错误
[root@www.zhangfangzhou.cn linux-5.6.12]# sudo make modules_install
ln: target ‘5.6.12_zhangfangzhou.cn_20200510/source’ is not a directory
make[1]: *** [_modinst_] Error 1
make: *** [sub-make] Error 2
-----------

(2)新添加NTFS文件系统支持模块
File systems --->DOS/FAT/NT Filesystems --->NTFS file system support

5、确认配置文件中NTFS功能是否添加成功
vi .config

6、编译内核 #时间较长,具体时间根据硬件性能决定
make -j `cat /proc/cpuinfo | grep 'model name'|wc -l`
或者
## get thread or cpu core count using nproc command ##
make -j $(nproc)

7、编译安装模块
编译完成后执行make modules_install 安装内核模块
make modules_install

8、安装内核核心文件
make install

9、制作成linux-5.6.12内核rpm文件
yum -y install rpmdevtools

cd linux-5.6.12
make rpm-pkg ##同时构建源和二进制RPM软件包
或者
make binrpm-pkg ##仅构建二进制RPM软件包

Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/kernel-5.6.12_zhangfangzhou.cn_20200510-1.x86_64
Wrote: /root/rpmbuild/SRPMS/kernel-5.6.12_zhangfangzhou.cn_20200510-1.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/kernel-5.6.12_zhangfangzhou.cn_20200510-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/kernel-headers-5.6.12_zhangfangzhou.cn_20200510-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/kernel-devel-5.6.12_zhangfangzhou.cn_20200510-1.x86_64.rpm

10、CentOS 7 更换最新内核
egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \' #查看内核版本
grub2-set-default 0

reboot重启

11、Debian/Ubuntu 更换最新内核
sudo update-initramfs -c -k 5.6.12
sudo update-grub

12、查看内核版本
uname -msr
Linux 5.6.12_zhangfangzhou.cn_20200510 x86_64
----------
#https://linuxconfig.org/how-to-compile-vanilla-linux-kernel-from-source-on-fedora
#https://linuxhint.com/compile-linux-kernel-centos7/

U盘安装VMware ESXi 6.7.0.update03的时候出错提示menu.c32 not a com32r image

用U盘给一台电脑安装VMware ESXi 6.7.0.update03的时候出错提示menu.c32 not a com32r image
menu.c32: not a COM32R image
boot:

解决方法1
boot: install
在boot:后面输入install 然后按回车就可以继续安装

解决方法2
电脑支持UEFI BOOT的时候,可以选择UEFI模式从U盘启动,就可以顺利安装VMware ESXi 6.7.0.update03

U盘安装VMware ESXi 6.7.0.update03的时候提示No Network Adapters找不到网卡

网卡型号
瑞昱 RTL8168/8111/8112 Gigabit Ethernet Controller,瑞昱(realtek)网卡俗称螃蟹网卡

解决办法
需要打包驱动到VMware ESXi 6.7.0.update03或者对应的ESXi版本

VMware ESXi 6.7.0.update03安装包在线下载,在线封装网卡驱动

1、更新操作平台
Windows Server 2019
Windows PowerShell (5.1.17763.771)
PS C:\Users\Administrator> Get-Host | Select-Object Version
Version
-------
5.1.17763.771

2、安装VMware PowerCLI(VMware PowerCLI最新版地址https://code.vmware.com/web/dp/tool/vmware-powercli/)
(1)Windows PowerShell在线安装VMware PowerCLI
Find-Module -Name VMware.PowerCLI #查找VMware.PowerCLI模块
Install-Module -Name VMware.PowerCLI -Scope CurrentUser #当前用户安装VMware.PowerCLI,我执行后什么也没有显示
或者
Install-Module -Name VMware.PowerCLI #我执行后什么也没有显示

(2)离线安装VMware PowerCLI
打开网址https://code.vmware.com/web/dp/tool/vmware-powercli/找到VMware-PowerCLI-11.5.0-14912921.zip,点击下载然后解压到WindowsPowerShell模块目录下
C:\Windows\System32\WindowsPowerShell\v1.0\Modules

Import-Module VMware.PowerCLI #PowerShell导入模块
Import-Module : 无法加载文件 C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\VMware.VimAutomation.Sdk\VMware.VimAutomation.Sdk.psm1,因为在此系统上禁止运行脚本。
可能是新版本中PowerShell的Execution Policies为Undefined,较严格,修改一下就可以了
执行 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser 修改后
再次执行Import-Module VMware.PowerCLI 导入即可。

导入成功提示
Welcome to VMware PowerCLI!

Log in to a vCenter Server or ESX host: Connect-VIServer
To find out what commands are available, type: Get-VICommand
To show searchable help for all PowerCLI commands: Get-PowerCLIHelp
Once you've connected, display all virtual machines: Get-VM
If you need more help, visit the PowerCLI community: Get-PowerCLICommunity

Copyright (C) VMware, Inc. All rights reserved.

3、下载ESXi-Customizer-PS 2.60 ( ESXi-Customizer-PS是一个Powershell脚本,可以极大地简化和自动化使用VMware PowerCLI)
直接下载
http://vibsdepot.v-front.de/tools/ESXi-Customizer-PS-v2.6.0.ps1

博客下载
http://www.zhangfangzhou.cn/sh/ESXi-Customizer-PS-v2.6.0.ps1

4、新建文件夹C:\www.zhangfangzhou.cn
将ESXi-Customizer-PS-v2.6.0.ps1放到文件夹C:\www.zhangfangzhou.cn

5、执行添加网卡驱动、sata驱动
.\ESXi-Customizer-PS-v2.6.0.ps1 -v67 -vft -load net55-r8168,net-igb,sata-xahci
在运行命令的文件夹会生成一个iso(ESXi-6.7.0-20191204001-standard-customized.iso)文件(大概20分钟左右)

说明
https://vibsdepot.v-front.de/ 由VMware User Community创建的适用于VMware ESXi的软件和驱动程序包

Updated driver for Realtek 8168/8111/8411/8118 based NICs #更新基于Realtek 8168/8111/8411/8118 NIC的驱动程序
https://vibsdepot.v-front.de/wiki/index.php/Net55-r8168
http://vibsdepot.v-front.de/depot/RTL/net55-r8168/net55-r8168-8.045a-napi.x86_64.vib
http://vibsdepot.v-front.de/depot/bundles/net55-r8168-8.045a-napi-offline_bundle.zip

Intel(R) Gigabit Ethernet Network Driver (modified to ignore invalid NVM checksums) #英特尔(R)千兆以太网网络驱动程序
https://vibsdepot.v-front.de/wiki/index.php/Net-igb
https://vibsdepot.v-front.de/depot/INTL/net-igb-5.3.2/net-igb-5.3.2-99.x86_64.vib
https://vibsdepot.v-front.de/depot/bundles/net-igb-5.3.2-99-offline_bundle.zip

Adds the PCI IDs of several unsupported SATA AHCI controllers and maps them to the built-in AHCI driver#添加多个不受支持的SATA AHCI控制器
https://vibsdepot.v-front.de/wiki/index.php/Sata-xahci
http://vibsdepot.v-front.de/depot/vft/sata-xahci-1.42/sata-xahci-1.42-1.x86_64.vib
http://vibsdepot.v-front.de/depot/bundles/sata-xahci-1.42-1-offline_bundle.zip

.\ESXi-Customizer-PS-v2.6.0.ps1 -v67 -vft -load net55-r8168
.\ESXi-Customizer-PS-v2.6.0.ps1 -v67 -vft -load net55-r8168,net-igb,sata-xahci

6、在线安装更新需要科学上网或者直接使用国外的服务器

命令行操作vSphere--VMware PowerCLI安装 https://zerlong.com/739.html
https://www.jianshu.com/p/6f5a007b46af