Disable Spotlight on an Xsan volume

07 Jul 2022
We have been seeing spotlight processes (mds, mds_stores, mdworker_shared, etc) using a lot of CPU on some of our MDCs.  By itself this isn’t a problem, but we have been dealing with some thermal issues in a couple of small server rooms.  While the benefits of spotlight are nice, it isn’t worth the extra heat in this case.
We tried disabling spotlight with mdutil, but it wouldn’t apply.  Thankfully, the Xsan volume config files can control spotlight for each volume.
To modify this setting we do need to stop the volume, so plan a time when that won’t be a problem.  The process is:

Stop the volume

Ideally we will use sudo xsanctl stopVolume <volume name>.  This seems to tell clients to cleanly unmount the volume.  However, we have also seen xsanctl say it can’t stop the volume.  In those cases, we can use cvadmin.
sudo cvadmin -F <volume name> -e "clientunmount 1" will try to tell clients to unmount the volume cleanly.  This will also fail sometimes.
sudo cvadmin -F <volume name> -e "clientunmount hard 1 1" will force the clients to unmount the volume.  Frequently the clients will need to be restarted to remount the volume after the change.
Then sudo cvamdin -e "stop <volume name>" will stop it.

Edit the volume configuration

On an MDC, edit /Library/Preferences/Xsan/<volume name>.cfgp
Find the 2 lines 
Change true to false
Save your changes

Push the change to ldap

To make sure the other MDC and the clients know about the change, run
sudo xsanctl pushConfigUpdate
This will take the configuration from the files on this MDC and push them into ldap for the other systems to read.

Start the volume

sudo xsanctl startVolume <volumeName>

Eric Hemmeter