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:
‘show advanced options’, 1;
And then again
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;
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.