I continue to be amazed everyday at all the awesome features and challenges being tackled by our VMware Engineering organization and yesterday was another example of that. There was a question that was posed internally about emulating an SSD device for a Nested ESXi environment running in VMware Fusion. I figure this would be an easy answer and pointed the user to a blog article I had written a few years ago on how to fake an SSD device in ESXi using SATP claim rules via ESXCLI. It turns out, one of the engineers knew of a better way of emulating an SSD Virtual Disk that can be consumed beyond just Nested ESXi VMs but also for any other guestOSes that supports SSD devices.
So why would you want to emulate an SSD device? Well for a vSphere environment, you may want to try out the new Swap to Host Cache feature from a functional perspective to see how it would work. You might be developing a script to enable this feature and having a "fake" SSD device would allow you to create such a script and test it. For other guestOSes, maybe you want to see how the system would react to an SSD device, perhaps drivers or configurations maybe needed and you would like to run through those processes before installing a real SSD device.
So the solution is actually quite simple and it is just an advanced setting in the Virtual Machine's configuration file (VMX) which can also be appended to using either the vSphere Web Client, vSphere C# Client or the vSphere API. This setting is only supported on Virtual Machines that is running virtual hardware 8 or greater. To configure a specific virtual disk to appear as an SSD, you just need to add the following:
scsiX:Y.virtualSSD = 1
where X is the controller ID and the Y is the disk ID of the Virtual Disk.
This configuration presents to the guestOS the mediumRotationRate field of the SCSI inquiry pages 0xB1 and sets the value to 1 and the guests will then report it as a solid-state device. As you can see, this can benefit more than just running Nested ESXi, you can also do various testing on other guestOSes that you require a "fake" SSD device.
Note: Though you can emulate an SSD device, it is no substitute for an actual SSD device and any development or performance tests done in a simulated environment should also be vetted n a real SSD device, especially when it comes to performance.
It is also important to note that reporting of an SSD device will highly depend on the guestOS, here is a high level table on how some of the common guestOSes recognize SSD devices.
GuestOS | SSD Reporting |
Windows 8 | IDE, SCSI and SATA disks can be recognized as SSDs |
Windows 7 | IDE and SATA disks can be recognized SSD, but SCSI as mechanical |
Linux (Ubuntu & RHEL) | IDE, SCSI and SATA disks can be recognized as SSDs |
Mac OS X | SATA can be recognized as SSDs, but IDE and SCSI as mechnical |
Here is a screenshot of a Nested ESXi host with an emulated SSD device:
Here is a screenshot of the new Windows 8.1 Preview with an emulated SSD device:
Note: Though I demonstrated this using vSphere, this also works for VMware Fusion (tested this personally), Workstation and Player. The only requirement is that you are running virtual hardware 8 or greater and that your guestOS supports reporting SSD device.
From a Nested ESXi perspective, I will definitely be using this method instead of using ESXCLI to go through the SATP claim rules, this is much easier to remember. I would also like to thank Regis Duchesne for sharing this tip and Srinivas Singavarapu and the virtual devices team for developing this awesome feature. You guys ROCK!
NiTRo says
"ESXi allows operating systems to auto-detect VMDKs residing on SSD datastores as SSD devices."
http://pubs.vmware.com/vsphere-50/topic/com.vmware.vsphere.storage.doc_50/GUID-E9E146C9-E99C-4468-B70C-770B83788433.html
William Lam says
Yes, that's the default behavior (it'll auto-detect). However, if you want to forcefully disable or enable it, then the above advanced setting will allow you to do so
Anonymous says
Hello Willam ! I have SSD(460gb) of PCI Express slot. such as having to connect an additional SSD storage. Advanced i see it it passthrough mode.
Jesus Escolar says
Does it works when editing the .vmx / .vmxf of a virtualized ESXi in VMware Workstation?
Tom Hale says
I raised a question on this: http://superuser.com/questions/1139128/emulate-ssd-drive-in-vmware-workstation-12
Jason Burroughs says
What about using Fusion on an SSD Macbook Pro and wanting to test VSAN, which requires an SSD and a spinning disk? I believe I need to fake the SSD into looking like a spinning disk, right?
William Lam says
Yes, you can use this same parameter on other VMware products and toggle a disk to either make it look like an SSD or MD
Jason Burroughs says
Thanks for the reply, William. Let me restate my question - I have a 2013 Macbook Pro Retina with a 1TB SSD drive (and 16GB RAM). I have Fusion 6.0.3 installed, and I installed 3 x ESXi 5.5 VM's, as well as a Windows 2012 R2 system with vCenter on it. Now I'm ready to get VSAN up and running for testing. I created one 4GB and one 8GB VMDK for each ESXI host. However, when I go to create Disk Groups for VSAN, it shows only two SSDs per host, and does not allow for VSAN on that configuration.
I need to force it to use an SSD as a hard drive. I was able to get it to work by using the longer ESXCLI command with "disable_ssd", but was hoping for a simple method like you have posted here to make a hard drive look like an SSD. Is that possible?
William Lam says
As I mentioned already, the adv setting works both ways regardless of the underlying disk. scsiX:Y.virtualSSD = 0 means no SSD and scsiX:Y.virtualSSD = 1 means SSD
So if you want the VMDK to not show up as an SSD, just set it to 0 🙂
You may also want to take a look at this article http://www.virtuallyghetto.com/2014/04/ovf-template-for-creating-nested-esxi-3-or-32-node-vsan-cluster.html which includes an OVF that you can download & use which contains the minimal setup for a Nested VSAN setup
ashwani says
Hi,
thanks for the information!
I am trying to achieve the same for rhel6u5 guest OS Vms, on ESX5.1. HW level 8.
I edited the VMX file and then loaded it, but I still see the Vdisk
Host: scsi2 Channel: 00 Id: 01 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Please suggest if I am missing something.
LB@SDS says
When I follow all these instructions and set up the hosts, networks and invoke the commands required to emulate SSD on a drive in my host, I do see the SSD drive available in STORAGE view, but the vSAN "Create Disk Group" page doesn't see the SSD.
It sees the other non-ssd.
Why does everything else show the SSD, and the vSAN "Disk Group" screen not see it?
Ted Shinn says
I configured a VMware Workstation 10 Virtual Machine with 8.1x32. I chose to add 2 SCSI HDDs, one was 250 GB and the other was 100 GB. Both were set up the same way. After the VM was powered on, C:\ properties tool tab optimize indicated that C: could not be optimized since it was an SSD, while D: was not SSD and could be optimized. The System Reserved was also SSD. The VMs I set up are for QA testing. I need them to not be SSD. I do not know what is going on and how to correct it. Help would be greatly appreciated. Ted Shinn, novice virtualization worker
dinero says
Awesome..it worked..Thankyou !!!
Sergei says
Hi, William!
Do you have any updates on this feature, when the guest we deploy on ESX is not another ESX, but some sort of Linux? I have tried myself - the feature doesn't work neither on RHEL6, nor on CentOS 7.
MDru2000 says
Thanks for the parameter which worked as expected. While setting this parameter allows "fake" ssd, my application require that a certain IOPS threshold be met. Is there a parameter to set the IOPS for the "fake" ssd?
William Lam says
There is not
Andrew Zimmerman says
All of my disks are reporting as flash now. After your fix.
I even tried specifying specifically after each other disk, the other option, to indicate it's not an ssd, to no avail.
Andrew Zimmerman says
But if you go into the individual host, there's an option to mark individual storage devices as flash for hdd.
Problem solved. I would avoid following the above steps, because I tried them every which way and it's not working on esxi 6.
gigel says
is there any way to make Fusion on arm M1 do the same? It defaults to NVME disk type, but windows 11 arm inside sees it as HDD. Tried nvme0:0 and creating sata and scsi disks... sata is seen as HDD while the scsi emulation does not have a driver yet for vmware tools for windows 11 arm.
nvme0:0.virtualSSD = "1"
scsi0:0.virtualSSD = "1"
sata0:0.virtualSSD = "1"
William Lam says
How are you checking in Windows that it is detecting the driver as HDD?
I noticed that if you use Defrag tool, it may show up as HDD but if you use PowerShell Get-PhysicalDisk cmdlet, it does properly return "SSD", which is what I see on my M1 w/Win11 installed
gigel says
yes, using defrag tool, it shows it as hdd (and shows Defragment instead of Optimize). Also trimcheck.exe shows that trim is not available, both to nvme and sata drivers (as scsi driver is not available for windows arm guest)
https://i.imgur.com/j20izIr.png
also, Optimize-Volume -Verbose -ReTrim -DriveLetter C VERBOSE: Invoking retrim on (C:)... VERBOSE: Retrim: 100% complete. Optimize-Volume : The volume optimization operation requested is not supported by the hardware backing the volume. Activity ID: {b1c70956-9423-0002-75f3-c7b12394da01} At line:1 char:1 + Optimize-Volume -Verbose -ReTrim -DriveLetter C
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Optimize-Volume], CimExcep
tion
+ FullyQualifiedErrorId : StorageWMI 43022,Optimize-Volume
so vmware still does not offer live guest block discarding in 2024? sheeesh. that's why I ran away from it 10 years ago.