Passthrough existing SATA drives to ESXi VMs

Enable SSH on the ESXi host

SSH in (ssh [email protected]) and run command:

ls -l /vmfs/devices/disks

To identify your hard drive, look for an entry with only rw access and without an additional entry such as :1 attached at the end. Example:

-rw------- 1 root root 1000204886016 Nov 16 06:04 t10.ATA_____WDC_WD10EZEX2D60WN4A0_________________________WD2DWCC6Y1ENVDD7

Use the vmkfstools command to turn this HDD entry into a vmdk file which can be attached to a VM. Example:

vmkfstools -z /vmfs/devices/disks/t10.ATA_____WDC_WD10EZEX2D60WN4A0_________________________WD2DWCC6Y1ENVDD7 "/vmfs/volumes/SSD/Ubuntu Server/Cache.vmdk"

vmkfstools will create the vmdk file specified in the above command. The vmdk file needs to be created inside the datastore and VM folder you are passing to. Make sure the new vmdk filename does not conflict with other files in the folder.

Finally, edit the VM settings in ESXi and add a new SCSI controller (only need to do this once for multiple drives). Then add an existing hard disk (selecting the new vmdk file we created). Once the existing hard disk has been added, expand it and change the SCSI controller to the one you just added and change the disk mode to Independent – persistent.