Reference Guide

Virtual Machines
This chapter presents the following topics:
Topics:
Introduction
VM and storage affinity rules
Preferred sites
Introduction
Virtual Machines in a stretched cluster environment can be managed using:
PowerShell
Failover Cluster Manager
Windows Admin Center
For more information, see Manage VMs on Azure Stack HCI using Windows Admin Center.
In a stretched cluster environment, volumes hosting the virtual machines may or may not be replicated, depending on business
requirements. A VM that is hosted on a replicated volume runs on the site where the volume is mounted. If the volume moves
from the primary site to the secondary site due to a planned downtime or site failure, the VMs follow the volumes to the
secondary site after 10 minutes while the cluster service balances the VMs across the nodes on the secondary site after 30
minutes. To enable faster movement of VMs after the Virtual Disk ownership is transferred to the secondary site, you can
initiate Live Migration manually.
VM and storage affinity rules
You can use PowerShell to create affinity and anti-affinity rules for your VMs in a cluster. An affinity rule is one that establishes
a relationship between two or more resource groups or roles, such as VMs, to keep them together in an Azure Stack HCI
cluster. An anti-affinity rule does the opposite, keeping specified resource groups apart from each other.
You can use storage affinity rules to keep a VM and its associated Virtual Hard Disk v2 (VHDX) on a Cluster Shared Volume
(CSV) on the same cluster node. This ensures CSV redirection does not occur and keeps application performance at optimal
levels. For more information, see Storage affinity rules.
Preferred sites
Configure preferred sites in a stretched cluster to define a location in which you want to run all your resources. This ensures
that VMs and volumes come up on the preferred site after a cold start or after network connectivity issues. A dynamic quorum
ensures that preferred sites survive after events such as asymmetric network connectivity failures.
In the event of a quorum split, if witnesses cannot be contacted, the preferred site is selected and the passive site drops out of
the cluster membership.
VMs in a stretched cluster are placed based on the following site priority:
Storage Affinity Site
Group Preferred Site
Cluster Preferred Site
Host VMs and associated Virtual Disks
VM placement can be difficult in a Hyper-V clustered environment. Always ensure that VMs that have I/O-intensive workloads
are hosted on the node that owns the VM's Virtual Disk.
5
18 Virtual Machines