Windows – Can Hyper-V host join a domain of a virtual machine domain controller on that same host

domainhyper-vwindowswindows-server-2012

Learning about Failover Clustering with Hyper-V. I have two hyper-v nodes(servers). I want to add them to a failover cluster, but it said that the nodes must be in a domain to join failover cluster.

Can I create a domain controller role on a virtual machine hosted on that same node and join that node to the domain?

Can I just create a role on one of the two nodes along with hyper-v role and join the second node to the domain?

Best Answer

Original Answer from 2014:
You can create an AD VM and join the Hyper-V host to it in Server 2012 (or Hyper-V Server 2012, the preferred OS for running a Hyper-V Cluster). This did not work in any previous version of Windows.

This would be a really horrible idea for a production environment, but suitable for a lab/training.

Also, you only need one host/node to form a cluster (though it probably throws errors/warnings if you do)

2016 Update
At one point in time Hyper-V was quite easy to break. One of the many ways was creating a cluster with the Active Directory within the cluster. When the whole cluster was shutdown, Hyper-V's dependency on AD, and AD's dependency on Hyper-V meant it was extremely difficult to coax back to life. Fortunately that is no longer the case.

Today you should still be using Hyper-V Server (whatever the latest version) to build clusters. It's a stripped down version of Windows with only the essential components to build the cluster, minimizing security and maintenance exposure. But there's little reason to have physical servers at all. The aforementioned cluster dependency has been removed.

The only thing to be careful of, time synchronization. Time Sync still has a circular dependency by default, which can lead to massive clock drift. Time Synch should either be disabled in Hyper-V for Active Directory machines; or the Hyper-V Hosts should be configured to synchronize time with external servers directly.