Hyper-v
Under Full Windows OS
This section is about
running hyper-v UNDER FULL GUI WINDOWS OS not the GUI-less hyper-v Server under Windows core.
How much RAM is available for VMs?
In a windows host with hyper-v having 16 GB RAM total the Windows OS uses 2 GB and another 2 to 2.5 GB are reserved (it is called the "host reserve" maybe for caching).
The host reserve increases as your total RAM increases (it goes to 3 for 64GB and 4 for 128GB, for more see
http://www.aidanfinn.com/?p=19043)
To see exactly how much RAM is available check this link:
https://support.microsoft.com/en-us/help/2962295/virtual-machine-that-s-running-on-windows-server-2012-r2-doesn-t-start
Hyper-v Server (Under Windows Core)
This section is about the
stand alone / GUI-less hypervisor running on
Windows Core.
See
WindowsCore
Hyper-v in general
Operation: planed failover from one hyperv to the other
Before you begin
Shutdown the VM
Make sure replication is complete
Make sure virtual network card is connected at the standby hyper-v

On the source Hyperv (where the VM runs at the moment)

IF you see Planned Failover, click it

IF instead you see Resume Replication, then click it and then retry for Planned Failover

On the other hyperv (where you want to move the VM to)
Issue: VM is not stoping / not shuting down (stuck at stoping or shutting down)
$VMName = "users"
$VMGUID = (Get-VM $VMName).ID
if ($VMGUID) {
$VMWMProc = (Get-WmiObject Win32_Process | ? {$_.Name -match 'VMWP' -and $_.CommandLine -match $VMGUID})
if ($VMWMProc) {
Stop-Process ($VMWMProc.ProcessId) –Force
} else {through "can't get pid from VMGUID"}
} else {through "No such VM"}
Issue: Hyper-V could not replicate changes for virtual machine as replication is suspended on the Replica server (Event ID 32088)
Replication cannot simply be started by right clicking on the source VM and selecting Resume Replication. No console error message just the event log event 32088. It usually happens if you runn out of disk space on the Replica host server.
1. Go to the
destination replica server, right click VM and select Resume Replication.
2. Now you can go to the
source server, right click VM and select Resume Replication.
Force Hyper-V Replication to use dedicated network interface.
On each Hyper-V host that they are part of the replica you must edit the
C:\Windows\System32\drivers\etc\hosts file:
add the IP address of the specific Network Interface that you want to use and
FQDN (not just the computer name) for the other host. E.g:
- 16.27.12 <other-host>.DOMAIN.COM
Test by pinging <other-host>.DOMAIN.COM
Configuring Hyper-V Replica in a workgroup environment
– Part1
https://michaelfirsov.wordpress.com/hyper-v-replica-in-windows-server-2016-configuring-certificate-based-authentication-part1/
– Part2
https://michaelfirsov.wordpress.com/windows-server-2016-configuring-hyper-v-replica-in-a-workgroup-environment-part2/
Other powershell commands
Optimize-VHD
Optimizes the allocation of space used by virtual hard disk files, except for fixed virtual hard disks.
Troubleshooting flashing verifying configuration when enabling replication:
cmdkey.exe /add:REPLICASERVERHOSTNAME
/user:REPLICASERVERHOSTNAME\Administrator /pass:PASSWORD