Big thanks to Tom Verhaeg ( BLOG / TWITTER ) for another awesome practice scenario for the VCAP5-DCA
You recently acquired some SSD drives for in your hosts. You’re not running vSphere 5.5 yet so vFRC is not an option. You read something about swap to host cache, and you think it might be wise to configure your SSD drive for usage as host cache.
Well, the process of configuring this isn’t that hard. The swap to host cache will be used as a last resort and a replacement of swapping to “disk”. Remember that vSphere has 4 main memory management techniques:
1) Transparent page sharing: Eliminates redundant copies of memory pages by removing them from memory and creating a reference instead.
2) Memory ballooning: In times of contention, the balloon driver (comes with VMware Tools) will ask the guest OS for unused memory and returns this back to vSphere
3) Memory compression: After ballooning runs out, try compressing the memory (basically gzipping it).
4) Swap to disk / host cache: Swap memory to a disk of some sort.
So, the swapping itself comes last in a process of memory management. While it’s still not wanted, swapping to an SSD is still better than to storage or slow local storage.
You configure this by offering up a (portion of a) n SSD tagged datastore as host cache. Go to Configuration -> Host cache configuration
All devices that are being recognized as SSD drive will show up here. You can right click the datastores and set the amount of disk space that you are willing to spend on host cache. If you haven’t formatted a datastore yet, but do have an SSD in place, you can use the Add storage wizard mentioned above.
Once you’ve configured this, you can browse the datastore which you have (partially) allocated to Host cache. On your datastore, you will find a hashed folder, and in that folder a folder named hostCache.
Something like this: 5241d252-0687-cf96-f89a-10ddb1eabcf5/hostCache
In this folder, you will find as much .vswp files as the total number of GB’s that you have allocated to host cache.
Hurray!