First, enable SSH on your ESXi host (if not already enabled).
Connect to ESXi IP address, go to Actions and then select Services and Enable Secure Shell (SSH).
You have to stop USB Arbitrator Service. The service is used to passthrough the USB devices from hosts to a virtual machine. Once stopped, you will not be able anymore to passthrough USB devices to VMs.
# /etc/init.d/usbarbitrator stop
To maintain the stopped status of the service after reboot, insert the command:
# chkconfig usbarbitrator off
# ls /dev/disks/
Find the identifier (tricky part), mine is called mpx.vmhba33:C0:T0:L0
.
# partedUtil mklabel /dev/disks/<deviceID> gpt
In order to create the partition, we need to have a few info:
- The start sector: 2048
- The GUID for VMFS: AA31E02A400F11DB9590000C2911D1B8
- The end sector. This one should be calculated.
To calculate the end sector, we’ll issue the following command first:
# partedUtil getptbl /dev/disks/<deviceID>
Use this formula to get the end Sector:
# eval expr $(partedUtil getptbl /dev/disks/<deviceID> | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
Now we have all the info and we can create the partition using the command:
# partedUtil setptbl /dev/disks/<deviceID> gpt "1 2048 <endSector> AA31E02A400F11DB9590000C2911D1B8 0"
# vmkfstools -C vmfs6 -S USB-Storage /dev/disks/<deviceID>:1
Return to ESXi and check the Storage tab. You should see here the new Datastore.