使用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 参数验证。不部署设备。

https://www.zhangfangzhou.cn/cli-install-vcsa.html

基于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、自动添加私钥。

https://www.zhangfangzhou.cn/pxe-kickstart-install-uefi-esxi-7.html

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 直通设备


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