A student in a VMware Optimize & Scale class a few weeks ago called my attention to a part in the vcenter-esxi troubleshooting document I wasn’t aware of before:

“The following scenarios can cause Storage DRS to be disabled on a virtual disk.

A virtual machine’s swap file is host-local (the swap file is stored in a specified datastore that is on the host). The swap file cannot be relocated and Storage DRS is disabled for the swap file disk.

A certain location is specified for a virtual machine’s .vmx swap file. The swap file cannot be relocated and Storage DRS is disabled on the .vmxswap file disk.”

Having local virtual machine swap files can optimize the ROI of your vSphere environment by storing the swap files on “cheaper” local storage instead in the “more expensive” SAN.

The question now occured if we can use storage DRS (the pretty cool new feature since vSphere 5.0) with local ESXi host files. My feeling told me that there’s no reason why sDRS shouldn’t work local swap-files (during svMotion the VMs keeps running on the same host and I have no possible explanation why sDRS should migrate the VM-swap files away to another Datastore) and thanks to Frank Denneman response here my feeling was approved.

The smallest entity which sDRS reallocates is the so called DRMDisk, which is the working directory (with it’s vmx, swap & co. files) and the vmdk files (for each virtual hard disk). Locating the swap files in an alternative location leads to a reduction of the working directory, but has no influence on the sDRS-balancing.

Since I couldn’t find any information on the Internet   I made a quick test in our lab environment.

Short summary of the lab setup:

  • vSphere 5.1
  • 4x ESXi hosts in a HA/DRS Cluster
  • 1x Datastore cluster consisting out of 2x 2TB Datastores (datastore00 + datastore01)

To configure the swap file location in a cluster you first need to change the cluster setting to “Stores the virtual machine swap file at the default location defined by the host or cluster swap file settings.”

Afterwards you change the swap file location on each esxi host to its corresponding local Datastore (Hosts & Clusters -> ESXi -> Configuration -> Software -> Virtual Machine Swap File Location )

After this I created two virtual machines with 4 gbyte RAM and 1x ca. 800 gbyte thick provisioned disk file.

After powering on those machines the virtual machine swap files get created at the configured local datastore with size of the configured RAM (4 gbyte)

1 swpfiles 300x116 Storage DRS With Local Swap File Location DOES Work

Afterwards I made a svMotion of all VMs to datastore00 (usage of datastore00 > 80%), so that storage DRS will hopefully get forced to rebalance the VMs on those two datastores.

2 swpfiles ds00 300x252 Storage DRS With Local Swap File Location DOES Work

Regarding the vmware troubleshooting paper, sDRS should NOT work in this constellation, but nevertheless sDRS did its job properly since it only migrates the files of the VM working directory and didn’t touch the local VM swap files.

4 swpfiles ds00 300x233 Storage DRS With Local Swap File Location DOES Work

As I have expected sDRS tried to separate the largest 800gbyte VMs from each other, but I was really confused about the way sDRS achieved it. Instead of migrating sDRS-test1 from datastore00 to datastore01, sDRS migrated all other machines away from datastore00, which resulted in 6 (much more stressful) concurrent svMotions (*yeah a cool new feature in vSphere 5.1*) instead of 1 migration which would have lead to a pretty similiar result. (This seems to be an effect worth to be investigated by future-Fabi icon wink Storage DRS With Local Swap File Location DOES Work )

Nevertheless this short test showed that storage DRS will work pretty well, even though it is using local VM-swap files. Using local Swap files has been discussed very often in several other blogs, just beware of certain design considerations and its consequences (http://frankdenneman.nl/drs/impact-of-host-local-vm-swap-on-ha-and-drs/)

Sources and Links

 

//UPDATE

It seem’s like I should have finished my blog entry before my vacations since this topic was already been explained at Frank Denneman’s Blog

(http://frankdenneman.nl/sdrs/storage-drs-and-alternative-swap-file-locations/)

Please check it out, it is brilliant explained as usual.