Zabbix Info

Zabbix Documentation 5.0

Установка и настройка Zabbix 4.0

https://serveradmin.ru/ustanovka-i-nastroyka-zabbix-4-0/

Monitoring SNMP devices with Zabbix:

https://www.experts-exchange.com/articles/31203/Monitoring-SNMP-devices-with-Zabbix.html

ESXi:

# 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

https://techexpert.tips/ru/vmware-ru/zabbix-monitor-vmware-esxi-с-использованием-snmp/

https://sysadmin-note.ru/monitoring-esxi-6-zabbix-3-x/

https://habr.com/en/sandbox/135130/

https://www.zabbix.org/wiki/Esxi_standalone_template

Integration with Mattermost:

https://www.zabbix.com/integrations/mattermost
https://habr.com/ru/post/442404/

chmod 755 /usr/lib/zabbix/alertscripts/zabbixMatterBot.pl
“Can’t locate JSON.pm in @inc” error: sudo apt-get install libjson-perl

Bot or webhook will use the name of the user that created it.

VMware/ESXi info

Difference between processors and cores in VM configuration:

https://blogs.vmware.com/vsphere/2013/10/does-corespersocket-affect-performance.html

In short: better use CPU Sockets, not Cores.

 

Отключить vmem файл vmware player и ESXi:

Vmware Player по дефолту создает .vmem файл (своп памяти) в папке с виртуалкой. Это бесит. Чтобы отключить, надо прописать
mainMem.useNamedFile = “FALSE”
в файле .vmx этой машины.
Это действие значительно ускорит работу виртуалки и уменьшит занимаемый ей размер на объем памяти, выделенный для неё :-)
Чтобы отключить своп в ESXi:
Edit virtual machine settings -> Resourses -> Memory -> Reserve all guest memory
Это отъест фиксированное количество памяти из всего ресурса гипервизора, но за то ускорится работа машины и системы в целом и, опять же, не будет занято лишнее место в датасторе.

 

Заставить ESXi 6.5 работать со старым клиентом:

vi /bootbank/clients.xml
<ConfigRoot>
<clientConnection id="0000">
<authdPort>902</authdPort>
<version>6</version>
<exactVersion>6.0.0</exactVersion>
<patchVersion>1.0.0</patchVersion>
<apiVersion>dev</apiVersion>
<downloadUrl>https://0.0.0.0</downloadUrl>
<flexClientVersion>6.0.0</flexClientVersion>
</clientConnection>
</ConfigRoot>

vi /etc/rc.local.d/local.sh
rm /usr/lib/vmware/hostd/docroot/client/clients.xml
cp /bootbank/clients.xml /usr/lib/vmware/hostd/docroot/client/clients.xml
chmod 444 /usr/lib/vmware/hostd/docroot/client/clients.xml

Reboot server and check how it works

https://lib.ru/unixhelp/vmware.txt#14

 

Updates/patches for ESXi releases ESXi 6.5 and 6.7:

List:
https://docs.vmware.com/en/VMware-vSphere/6.5/rn/esxi650-201911001.html

Downloads:
https://my.vmware.com/group/vmware/patch#search

How to install:
esxcli software vib install -d “/vmfs/volumes/Datastore/DirectoryName/PatchName.zip
https://kb.vmware.com/s/article/2008939

How to uninstall:
esxcli software vib list
esxcli software vib remove -n packsge-name
https://pyatilistnik.org/kak-udalit-vib-paket-v-esxi-5-5-6-0/

 

Enter ESXi shell using keyboard:

Как попасть в шелл напрямую с хоста?
Идем в секцию логов, просматриваем любой лог, нажимаем Alt+F1 и попадаем в шелл.

Краткие команды:
ls -al – аналог dir,
cd начало имени+Tab – автозаполнение имени, полезно когда директории называются 678g6s9-fgs7-f728rgviwv9 и их много

 

Stop background copy on ESXi:

# /sbin/services.sh restart

https://billyfung2010.blogspot.ru/2012/11/how-to-stop-file-copy-on-vmware-esxi-50.html

Restart web console:

https://communities.vmware.com/t5/VMware-vCenter-Discussions/ESXI-Web-UI-not-working/m-p/490841/highlight/true#M6923
/etc/init.d/hostd restart
/etc/init.d/vpxa restart
/etc/init.d/rhttpproxy restart

 

VMDK manipulations:

Rename VMDK:
vmkfstools -E OldName.vmdk NewName.vmdk

https://kb.vmware.com/s/article/1002491

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

https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.storage.doc/GUID-01D3CF47-A84A-4988-8103-A0487D6441AA.html

Move VMDK:
vmkfstools -i "/vmfs/volumes/datastorename/vm/source.vmdk" -d thin "/vmfs/volumes/datastorename/vm/target.vmdk"

 

Check HDD performance via console:

cd /vmfs/volumes/[datastore]
time dd if=/dev/zero of=tempfile bs=8k count=1000000

 

Copy/move VM from one datastore to another:

cp -R /vmfs/volume/olddatastore/myvm /vmfs/volume/newdatastore/myvm
mv /vmfs/volume/olddatastore/myvm /vmfs/volume/newdatastore/myvm

https://forums.servethehome.com/index.php?threads/esxi-moving-vms-to-another-datastore.17508/post-168403

 

Copy VM from one ESXi host to another:

Я пользовался такой командой:

scp -p -r /vmfs/volumes/storagename/vmname/  root@remote.host.ip:/vmfs/volumes/storagename/vmname/

-r means recursive
-p preserves modification times, access times, and modes from the original file.

Enable SSH on the host you are copy VM from.
Enable SSH Client in destination host’s firewall.

https://www.vhersey.com/2013/05/copy-files-between-esxi-hosts-using-scp/

Вот еще варианты:

var.1:

scp -v -c aes128-ctr -r /vmfs/volumes/datastore1/VMNAME* root@0.0.0.0:/vmfs/volumes/datastore1/VMNAME

var. 2:

Use OVFTOOL

syntax: ovftool.exe -ds= vi:/// vi://

Example: ovftool.exe -ds=DS-1 vi://10.1.1.10/SRV-WSUS vi://10.1.1.15

https://community.spiceworks.com/how_to/124377-copy-vmware-guest-from-one-esxi-host-to-another

https://www.virtuallyghetto.com/2012/06/how-to-copy-vms-directly-between-esxi.html

 

VMware ESXi cannot find the virtual disk

vmkload_mod multiextent

 

Менеджмент памяти vmware

https://www.vm4.ru/2010/08/memory-management.html

https://www.vmgu.ru/articles/vmware-vsphere-shares-limit-reservation

https://www.dvip.ru/administrirovanie-vmware-vsphere-str152.html

 

Backup and restore ESXi config:

https://kb.vmware.com/s/article/2042141
Backup:
vim-cmd hostsvc/firmware/sync_config
vim-cmd hostsvc/firmware/backup_config

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/

 

VMware ESXi 7.0 и неподдерживаемое оборудование

https://vmind.ru/2020/07/30/vmware-esxi-7-0-i-nepodderzhivaemoe-oborudovanie/

 

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

rm .ssh/known_hosts

 

Link aggregation (NIC teaming):

https://www.k-max.name/vmware/razbiraemsya-s-lacp-i-nic-teaming-v-vmware/

 

LSI storcli commands in ESXi:

http://pyatilistnik.org/storcli-komandyi-upravleniya-raid-kontrollerom-lsi-v-vmware-esxi-5-5/
/opt/lsi/storcli/storcli show

 

Add hardware dish to VM directly:

Via link:
vmkfstools -z /vmfs/devices/disks/diskname /vmfs/volumes/datastorename/vmfolder/vmname.vmdk

 

Записки на манжетах Максима Мошкова про VMware:

http://lib.ru/unixhelp/vmware.txt

 

Размер системной партиции OSDATA в ESXi 7.0:

https://williamlam.com/2020/05/changing-the-default-size-of-the-esx-osdata-volume-in-esxi-7-0.html

Не создается Datastore. Call “HostDatastoreSystem.QueryVmfsDatastoreCreateOptions” for object “ha-datastoresystem” on ESXi failed:

https://itbru.ru/index.php/2018/11/22/esxi-queryvmfsdatastorecreateoptions-for-object/
Go to Storage -> Devices
Click on the disk you need and you will see its path like “/vmfs/devices/disks/naa.600508b1001c86bd09bb2eb56ca8249b”

In console do this (all information on this disk will be erased!):
partedUtil mklabel /dev/disks/naa.600508b1001c86bd09bb2eb56ca8249b msdos

Now you can create the datastore.

Cannot connect ‘path:0/1/0/5 version:2’ to this virtual machine. The device was not found.:

https://communities.vmware.com/t5/ESXi-Discussions/USB-quot-device-not-found-error-quot-when-adding-to-VM-ESXi-6-5/td-p/1405618
Add usb.generic.allowCCID = "TRUE" to the VM’s vmx file.

Protect ESXi server against encryption by Babuk-like ransomware:

https://kb.vmware.com/s/article/76372
https://www.bleepingcomputer.com/news/security/massive-esxiargs-ransomware-attack-targets-vmware-esxi-servers-worldwide/
https://www.gkhan.in/new-esxiargs-ransomware/
esxcli system slp stats get
/etc/init.d/slpd stop
esxcli network firewall ruleset set -r CIMSLP -e 0
chkconfig slpd off
chkconfig --list | grep slpd

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”:

https://communities.vmware.com/t5/ESXi-Discussions/USB-eToken-ESXi-6-5-not-working/td-p/464775

1. Power of the VM
2. Append the following line to your VM configuration (.vmx)
usb.generic.allowCCID = "TRUE"

Free ESXi 8.0 – How to Download and get License Keys:

https://www.virten.net/2022/11/free-esxi-8-0-how-to-download-and-get-license-keys/

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

ESXi Network Speed Test Step-By-Step using iperf:

https://whyiblog.com/esxi-network-speed-test-step-by-step/
https://www.virtualizationhowto.com/2019/02/run-basic-network-speed-bandwidth-throughput-test-between-esxi-hosts/

iSCSI Storage ESXi 7:

https://www.server-world.info/en/note?os=ESXi_7&p=storage&f=4

Useful ESXi 7 info:

https://www.server-world.info/en/note?os=ESXi_7

Check NUMA node RAM usage by VM:

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

Failed to deploy OVF package: The task was canceled by a user.

Если OVA:
– распаковать OVA файл с виртуальной машиной используя Winrar или 7zip;
– изменить расширение .mf файла (например на mf-)
– отыскать CD-ROM: vmware.cdrom.iso в .ovf файле
– изменить iso на atapi
– экспортировать распакованное содержимое, выбрав отредактированный .ovf файл

https://communities.vmware.com/thread/431021

https://tm-experimental.blogspot.com/2013/11/failed-to-deploy-ovf-package-task-was.html

Простейший мониторинг состояния RAID массива и дисков в нем на ESXi

Простейший мониторинг состояния RAID массива и дисков в нем на ESXi:

https://habr.com/company/simnetworks/blog/241605/

Если коротко, то:
– выясняем модель 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

ESXi web client install

Howto: https://www.vladan.fr/esxi-free-web-client-interface/
Descr.: https://www.vmgu.ru/news/vmware-esxi-embedded-web-client
Download: https://labs.vmware.com/flings/esxi-embedded-host-client
Troubleshooter for 5.5: https://www.virtuallyghetto.com/2015/08/new-html5-embedded-host-client-for-esxi.html

 

Как зайти:
https://esxi.host/ui/

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

 

Справочник по vi:
https://rsusu1.rnd.runnet.ru/unix/ucomm/vi.html

ESXi 6.0 Windows 7 VM failed to start with error: The operation on the file failed (14(Bad address))

После копирования виртуалки с 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"

https://communities.vmware.com/thread/560785

Manage LSI RAID controller, installed on server running ESXi, in Windows

For example, we want to monitor MEGARAID SAS 9341-4I:

LSI Software:
https://www.broadcom.com/products/storage/raid-controllers/megaraid-sas-9341-4i#downloads

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

HOWTOs:
https://habrahabr.ru/company/simnetworks/blog/241605/
https://pyatilistnik.org/kak-ustanovit-megaraid-smis-providers-na-vmware-esxi-5-5/
https://bogachev.biz/2015/09/08/Установка-MegaRAID-SMIS-Providers-на-VMware-ESXi-5-5/
https://serenity-networks.com/how-to-install-lsi-megaraid-storage-manager-msm-on-vmware-esxi-5-5/

Troubleshooting:
“Unable to connect to CIMOM server” in MSM

Restore Management network ESXi

Если случилось :-) удалить Management Network и даже в ESXi DCUI настройки стали неактивными серыми, то:

• esxcfg-vswitch -a vSwitch1
With this command you can create a new vSwitch named: “vSwitch1”

• esxcfg-vswitch -A “Management Network” vSwitch1
now you can assign a portgroup “Management Network” to the new vSwitch1

• esxcfg-vswitch -L vmnic0 vSwitch1
this step adds pNIC “vmnic0” to the vSwitch1

• esxcfg-vmknic -a  -i 160.xxx.xxx.xxx -n 255.xxx.xxx.xxx “Management Network”
this command will set the IP address/Subnet

https://www.running-system.com/total-loss-of-esxi-management-network-settings-rebuild-vswitch-portgroup-and-ip-settings-with-command-line/

Пара полезных команд:
– список имеющихся свитчей:
esxcfg-vswitch -l
– список имеющихся vmk:
esxcli network ip interface list
– список имеющихся сетевых карт:
esxcfg-nics l
– привязать vSwitch и сетевую карту:
esxcfg-vswitch -L vmnic0 vSwitch1
– отвязать сетевую карту:
esxcfg-vswitch -U vmnic0 vSwitch1
– удалить vmKernel:
esxcli network ip tinterface name –interface-name vmkX