Skip to content

Instantly share code, notes, and snippets.

@vulnersCom
Last active October 27, 2022 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vulnersCom/1f9614a973b6e45ab6b742cc2f069ba4 to your computer and use it in GitHub Desktop.
Save vulnersCom/1f9614a973b6e45ab6b742cc2f069ba4 to your computer and use it in GitHub Desktop.
ESXi/vSphere/vSAN Disk Management Cheat Sheet

VULNERS OPENSOURCE, Vulners Project [https://vulners.com]

List storage and mount points.

esxcli storage filesystem list

List devices.

esxcli storage nmp device list

Convert remote (SAN as example) device to local SSD eligable for vSAN. Replace placeholder with naa from "esxcli storage nmp device list" command.

esxcli storage nmp satp rule add -s VMW_SATP_LOCAL -d %DISK_NAA% -o "enable_local enable_ssd" && esxcli storage core claiming unclaim --type=device --device %DISK_NAA% && esxcli storage core claimrule load && esxcli storage core claimrule run && esxcli storage core claiming reclaim --device %DISK_NAA%

Create partition eligable for datastore and add datastore to the host.

partedUtil getptbl /vmfs/devices/disks/mpx.vmhba33:C0:T0:L0

----> figure out max sectors and use in the next command

partedUtil setptbl /vmfs/devices/disks/mpx.vmhba33:C0:T0:L0 gpt "1 64 30285000 AA31E02A400F11DB9590000C2911D1B8 0"
vmkfstools -C vmfs6 -b 1m -S %datastore_name_here% /vmfs/devices/disks/mpx.vmhba33:C0:T0:L0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment