Thursday, January 16, 2014

Lync Server 2013: Lync Backend SQL Server Licensing

One of the most frequently asked questions is:

How do we license SQL Server as a Lync Backend Solution correctly.

This is not an very easy question.
But first in general the common SQL licensing applies. This is mainly regarding if you license as per CPU or Server. This question will mainly not have an impact regarding Lync based licensing.

Lync Server Enterprise Deployment requires an SQL Server instance. this is fact, as well as several other Lync Server or Components (e.g. pChat or monitoring and Archiving)

We have a few SQL Backend scenarios:

1. Single SQL Server
This solution do not provide an HA feature, either the Server, nor the database.
But it is possible in adding this server deployment into an mirrored solution(3.)
2. Clustered SQL Server (with a single Database)
This provides only HA for the Server themselves, but the Database is not protected.
Well some solution exists, where the storage is in a mirrored relationship and there provide database HA in another tier. But a storage mirror do not protect your database against an logical database issues, since the database it a clone only.
3. Mirrored SQL Server (with two independent databases)
Finally the recommend solution from Microsoft for maximum HA, both the Server as well as the database is protected.
We have two SQL Server configured in a mirrored relation, therefor the server are redundant and protected
The database itself it part of the mirror, which means, the server a replication via log shipping an independent transaction to its mirror, where this server logically replay this into the database. Only if both transactions a successfully committed, the SQL Server will send an acknowledge to its sender.

SQL Server Licensing

Since we have discussed the possible Lync Enterprise SQL configurations, now we need to have a look into the licensing.

Licensing is seperated into Server and CAL.

First the CAL, a CAL is segregated into User Connection or Device Connection. Therefor in Lync user do not directly conntect to SQL server. The entire access is indriect, so via the Lync server or Lync client.
Also indirect SQL server access requires a CAL.
But there is another possibility, if you license the SQL server based on CPU CORES, you do NOT need CALs.
(There is a breakeven between COREs and CALs close to 50 user, where the server core licensing model is more efficient, but it depending on licesing model/ contract)

Now we see what is required. Keep in mind, that it doesn't matter if we now count either sever or core based, but if it is core base you have to muliply the server count by core. E.g. you need 2 server licenses and have 2 core, in total you need 4 SQL licenses which are core based.

Scenario 1:
Only 1x SQL Server license is required

Scenario 2:
In a cluster we are required having assigned 1x SQL Server each, so in sum we need 2x SQL Server Licenses

Scenario 3:
This will become more complicated, therefor i need to separate this into two sub topics:

3.1: The mirrored SQL Server Instance is used for LYNC ONLY
You only need 1x SQL Server license for the left server, the mirrored instance is FREE of charge.

3.2: The mirrored SQL Server Instance is used for LYNC and OTHER Application
You need 1x SQL Server license each, this means 2x SQL Server license in sum.

Other Lync databases:
Now we sitll have a question regarding other instances we could use, e.g. Monitoring or even Archiving, maybe pChat.
All this SQL databases can be hosted by another SQL INSTANCE, therefor exactly the same principles apply.
So if you use another SQL Instance you need additional SQL Server license as per description above.

In smaller installation you can minimize the number of SQL Server license, if you deploy all databases into a single instance and use a dedicated Lync mirror SQL server free of charge. But remember you need to carefully plan your SQL Server perfomance if you deploy all databases.

Last but not least:
I also have pasted the offical Microsoft reference so we are able to validate my writings:

Failover Basics

For each properly licensed instance of SQL Server, customers can run a supporting passive instance in a separate OSE for temporary support—that is, to synchronize with the primary server and otherwise maintain the passive database instance in a warm standby state in order to minimize downtime due to hardware or software failure. A passive SQL Server instance is one that is not serving SQL Server data to clients or running active SQL Server workloads. This passive failover instance can run on a server other than the licensed server.

The secondary server used for failover support does not need to be separately licensed for SQL Server as long as it is truly passive. If it is serving data, such as reports to clients running active SQL Server workloads, or performing any “work” such as additional backups being made from secondary servers, then it must be licensed for SQL Server. 

Primary server licenses include support for one secondary server only, and any additional secondary servers must be licensed for SQL Server.

Note: The rights to run a passive instance of SQL Server for temporary support are not transferable to other licensed servers for purposes of providing multiple passive secondary servers to a single primary server.”

Wednesday, January 8, 2014

OCSLogger parsing problem (Snooper has empty traces)

Several time i ran into the same issue with OCSLogger and Snooper.
If you actually started logging with OCSLogger, you could also verify that bytes were written onto disk, but once you started analyzing the trace, you find the OCSLogger file and the Snooper EMPTY.

So there are some reasons due to OCSLogger is NOT a supported method any longer how we should analyze log's. Better and suggested is the Central Logging Service. This is why we have some issue after we deployed Snooper. (Sounds wirred, is wirred)

But Snooper is still the best and optimal solution identifying issues. So what could this have caused:

1. Your OS is other than EN-US, this means, you have to ensure that your DATE and TIME Format is set to ENGLISH (United States). (While the location is not relevant!)

2. You have applied an Update, e.g. CU 3. In this case your issues is, where files are or arn't correctly replaced.

SOLUTION regarding 2nd issue:

You have to manually copy the default.tmx and default.xml file into your Debugging Tools folder (C:\Program Files\Microsoft Lync Server 2013\Debugging Tools)

Destination Location (default):

Source Location (default):

Navigate to C:\Program Files\Common Files\Microsoft Lync Server 2013\Tracing and cope the default.tmx and default.xml file to the destination location.

Now when you click the Analyze Log Files button in the Lync Server 2013 Logging Tool, the SIPStack messages will be displayed.

While the preferred method of logging in Lync Server 2013 is to utilize the Centralized Logging Service, if you still prefer using the Lync Server 2013 Logging Tool/GUI to configure logging, then make sure to follow the steps above.

Tuesday, January 7, 2014

Lync Server 2013 Forest Prep Issue - Task execution failed (Object reference not set to an instance of an object)

Several times while preparing the AD Forest, we run into an issue during the preparation process. This is mostly with a new installation.

You will receive an preparation failed error regardles if you chose the wizard or the Enable-CsAdForest command.
It failes with:

Prepare Forest Active Directory setting exection failed on an unrecoverable error
Command execution failed: Value cannot be null.
Parameter name: InstanceToDelete

This is an wellknow issue in the installation process.

you must use the PowerShell command
Enable-CsAdForest -GroupDomain <AD Domain FQDN> -GroupDomainController <DC FQDN> -GobalCatalog <GC FQDN>

Lync Schema prep (update) error - The exit code is 5

If you prepare the Schema update for Lync 2010 or 2013, you might encountar an error:

Task execution failed.
The exit code is "5".

This is an error related to missing user rights (permission). The user who executs the Schema Prep
Install-CsAdServerSchema has not member of the Domain Schema Admins.

Thisis often an issue, if you changed the replication on the Schema Master by disabling INBOUND and OUTBOUND replication. Even if you have new assigned the Schema Master, and the Lync Servers Logon Server is now the DC, where the replication was disabled, before you assigend joined the group, it is not replicated.

Enable the replication, than logout and login again, than disable the replication angain

AD commands:
Disable Replication
repadmin /options <schema master DC name> +DISABLE_OUTBOUND_REPL
repadmin /options <schema master DC name> +DISABLE_INBOUND_REPL

Enable Replication
repadmin /options <schema master DC name> -DISABLE_OUTBOUND_REPL
repadmin /options <schema master DC name> -DISABLE_INBOUND_REPL