# esxcli system snmp set –communities GokuBlack
# esxcli system snmp set –syscontact=”Zamasu <zamasu@dbsuper.com>”
# esxcli system snmp set –syslocation=”Universe10 – IT Room”
# esxcli system snmp set –enable true
Vmware Player по дефолту создает .vmem файл (своп памяти) в папке с виртуалкой. Это бесит. Чтобы отключить, надо прописать
mainMem.useNamedFile = “FALSE”
в файле .vmx этой машины.
Это действие значительно ускорит работу виртуалки и уменьшит занимаемый ей размер на объем памяти, выделенный для неё :-)
Чтобы отключить своп в ESXi:
Edit virtual machine settings -> Resourses -> Memory -> Reserve all guest memory
Это отъест фиксированное количество памяти из всего ресурса гипервизора, но за то ускорится работа машины и системы в целом и, опять же, не будет занято лишнее место в датасторе.
Как попасть в шелл напрямую с хоста?
Идем в секцию логов, просматриваем любой лог, нажимаем Alt+F1 и попадаем в шелл.
Краткие команды:
ls -al – аналог dir,
cd начало имени+Tab – автозаполнение имени, полезно когда директории называются 678g6s9-fgs7-f728rgviwv9 и их много
Cloning or Converting a Virtual Disk or RDM: -i|--clonevirtualdisk oldName newName
-d|--diskformat [thin|zeroedthick|eagerzeroedthick|rdm:device|rdmp:device|2gbsparse]
-W|--objecttype [file|vsan|vvol]
--policyFile fileName
-N|--avoidnativeclone
Restore:
!When restoring configuration data, the build number of the host must match the build number of the host on backup file and UUID (can be obtained using the command “esxcfg-info -u”) of the host should match the UUID of the host on backup file.
Use numeric 1 as force option to override the UUID mismatch. For example, vim-cmd hostsvc/firmware/restore_config 1 /tmp/configBundle.tgz
vim-cmd hostsvc/maintenance_mode_enter
vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz
You can see the .tgz using ls /scratch/downloads/
E-token failed to add to VM with error “Failed to reconfigure virtual machine VMNAME. Cannot connect ‘vid: pid: path:0/1/0’ to this virtual machine. The device was not found”:
Mouse cursor misplaced in vSphere Client and in VMRC:
In Windows 11 when you apply custom Scale in Display settings there may be some misplacement of cursor in VMRC ans vSphere VM’s console.
It can be fixed by configuring DPI settings in Compatibiality options for the corresponding application:
VpxClient.exe -> Compatiability -> Change High DPI settings -> Use this setting to fix scaling… -> Use DPI that’s set for my main display when -> I open this program
and
VpxClient.exe -> Compatiability -> Change High DPI settings -> High DPI scaling override -> Application
esxtop
m (to select Memory stats)
f (to configure the view options)
uncheck everything except D and G (name and NUMA)
return (exit to the esxtop)
V (configure view of running VMs only)
GST_NDX – NUMA node number where VM’s memory allocated in
Online Update Standalone ESXi Host:
https://docs.macstadium.com/docs/update-standalone-esxi-host-via-online-bundle https://www.nakivo.com/blog/instal-vib-files-on-esxi/
Put host in Maintenance Mode: vim-cmd hostsvc/maintenance_mode_enter
Check software profile in depot file: esxcli software sources profile list --depot=file:///vmfs/volumes/DATASTORENAME/VMware_ESXi_RELEASE_depot.zip
Check update with needed depot file using corresponding profile: esxcli software profile update --depot=file:///vmfs/volumes/DATASTORENAME/vib/VMware_ESXi_RELEASE_depot.zip --profile=ESXi-PROFILENAME --dry-run
If everything is ok, then update the host:
Update host with needed depot file using corresponding profile: esxcli software profile update --depot=file:///vmfs/volumes/DATASTORENAME/vib/VMware_ESXi_RELEASE_depot.zip --profile=ESXi-PROFILENAME
Reboot
Exit maintenance mode: vim-cmd hostsvc/maintenance_mode_exit
Error while updating ESXi: VIB QLC_bootbank_qedrntv_ requires qedentv_ver = , but the requirement cannot be satisfied within the ImageProfile
When you’re updating ESXi from .zip package, using esxcli software vib install -d /vmfs/volumes/PATH-TO-UPDATE.zip command, system can throw an error about the ImageProfile. esxcli software sources profile list -d /vmfs/volumes/PATH-TO-UPDATE.zip
this will show a list of profiles. Choose one that fits your needs: esxcli software profile update -p ESXi-XXX-standard -d /vmfs/volumes/PATH-TO-UPDATE.zip
wait until install ends
Read SSD SMART TBW ESXi CLI:
https://www.virten.net/2016/05/determine-tbw-from-ssds-with-s-m-a-r-t-values-in-esxi-smartctl/
Download: http://www.virten.net/files/smartctl-6.6-4321.x86_64.vib
Install: esxcli software acceptance set --level=CommunitySupported esxcli software vib install -v /vmfs/volumes/NAME/smartctl-6.6-4321.x86_64.vib
list available devices in ESXi shell: ls -l /dev/disks/
list all info about selected device: /opt/smartmontools/smartctl -d [Device Type] --all /dev/disks/[DISK]
for SATA disks use –sat
/opt/smartmontools/smartctl -d sat –all /dev/disks/[DISK]
list only SMART attributes about selected device: /opt/smartmontools/smartctl -d sat --attributes /dev/disks/[DISK]
list only needed attribute information: /opt/smartmontools/smartctl -d sat --attributes /dev/disks/[DISK] | grep Temperature_Celsius
Interestingly that on some SSD’s only 241 Total_LBAs_Written attribute is available: 241 Total_LBAs_Written 0x0032 100 100 000 Old_age Always - 122520
This number does not mean anything that is connected to a real written Bytes, Gigabytes ot Terabytes.
I’ve tried to use the formula from https://www.virten.net/2016/05/determine-tbw-from-ssds-with-s-m-a-r-t-values-in-esxi-smartctl/ but in my case number was 5,720462650060654e-5
I did an experiment:
dd if=/dev/zero of=/vmfs/volumes/STORAGENAME/test/test bs=1M count=1024
and looked how “241 Total_LBAs_Written” changed from 122357 to 122520. Using simple caclulations: 163 * X = 1024 we have X = near 6.3. It seems that every megabyte written increases the number in “241 Total_LBAs_Written” by 6.3
Now it is possible to count the TBW of that SSD: (122520 * 6.3)/1024 = 753,7 Gigabytes
Export VM: "C:\Program Files\VMware\VMware OVF Tool\ovftool.exe" vi://USERNAME@XXX.XXX.XXX.XXX/VMNAME LOCALDISK:\vmname.OVA
When you have a VM with multiple “physical” disks (.vmdk) Ovftool will export VM like OVF (many files including .vmdk disks) no matter that you’ll specify “.OVA” in previous command. But you can convert all that bunch of files to .OVA using "C:\Program Files\VMware\VMware OVF Tool\ovftool.exe" LOCALDISK:\vmname.ovf LOCALDISK:\vmname.ova
Mybe Vmware just want us to wear our SSDs faster? I don’t know any other reason why it is working like this. In previous versions (before 7) of ESXi everything was good: you could just command to export as OVA and get everything done.
“Note: This method should not be used when the ESXi host is already added to a vCenter Server. In that case, the certificate should be renewed using Right-Click ESXi Host in Inventory > Certificates > Renew Certificate”
In most cases it says that something wrong with import-export process, or vmdk files are broken due to some reasons.
But sometimes removing (or renaming) the .mf file helps import the VM (or part/s of it).
Если OVA:
– распаковать OVA файл с виртуальной машиной используя Winrar или 7zip;
– изменить расширение .mf файла (например на mf-)
– отыскать CD-ROM: vmware.cdrom.iso в .ovf файле
– изменить iso на atapi
– экспортировать распакованное содержимое, выбрав отредактированный .ovf файл
Если коротко, то:
– выясняем модель RAID контроллера;
– ищем на сайте производителя драйверы и SMIS провайдер под VMware;
– закачиваем в датастор драйвер и провайдер;
– устанавливаем это все примерно такими командами:
esxcli software vib install -v “/vmfs/volumes/STORAGENAME/Distr/Drv/Adaptec/msm_vmware_v2_06_23164/cim/esxi6_0/cim/vmware-esx-provider-arcconf.vib”
некоторые производители (привет, Адаптек!) почему-то не подписывают свой софт и ESXi откажется его устанавливать из-за этого. Используем –no-sig-check (два дефиса перед no) в команде установки для обхода этого препятствия.
– перезагружаем сервер;
– смотрим, появилась ли информация о контроллере, массиве и дисках в Health Status
How to install:
esxcli software vib install -v /vmfs/volumes/storagename/Distr/VM/WebClient/esxui-signed-5214684.vib
Troubleshooting:
Service 503 error:
Step 1 – SSH to your ESXi host and open the following configuration file:
vi /etc/vmware/rhttpssproxy/endpoints.conf
Step 2 – Remove the following line and save the changes
set cursor on this line:
/ui local 8308 redirect allow
and press dd
press ZZ (with shift) to save
Step 3 – Restart the reverse proxy by running the following command:
/etc/init.d/rhttpssproxy restart
После копирования виртуалки с windows 7, созданной в ESXi 5.5 на сервер с ESXi 6.0 и попытки ее запуска получил ошибку:
The operation on the file failed (14(Bad address))
Места в датасторе предостаточно.
Спасает команда vmkfstools -i "/vmfs/volumes/datastorename/vm/source.vmdk" -d thin "/vmfs/volumes/datastorename/vm/target.vmdk"
On ESXi:
– Download VMware Driver – usually from VMware site
– Download SMIS Provider
– Enter Maintenance Mode
– Set Host Image Profile Acceptance Level to Community in Security configuration.
– Install driver: esxcli software vib install -v /vmfs/volumes/VOLUME-NAME/DRV-DIR-NAME/DRV-NAME.vib –no-sig-check
– Reboot.
– Install SIMS Provider: esxcli software vib install -v /vmfs/volumes/VOLUME-NAME/DRV-DIR-NAME/SIMS-NAME.vib –no-sig-check
– Reboot.
– Check everything installed fine: esxcli software vib list | grep -i lsi
– Check LSI RAID appeared Health Status in vSphere Client or Web Client.
– Exit Maintenance Mode.
– Check CIM Server started in Security Profile. Also check its startup policy.
– Check CIM Server port.
– Check or set host name in DNS And Routing.
On Windows:
– Download and install Latest MegaRAID Storage Manager (MSM)
– Configure ESXi server’s A record in DNS or write it to hosts file.
– Start MSM and set “Display all the ESXi-CIMOM…” in Configure Host.
– Enter ESXi server’s IP and start discovery.
Troubleshooting:
– ping ESXi host to be sure it is available in network
– download SLP Helper utility and set ESXi host’s IP in slp_helper.php