VMware
VMware
tips
- vmci是一个宿主机和虚拟机之间的交换层,可以帮助虚拟机更快地调用硬件资源
PCI Device
example:
ethernet4.pciSlotNumber = "1216"
Bus:Dev.Func
FFF.BBBBB.DDDDD
001.00110.00000 [1216 = 0x4C0]
If BBBBB is 00000, the device is on the Primary PCI bus.
If BBBBB is non-zero, the device is on a Secondary PCI bus.
一般设备都在Secondary Bus上。
Virtual PCIe devices such as e1000e and VMXNET3 vNICs or PVSCSI vHBAs will be singleton devices attached to point-to-point secondary PCIe root ports as PCI Bridges, so their DDDDD encoding will usually be 0.
Virtual legacy PCI devices such as e1000 vNICs or lsilogic vHBAs will be multiple devices attached to a shared secondary PCI bus, so their DDDDD encoding will specify which device on the secondary PCI bus they are on.
Mapping PCI slot numbers to guest-visible PCI bus topology
https://kb.vmware.com/s/article/2047927
SCSI NVME SATA 控制器 最多各4个
网卡最多10个
PCI Number
32, 33, 34, 35 (vmci, sound, e1000, usb, ehci, sata)
36, 37, 38, 39
160, 192, 224, 256 (nvme, scsi, vmxnet3, usb_xhci)
1184, 1216, 1248, 1280
2208, 2240, 2272, 2304
storage controller
Linux Guest OS 优先SCSI
Windows Guest OS 优先NVME
MacOS Guest OS 使用SATA才兼容
物理NVME优先NVME
NVME可降低Guest OS I/O 软件负载(指令简单,同物理NVME设备对OS效果)
PVSCSI可提升性能,但依赖对Host内存的利用
CD-ROM优先SATA,如果要移除可以直接用SCSI
VMware Workstation
VLAN
VMware Workstation is a type 2 hypervisor, and in order for any traffic to hit the physical network wire it needs to pass through the host OS.
If you want to segregate in the way that you're suggesting then you need a type 1 hypervisor.
vmx template
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "15"
virtualHW.productCompatibility = "hosted"
nvram = "bullseye64.nvram"
displayName = "bullseye64"
guestOS = "debian11-64"
numvcpus = "4"
cpuid.coresPerSocket = "2"
vcpu.hotadd = "TRUE"
memsize = "4096"
mem.hotadd = "TRUE"
floppy0.present = "FALSE"
vmci0.present = "TRUE"
hpet0.present = "TRUE"
pciBridge0.present = "TRUE"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
extendedConfigFile = "bullseye64.vmxf"
pciBridge0.pciSlotNumber = "17"
pciBridge4.pciSlotNumber = "21"
pciBridge5.pciSlotNumber = "22"
pciBridge6.pciSlotNumber = "23"
pciBridge7.pciSlotNumber = "24"
vmci0.pciSlotNumber = "32"
sound.pciSlotNumber = "33"
usb.pciSlotNumber = "34"
ehci.pciSlotNumber = "35"
usb_xhci.pciSlotNumber = "256"
sata0.pciSlotNumber = "36"
scsi0.pciSlotNumber = "160"
ethernet0.pciSlotNumber = "192"
nvme0.pciSlotNumber = "224"# default
serial0.present = "FALSE"
parallel0.present = "FALSE"
# paravirtual device
ethernet0.virtualDev = "vmxnet3"
scsi0.virtualDev = "pvscsi"
# sound device
sound.present = "TRUE"
# usb hub 3.1
usb:1.present = "TRUE"
usb:1.deviceType = "hub"
usb:1.speed = "2"vSphere
驱动支持
esxi 6.7 不支持 i225(Intel 2.5G有线网卡系列)
ESXi 7.x 支持
Community Networking Driver for ESXi
https://flings.vmware.com/community-networking-driver-for-esxi
USB Network Native Driver for ESXi
https://flings.vmware.com/usb-network-native-driver-for-esxi
警告
暂不支持Intel 12Gen CPU
vSphere vCenter
1.My practice
# 1. exec install command
# 2. import two licenses and assign themVMware.PowerCLI
不支持Powershell 5.1
https://www.powershellgallery.com/packages/VMware.PowerCLI
Install-Module VMware.PowerCLIbuild ISO on vSphere 7.x
Install-Module -Name VMware.PowerCLI
Add-EsxSoftwareDepot .\VMware-ESXi-7.0U2a-17867351-depot.zip
Add-EsxSoftwareDepot .\Net-Community-Driver_1.2.0.0-1vmw.700.1.0.15843807_18028830.zip
New-EsxImageProfile -CloneProfile "ESXi-7.0U2a-17867351-standard" -name "ESXi-7.0U2a-17867351-NUC11" -Vendor "vmw"
Add-EsxSoftwarePackage -ImageProfile "ESXi-7.0U2a-17867351-NUC11" -SoftwarePackage "net-community"
Export-ESXImageProfile -ImageProfile "ESXi-7.0U2a-17867351-NUC11" -ExportToISO -filepath ESXi-7.0U2a-17867351-NUC11.iso
# export zip
# Export-ESXImageProfile -ImageProfile "ESXi-7.0U3-18644231-NUC" -ExportToBundle -filepath ESXi-7.0U3-18644231-NUC.zip
# update via zip
# esxcli software vib install -d /path/ESXi-7.0U3-18644231-NUC.zipbuild ISO on vSphere 6.x
ESXi-Customizer-PS
https://www.v-front.de/p/esxi-customizer-ps.html
reference
VMware ESXi Patch Tracker:
https://esxi-patches.v-front.de
blog:
https://sysin.org/blog/vmware
安装配置
vim-cmd vimsvc/license --set 1G28U-AW18P-08189-72AE6-9URP8
# esxcli system hostname set --host=PY-SVR-3865U
esxcli system hostname set --fqdn=PY-SVR-3865U.xmgldc.com
esxcli network vswitch standard add -v=vsw-hf302
esxcli network vswitch standard portgroup add -v=vsw-hf302 -p=pg-mgr
esxcli network vswitch standard portgroup add -v=vsw-hf302 -p=pg-vlan
esxcli network vswitch standard portgroup set -p=pg-vlan -v=4095
esxcli network vswitch standard add -v=vsw-ctcc
esxcli network vswitch standard portgroup add -v=vsw-ctcc -p=pg-ctcc
esxcli network vswitch standard add -v=vsw-hd18
esxcli network vswitch standard portgroup add -v=vsw-hd18 -p=pg-mgr
esxcli network vswitch standard portgroup add -v=vsw-hd18 -p=pg-wan
esxcli network vswitch standard add -v=vsw-glfdc
esxcli network vswitch standard policy security set -v=vsw-glfdc -f=true -m=true -p=true
esxcli network vswitch standard portgroup add -v=vsw-glfdc -p=pg-vlan
esxcli network vswitch standard portgroup set -p=pg-vlan -v=4095
esxcli network vswitch standard portgroup add -v=vsw-glfdc -p=pg-device
esxcli network vswitch standard portgroup set -p=pg-device -v=2
esxcli network vswitch standard portgroup add -v=vsw-glfdc -p=pg-wired
esxcli network vswitch standard portgroup set -p=pg-wired -v=3
esxcli network vswitch standard portgroup add -v=vsw-glfdc -p=pg-server
esxcli network vswitch standard portgroup set -p=pg-server -v=5
esxcli network vswitch standard portgroup add -v=vsw-glfdc -p=pg-special
esxcli network vswitch standard portgroup set -p=pg-special -v=7
vim-cmd vimsvc/license --set=HZ0M2-2NKDL-M8DK9-XVCXP-9FALD
esxcli network firewall ruleset set --enabled true --ruleset-id=sshClient
esxcli system hostname set --fqdn=PY-SVR-T3620.xmgldc.com
esxcli network vswitch standard add -v=vsw-glfdc