Skip to content

Instantly share code, notes, and snippets.

@rollwagen
Last active September 6, 2024 13:01
Show Gist options
  • Select an option

  • Save rollwagen/0efbc1aee51c0d91aa3824d73012397b to your computer and use it in GitHub Desktop.

Select an option

Save rollwagen/0efbc1aee51c0d91aa3824d73012397b to your computer and use it in GitHub Desktop.
ESXi links, info, one-liners etc

esxi (on mac mini)

prepare USB boot install drive

adding a USB datastore

ESX 7.0 ESX 6.5

  • Stop and disable arbitrator service
    /etc/init.d/usbarbitrator stop chkconfig usbarbitrator off
  • Plug in usb drive with tail -f /var/log/vmkernel.log
  • For SSD USB drives to be recognized as flash: ESX > Configure > System > Advanced System Settings > Edit... "Disk.AllowUsbClaimedAsSSD" = 1 OR \ esxcli system settings advanced set -o /Disk/AllowUsbClaimedAsSSD -i 1
  • Then reboot or
    esxcli storage core device list esxcli storage nmp satp rule add -s VMW_SATP_LOCAL -d mpx.vmhba33:C0:T0:L0 -o enable_ssd
  • partedUtil mklabel /dev/disks/"mpx.vmhba32:C0:T0:L0" gpt
  • partedUtil getptbl /dev/disks/"mpx.vmhba32:C0:T0:L0" e.g. output: 58370 255 63 937721856, then end sector is (58370 * 255 * 63)-1
  • partedUtil setptbl /dev/disks/"mpx.vmhba32:C0:T0:L0" gpt "1 2048 937714049 AA31E02A400F11DB9590000C2911D1B8 0"
  • vmkfstools -C vmfs6 -S datastore01 /dev/disks/"mpx.vmhba32:C0:T0:L0:1"

vagrant

powershell

Install-Module VMware.PowerCLI
Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore
Connect-VIServer -Server 192.168.1.14
(Get-VM V-macbookpro-rollwagen-esxi-ubuntu).Guest.IPAddress
Get-Command -Module vmware.* *net*
Get-VM | ft Name, NumCpu

useful commands

  • Start all VMs (from SSH shell on ESX host) vim-cmd vmsvc/getallvms | awk 'NR>1 {print $1}' | while read -r line; do vim-cmd vmsvc/power.on "$line"; done

  • Set aintenance mode:
    esxcli system maintenanceMode set --enable [yes|no]

  • Top TERM=xterm esxtop

  • Power off / reboot:
    esxcli system shutdown poweroff
    esxcli system shutdown reboot

  • NTP esxcli system ntp set --enabled=true

  • Windows disk performance test winsat disk -drive C

For a more (complete) lists see \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment