Upgrade to VMM 2016 or VMM 2012 R2 fails if AlwaysOn Availability Groups is enabled

Applies to: Windows Server 2016Microsoft System Center 2012 R2 Virtual Machine Manager


When you try to upgrade to Virtual Machine Manager 2016, the attempt may fail if the VMM database is using a Microsoft SQL Server database that leverages the AlwaysOn Availability Groups feature. In this situation, the following error is returned:

10:16:43:InnerException.Type: System.Data.SqlClient.SqlException, InnerException.Message: The operation cannot be performed on database "VirtualManagerDB" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group.


This issue occurs because VMM can't complete the necessary changes to the VMM database while it's configured to use the AlwaysOn Availability Groups feature.


Before you upgrade VMM, use the SQL Server Management Studio tool to remove the VMM database from the availability group.

After the upgrade is finished, complete the configuration of AlwaysOn Availability Groups for the database:
  1. Add the VMM database to the availability group. You can use SQL Server Management Studio to perform this task.
  2. On the secondary node computer in the cluster that's running SQL Server, create a new sign-in account:
    • Configure the sign-in name so that it's identical to the VMM service account name.
    • Include user mapping to the VMM database.
    • Configure the database owner credentials.
  3. Initiate a failover to the secondary node computer that's running SQL Server, and verify that you can restart the VMM service (scvmmservice).
  4. Repeat steps 2–3 for every secondary node in the cluster that's running SQL Server.
  5. If this is a high availability VMM setup, continue to install other high availability VMM nodes.
For more information about the steps to complete before and after you upgrade VMM, see the following TechNet resources:

Tasks to perform before beginning the VMM upgrade

Performing post-upgrade tasks in VMM