Configure and manage vSphere Flash Read Cache

Summary

VMware’s Flash Read Cache lets you accelerate virtual machine performance through the use of host resident flash devices as a cache.

Before configuring Flash Read Cache for your VMs, become familiar with the typical workload. If your workload is write-intensive, it doesn’t make much sense to use VMware’s Flash Read Cache, you may be better off looking at 3rd party alternatives such as PernixData’s FVP 2.5 or AtlantisComputings’s USX

  • You can reserve a Flash Read Cache for any individual virtual disk.
  • The Flash Read Cache is created only when a virtual machine is powered on, and it is discarded when a virtual machine is suspended or powered off.
  • When you migrate a virtual machine you have the option to migrate the cache.
  • By default the cache is migrated if the virtual flash module on the source and destination hosts are compatible.
  • If you do not migrate the cache, the cache is rewarmed on the destination host.
  • You can change the size of the cache while a virtual machine is powered on. In this instance, the existing cache is discarded and a new write-through cache is created, which results in a cache warm up period.
  • The advantage of creating a new cache is that the cache size can better match the application’s active data.
  • Flash Read Cache supports write-through or read caching. Write-back or write caching are not supported.
  • Data reads are satisfied from the cache, if present. Data writes are dispatched to the backing storage, such as a SAN or NAS.
  • All data that is read from or written to the backing storage is unconditionally stored in the cache.

DRS supports virtual flash as a resource

DRS manages VM’s with Flash Read Cache reservations, as each host supports one virtual flash resource DRS selects a host that has sufficient available virtual flash capacity to start the VM, if that capacity isn’t available, DRS won’t move the VM. DRS treats powered-on VM’s with Flash Read Cache as soft affined to their current host and only moves them for mandatory reasons or to correct host over-utilization.

Flash Read Cache is also supported by High Availability (HA)

When vSphere HA restarts a virtual machine configured with Flash Read Cache, the VM is restarted on a host in the cluster where  the Flash Read Cache, CPU, Memory and overhead reservations are met. HA won’t restart a VM if unreserved flash is insufficient to meet the virtual flash reservation.

Using Virtual Flash Resource to Configure a Swap Cache

You can use virtual flash resource on an ESXi host to configure a swap cache. The host swap cache is allocated from a portion of the virtual flash resource.

You can create VMFS datastores on Solid State Disks (SSD), and then use these datastores to allocate space for host cache. The host reserves a certain amount of space for swapping to host cache.

The host cache is made up of files on a low-latency disk that ESXi uses as a write back cache for VM swap files. The cache is shared by all virtual machines running on the host. Host-level swapping of virtual machine pages makes the best use of potentially limited SSD space.

Using swap to host cache is not the same as placing regular swap files on SSD-backed datastores. Even if you enable swap to host cache, the host still needs to create regular swap files. However, when you use swap to host cache, the speed of the storage where the host places regular swap files is less important.

The Host Cache Configuration page allows you to view the amount of space on a datastore that a host can use to swap to host cache. Only SSD-backed datastores appear in the list of datastores on the Host Cache Configuration page.

Limitations

Resource Limit
virtual flash volumes per host 1 (local only)
SSD’s per virtual flash volume 8 or fewer
SSD size 4TB or less
virtual flash size 32TB or less

Configuring Virtual Flash Resources

As this is a new feature in vSphere 5.5 you need to use the vSphere Web Client for this work.

You can do this on a per host basis following the below instructions.

image

In the vSphere Web Client, navigate to the host, click the Manage tab and click Settings

image

Under Virtual Flash, select Virtual Flash Resource Management and click Add Capacity

image

From the list of available SSDs, select the drives you want to use for virtual flash and click OK

image

The virtual flash resource is created. You can add up to 8 devices to the cache.

If you have added SSD’s to all your hosts, rather than add the devices individually you can add them all from one screen.

image image

At the cluster level, right click the cluster, choose All vCenter Actions and then Add Virtual Flash Resource Capacity

image

Click the hosts you want to configure and click OK

Configure Host Swap Cache

image

Select Virtual Flash Host Swap Cache Configuration

image

Click Edit

image

Define the size of the Host Swap and click OK

image

Configure Flash Read Cache for a VM

To configure Flash Read Cache for a VM first you need to remember that this is assigned per disk.

image_thumb11

Using the Web Client open the settings for the VM and expand the hard disk, you can see that currently I don’t have anything configured in the read cache.

VMware recommend “Ideally the cache would be large enough to hold the active working set, but not much larger. Configuring a larger-than-necessary cache can reduce performance by making that flash space unavailable for other vFRC-enabled virtual machines or for host swap cache.

Configure vFRC for all required drives and click OK.

Official Documentation

vSphere Storage Guide 5.5

Performance of vSphere Flash Read Cache in VMware vSphere 5.5

Leave a Reply

Your email address will not be published. Required fields are marked *