Friday 27 August 2010

SnapManager and VSS

Found an aperiodic problem with VSS snapshots when running NetApp SnapManager for Exchange. Suspect this is probably an issue with VSS itself; there's a patch (http://support.microsoft.com/kb/833167) which sounds like a good candidate. But I want to figure out how frequently we have this issue.
Searching NetApp SnapManager logs for the start and end of the VSS snapshot process during a SnapManager backup should tell me whether VSS times out regularly. Using findstr for the messages at the start and end of the VSS process failed; looking at the logs I realised they are Unicode formatted. Having been through this before I know I can use 'type' to convert from Unicode to utf-8/ascii (?) on the fly. This means I can't use "findstr {string} *.txt", so we need to run "type filename|findstr {string}" instead. Since I'm searching for strings from both the start and end of the SnapManager process, I specify /c:"{start-string}" /c:"{end-string"}. This needs wrapping inside a for loop to make itself useful. The problem then becomes the preponderance of spaces breaking for's processing, so I use the 'delims' option to use a non-existent character as the delimiter. This means that every filename, no matter how many spaces (or other weird characters) exist in their paths, are treated as a single entity. Here we go:

>for /f "delims=!" %a in ('dir /s /b *.txt') do (type "%a" | findstr /c:"Snapshot set created" /c:"Starting asynchronous DoSnapshotSet") >> "%temp%"\snapshot_timings.txt

 notepad "%temp%"\snapshot_timings.txt

+--------------------------+
[20:00:22.738]  Starting asynchronous DoSnapshotSet. Please wait...
[20:00:28.769]  Snapshot set created
[20:00:24.822]  Starting asynchronous DoSnapshotSet. Please wait...
[20:00:31.854]  Snapshot set created
[20:00:23.947]  Starting asynchronous DoSnapshotSet. Please wait...
+--------------------------+
 
That does the job. Now all I need to do is some scriptage to work out the distance between "starting" and "created", and averages but I need to get this done + on to the next thing so I'll use Excel for the moment...