Today I had very nice day together with my good colleague Rune, which is taking care of a big Lync 2013 environment at one of our customers.
We were making some changes of the frontend servers, which require that we should run the Enable-CScomputer.
However, that failed on two of the three frontend servers with this error:
Alter failed for Server ‘LYNCSERVERlynclocal’
Very strange, this has not been a problem before. So digging down in the error report show this error:
So the problem is “The affinity mask specified does not match the CPU mask on this system”.
Because this happen when lync is doing something in the SQL database, we looked at the SQL Server, and how many CPU that was assigned to SQL.
This is done with Query Analyzer in the SQL Management Studio with these commands:
sp_configure
‘show advanced options’, 1;
RECONFIGURE;
GO
And then again
sp_configure
The output showen was this:
However, this server has only 2 cpu’s assigned.
So the problem is that the SQL Server is configured to have 4 cpu’s, but failes because it only have two.
So to fix the problem we ran these commands (again in the Query Analyzer)
sp_configure ‘affinity mask’, 2;
RECONFIGURE;
GO
After that we restarted the SQL Server for that instance and bingo enable-cscomputer worked again.
The reason for this error is caused by, that when the server was original created, it was created to have 4 cpu’s. This was later on changed to only 2, but SQL don’t automatically change the affinity.
Great post Joachim, but be aware that an affinityMask setting of 0x2 on a given thread means that only processor number 2 is a valid choice.
If you have 2 CPU’s and want to utilize both, set the affinityMask to 0x3, as described here: http://msdn.microsoft.com/en-us/library/system.diagnostics.processthread.processoraffinity.aspx
Hi Mathias
Thanks for the correction – it’s really appreciated.
Br. Joachim
It’s the SQL Express version that’s installed with Lync which is restricted to a single CPU license. You cannot set the affinity mask to use two or more CPU’s (only in the regular SQL Server version).
“1 Physical” CPU that is
That makes sense, the last line should have read: “If you have 2 processor cores and want to utilize both”, not physical CPUs
Great post, thanks. Fixed the issue straight up for me!