Configuring VirtuCache for a VMware Stretched Cluster
This section only applies if you are interested in configuring ‘Write-back One Replica’ or ‘Write-back Two Replicas’ caching policy in VirtuCache. Ignore this section if you plan to deploy VirtuCache in Write-through mode only.
In Write-back mode, it might be prudent to restrict the mirrored copy of the write cache (write replica) to hosts in the same site/datacenter and not have the write replica traverse the WAN link that connects the two sets of hosts in the stretched cluster. Network latencies of the WAN link will be higher than latencies in the local site specific storage and IP network, as a result, storage write latencies with VirtuCache will be higher if write replication happens over the slower WAN link.
To ensure that write replication for hosts in the same site is restricted to hosts in that site in a stretched cluster, please follow the below steps. This configuration can be done using the CLI only and not the VirtuCache GUI:
1. First of all, VirtuCache needs to be installed on all hosts in the stretched cluster in both sites.
2. After you install VirtuCache driver and license vibs on each host, login to any host in the cluster using ESXi CLI, and then run command vnxcli
Typing help at vnx> CLI will give you list of commands.
3. This command is to be used only if you plan to use in-host SSD for caching, either exclusively or along with some amount of host memory. If you plan use host memory exclusively (without a SSD), then skip this step and goto step 5 below.
Type command list-ssd
Now note the VMware device id of the SSD that you want to use as cache device for that host.
4. Type command set-cache-dev in the below fashion.
So for instance, for all hosts in a stretched cluster that are in the same site, you could type the below command on each host:
Repeat this step for each host in the same site in that stretched cluster.
By doing this you have just created a VirtuCache cluster (different from the VMware cluster) called ‘cluster1’ that, for only the purposes of write cache replication, will contain all hosts from the same site. When you assign the name ‘cluster1’ at the time of assigning the SSD in VirtuCache, it tells VirtuCache to keep all write replicas on hosts in the same VirtuCache cluster.
Similarly for all hosts in the same stretched cluster that are in the second site, you could type the below command on each host:
So now you have created a VirtuCache cluster called ‘cluster2’ at the second site, and so all write replicas for hosts in the second site will be restricted to hosts in the same site only.
5. If you plan to use host memory for caching either exclusively or in addition to host SSD, then you would need to follow step 4 above, only using the below listed memory caching command in vnx> CLI, either in addition to (when both memory and SSD are used for caching on the same host) or instead of (when only memory is used for caching) the set-cache-dev command.
By default, all hosts running VirtuCache use the default VMware cluster name and so usually a cluster name doesn’t need to be created explicitly in VirtuCache. However in the case of a stretched cluster and only for write back caching, you do need to create two cluster names in VirtuCache separate from the VMware cluster name, one for each site in the stretched cluster.
By assigning the two sets of hosts in each site of a single VMware stretched cluster to a separate VirtuCache cluster, you have made sure that write replication happens over the local site specific IP network only (and not the WAN connecting the two sites) and so you will now see lower write latencies with VirtuCache.