perhaps if you previously had replication enabled and broke the replica but now
want to enable it again. An efficient bit-by-bit comparison will be performed
between the primary and replica to ensure consistency.
The initial replication can be configured to begin immediately or at a later time, such
as outside normal business hours when contention on the network resources would
be less. Depending on the choices made, the virtual machine would be created on the
replica Hyper-V server in the off state, and the initial replication would begin. Once
complete, at the replica time interval, the Hyper-V Replica log (HRL) file is closed,
sent to the replica, and merged into the replica VHD. The entire time the replica
virtual machine is turned off. No memory, processor, or device state is replicated to
the replica virtual machine; only disk content is replicated. In the event that the
replica is activated, it will be turned on and booted, similar to a crash-consistent state
as if it previously had just been powered down without a clean shutdown. This is one
of the reasons that performing the periodic VSS snapshot recovery point is useful to
ensure disk integrity.
To view the exact replication configuration of a virtual machine once the configuration
has been performed, view the settings of the virtual machine. The Replication tab
shows all of the details of the Hyper-V Replica configuration, including the replica
interval and authentication and recovery-point configuration.
You can also enable replication using PowerShell with the Enable-VMReplication
cmdlet. The only parameters to enable replication are to specify VMName for the virtual
machine to be replicated, to specify the replica server using ReplicaServerName and
ReplicaServerPort, and to specify the authentication type using AuthenticationType.
Once replication is enabled, you need to start the initial replication using Start-
VMInitialReplication.
Once the replica virtual machine is created, it is now a separate virtual machine from
the primary virtual machine. Any changes in configuration to the primary virtual
machine are not reflected in the replica virtual machine. This allows changes to be
made on either side, and the replication of the VHD content will continue. Still, if
changes are made to the primary source, such as increasing resources like memory or
processor, you will need to reflect that change manually on the replica.
The fact that the virtual machine on the primary and on the replica are separate
virtual machines in terms of configuration enables some nice functionality. In most
environments, the primary and secondary datacenters use different IP networks,
which means that when a virtual machine is started in the disaster-recovery site, it
needs a new IP address. As part of the Hyper-V Replica functionality, an additional
configuration is available on the virtual machine once replication has been enabled,
namely, a failover TCP/IP configuration (found under the Network Adapter
configuration of the virtual machine). This allows an alternate IPv4 and IPv6
configuration to be specified on each virtual network adapter for the replica virtual
machine, which is injected into the virtual machine in the event of a failover, as
shown in Figure 8.3.