In the past I’ve seen a lot of problems around virtual domain controllers. This varies from time synchronization problems to orphaned domain controllers (which were restored/ reverted from a snapshot). In a lot of cases the administrators of the virtual infrastructure does not understand what happened when a domain controller is restored from a snapshot.
Beside the problems I’ve seen I’ve also seen a lot of succesfull implementations of virtual Domain Controllers. These Domain Controllers were configured according a set of best practices. In the past we need to be aware that we cann’t snapshot a virtual Domain Controller and that we cann’t clone a virtual Domain Controller. This means that we apply traditional backup’s of these virtual machines (with an agent inside the virtual machine) and the we always install Domain Controllers from scratch instead of cloning an existing one.
Well this all belongs to the past with the comming new version of Windows Server: Windows Server 2012! With Windows Server 2012 we can build, deploy and protect domain controllers like every other virtual machine. Guess what: The Active Directory role in Windows Server 2012 is virtualization aware.
Let’s first go back to the problems around snapshotting a domain controller. Active Directory uses USN’s (Update Sequence Numbers) together with the invocation IDs to track updates that must be replicated between replication partners in an Active Directory forest. By using USN’s and invocation IDs Domain Controllers know what changes they must send tot other Domain Controllers and what changes they must receive from other Domain Controllers. By using this technique the Active Directory database stays up to date and consistent.
When a backup of an Active Directory Database is restored (which occurs when applying a snapshot) a so called USN rollback took place. When a USN rollback occurs, modifications to Active Directory objects and attributes that occur on one domain controller do not replicate to other domain controllers in the forest. Because replication partners believe that they have an up-to-date copy of the Active Directory database. So this can lead to:
- lingering AD objects
- inconsistent passwords
- inconsistent attribute values
- schema mismatches if the Schema FSMO is rolled back
- and so on…
With Windows Server 2012 domain controllers which are virtualized this belongs to the past. As I said before The Active Directory role in Windows Server 2012 is virtualization aware. Domain Controllers detect when snapshots are applied or when a virtual machine is copied. This change will be detected by the change of the so called ‘VM-generation ID’. The VM-generation ID is changed when a virtual machine is copied or a snapshot is applied.
The VM-Generation ID is provided by the hypervisor platform. It’s a unique 128-bit identifier. This VM-Generation ID is made available to applications through a Windows Server 2012 driver. Domain Controllers will store the VM-Generation ID as a non-replicated attribute in the Active Directory database. Before a Domain Controller will commit changes to the Active Directory database it will compare the VM-Generation ID in the Active Directory Database against the real-time VM-Generation ID which is provided by the Windows Server 2012 driver. If the the ID’s are different then Active Directory will reset the Domain Controller invocation ID and invalidates the RID pool.
The following picture from a TechEd Europe presentation about Active Directory in Windows Server 2012 shows exactly what happens:
[image not preserved in the archive]
This is a great new feature isn’t it? For now only Hyper-V in Windows Server 2012 support the VM-Generation ID but VMware announced that the next version of vSphere also will support this feature.