VMware ESXi

VIB installation
ssh [email protected] esxcli software vib install -v /tmp/esxui-signed-4762574.vib
ESXi image customization
# link: https://www.v-front.de/p/esxi-customizer-ps.html

.\ESXi-Customizer-PS-v2.5.ps1 -v65 -update -load Esx-tools-for-esxi,net55-r8168,net55-r8169,net55-e1000e -pkgDir .\pkg\ -ipname FS-ESXi-6.5.0-20170202-ui16 -ipdesc 20170202 -ipvendor FS -outDir .\out\

.\ESXi-Customizer-PS-v2.5.ps1 -v55 -izip .\ESXi550-201612001.zip -update -load esx-tools-for-esx,esx-ui,net-r8168,net-r8169,net-e1000e -pkgDir .\pkg\ -ipname FS-ESXi-5.5.0-20170202-ui16 -ipdesc 20170202 -ipvendor FS -outDir .\out\

.\ESXi-Customizer-PS-v2.5.ps1 -v55 -izip .\ESXi550-201612001.zip -update -pkgDir .\pkg\ -ipname CUSTOM-ESXi-5.5.0-20170202-ui16 -ipdesc 20170202 -ipvendor "OOO Roga i Kopyta" -outDir .\out\
Converting disks
vmkfstools -i old-disk.vmdk -d thin new-disk.vmdk
P2V migration tips
# 1. before migration save Linux Capabilities
find / -type f -print0 | xargs -0 getcap > /root/caps.cap

# check it
# > cat /root/caps.cap
# > /usr/bin/ping = cap_net_admin,cap_net_raw+p
# > /usr/sbin/clockdiff = cap_net_raw+p
# > /usr/sbin/arping = cap_net_raw+p

# 2. migrate using vmware convertor tool

# 3. start vm and restore caps
cat /root/caps.cap | while read line
do
 file=${line/ = */}
 cap=${line/* = /}
 echo "Setting capabilities $cap on $file"
 setcap $cap $file
done

ESXi HP SmartArray CLI
# Show configuration
/opt/hp/hpssacli/bin/hpssacli ctrl all show config

# Controller status
/opt/hp/hpssacli/bin/hpssacli ctrl all show status

# Show detailed controller information for all controllers
/opt/hp/hpssacli/bin/hpssacli ctrl all show detail

# Show detailed controller information for controller in slot 0
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 show detail

# Rescan for New Devices
/opt/hp/hpssacli/bin/hpssacli rescan

# Physical disk status
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show status

# Show detailed physical disk information
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show detail

# Logical disk status
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld all show status

# View Detailed Logical Drive Status
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 show

# Create New RAID 0 Logical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=1I:1:2 raid=0

# Create New RAID 1 Logical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=1I:1:1,1I:1:2 raid=1

# Create New RAID 5 Logical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=1I:1:1,1I:1:2,2I:1:6,2I:1:7,2I:1:8 raid=5

# Delete Logical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 delete

# Add New Physical Drive to Logical Volume
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 add drives=2I:1:6,2I:1:7

# Add Spare Disks
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 array all add spares=2I:1:6,2I:1:7

# Enable Drive Write Cache
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify dwc=enable

# Disable Drive Write Cache
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify dwc=disable

# Erase Physical Drive
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd 2I:1:6 modify erase

# Turn on Blink Physical Disk LED
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 modify led=on

# Turn off Blink Physical Disk LED
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 modify led=off

# Modify smart array cache read and write ratio (cacheratio=readratio/writeratio)
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify cacheratio=100/0

# Enable smart array write cache when no battery is present (No-Battery Write Cache option)
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 modify nbwc=enable

# Disable smart array cache for certain Logical Volume
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 logicaldrive 1 modify arrayaccelerator=disable

# Enable smart array cache for certain Logical Volume
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 logicaldrive 1 modify arrayaccelerator=enable

# Enable SSD Smart Path
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 array a modify ssdsmartpath=enable

# Disable SSD Smart Path
/opt/hp/hpssacli/bin/hpssacli ctrl slot=0 array a modify ssdsmartpath=disable