[隨筆] VMWare ESXi 筆記

ESXi Command

  • Restart

    1
    2
    [root@node01:~] esxcli system maintenanceMode set -e true
    [root@node01:~] esxcli system shutdown reboot -d 10 -r "WEB CRASH"
  • Shutdown guest vm

    1
    2
    [root@node01:~] esxcli vm process list 
    [root@node01:~] esxcli vm process kill --type=soft --world-id=70636
  • hostname

    1
    2
    3
    [root@localhost:~] esxcli system hostname set --host=esxi
    [root@esxi:~] esxcli system hostname set --domain=fape.cloud
    [root@esxi:~] esxcli system hostname set --fqdn=esxi.fape.cloud
  • Disk Clone

    1
    2
    3
    4
    5
    6
    [root@esxi:~] cd /vmfs/volumes/WD500G/
    [root@esxi:/vmfs/volumes/5b53a83f-dd90c63a-c2d4-0015176a9387] vmkfstools -i Ubuntu-Clean.vmdk -d thin /vmfs/volumes/DSM_iSCSI_320GB/SSR/SSR.vmdk
    Destination disk format: VMFS thin-provisioned
    Cloning disk 'Ubuntu-Clean.vmdk'...
    Clone: 100% done.
    [root@esxi:/vmfs/volumes/5b53a83f-dd90c63a-c2d4-0015176a9387] exit
  • Enable SNMP

    1
    2
    [root@node01:~] esxcli system snmp get
    [root@node01:~] esxcli system snmp set --help
  • Disk Passthrough
    https://kb.vmware.com/s/article/1017530

    1
    2
    3
    4
    5
    [root@node01:~] ls -l /vmfs/devices/disks
    [root@node01:~] vmkfstools -z /vmfs/devices/disks/naa.5000c5002a06ade0 /vmfs/volumes/datastore1/FreeNAS/320G_Disk1.vmdk
    [root@node01:~] vmkfstools -z /vmfs/devices/disks/naa.5000cca35bc41ad6 /vmfs/volumes/datastore1/FreeNAS/320G_Disk2.vmdk
    [root@node01:~] vmkfstools -z /vmfs/devices/disks/naa.5000cca369d2fef5 /vmfs/volumes/datastore1/FreeNAS/2TB_Disk1.vmdk
    [root@node01:~] vmkfstools -z /vmfs/devices/disks/naa.5000cca221dab4df /vmfs/volumes/datastore1/FreeNAS/2TB_Disk2.vmdk