As most features these days in vSphere you can configure them using the awesome esxcli command. I’ve already mentioned esxcli in my vSphere Flash Read Cache FAQ blog but I wanted to call it out explicitly here as I found it very useful. You can get some nice details using the esxcli command. So where do we start?
First thing would be:
esxcli storage vflash
This will return that there are 3 namespaces: cache, module and device. Lets start top down with device. The command “esxcli storage vflash device list” will show you a list of all flash devices and whether it has been configured for vFRC or not. The module namespace can provide you some more details around for instance cache blocksizes etc. If you run the command this is what the output looks like:
~ # esxcli storage vflash module get Min Supported Module Version: 126.96.36.199 Revision: 188.8.131.52 Supported Cache Block Size Max: 1048576 Supported Cache Block Size Min: 4096 Supported Cache Size Max: 214748364800 Supported Cache Size Min: 4194304 Supported Disk Size Max: 17592186044416 Supported Mode Mask: WriteThru
You can see in this case that the minimum supported block size is 4KB and the max 1024KB and that the cache is supported for write through etc. So what about VM statistics / details, that is more interesting right? Well that is where the cache name space comes in to play! So you start with listing your current enabled cache:
~ # esxcli storage vflash cache list vfc-413278667-vfrc-test
Now that we know what the name is of our cache we can retrieve some details.
~ # esxcli storage vflash cache get -c vfc-413278667-vfrc-test World ID: 2299121 Cachename: vfc-413278667-vfrc-test Vmdkname: vfrc-test-flat.vmdk
And of course we can get some, probably the most interesting part, nice metrics about this specific cache file. Note I just powered-on this virtual machine, hence the extremely low cache hit rate.
~ # esxcli storage vflash cache stats get -c vfc-413278667-vfrc-test Read: Cache hit rate (as a percentage): 4 Total cache I/Os: 196 Mean cache I/O latency (in microseconds): 24823 Mean disk I/O latency (in microseconds): 45261 Total I/Os: 5883 Mean IOPS: 44 Max observed IOPS: 44 Mean number of KB per I/O: 586 Max observed number of KB per I/O: 6936 Mean I/O latency (in microseconds): 22304 Max observed I/O latency (in microseconds): 23623 Evict: Last I/O operation time (in microseconds): 0 Number of I/O blocks in last operation: 0 Mean blocks per I/O operation: 0 Total failed SSD I/Os: 0 Total failed disk I/Os: 0 Mean number of cache blocks in use: 11728
And if you want to reset the statistics you can do so using:
~ # esxcli storage vflash cache stats reset -c vfc-413278667-vfrc-test
Nice to know right?!