Windows 2012 Failover Cluster: VM Priorities in Hyper-V Failover Cluster

VM Priorities in Hyper-V Failover Cluster With Windows 2012 Failover cluster we have now option to “Drain Roles”, in which all VMs on the host gets migrated to other nodes and the drained host gets paused. This is the same logic as with “Start Maintenance mode” in SCVMM.

When the node gets drained, one important attribute/property in the cluster “Priority” plays an important role on how VMs get migrated. Lets go over the Priority in Failover Cluster Resources…

To Drain Roles in Failover Cluster MMC:

Drain Roles

 

Lets talk about the priorities first. Each VM has its own priority property. These are: 

  • High: 3000      – Started first         – Default is to Live Migrate
  • Medium: 2000 – Started second    – Default is to Live Migrate
  • Low: 1000       – Started third        – Default is to Quick Migrate

    These define the order VMs should start and also how VMs be moved when the node is drained, quick or live migration. So be careful while playing with this setting.

Priority Property in Failover Cluster for a VM in Failover Cluster MMC:

Priority Property in Failover Cluster for a VM in Failover Cluster MMC:

Priority Property in Failover Cluster for a VM in SCVMM 2012 SP1 (VM > Properties):

Priority Property in Failover Cluster for a VM in SCVMM 2012 SP1 (VM > Properties):


  1. First, it is clear that Higher priority VMs get started prior than medium and so forth.
  2. Second, by default, when a node is drained, 
             High Priority VM: Live Migrated
             Medium Priority VM: Live Migrated
             Low Priority VM: QUICK Migrated
    Before we go further, no, you cannot add new priorities 🙂 You need to use existing High Medium and Low settings.

      Changing Priority With PowerShell:

      The Priority can be listed by running

      get-clustergroup VMName | FL *

      #the property is called Priority

      get-clustergroup

      To set it to 1000, 2000, or 3000:

      (Get-ClusterGroup VMName).Priority = 1000

      #the cluster MMC will update immediately

      image

      As I said, if you try to set it to some other value, you will get the error below “the parameter is incorrect”

      the parameter is incorrect

    To change the default behavior of Priority:

     

    1. Global:

    There is a global threshold value called MoveTypeThreshold, which is a Private property with default value 2000. Its meaning is that for VMs having priority 2000+, Live Migration will be used.

    You can get this property by running:

    Get-ClusterResourceType "Virtual Machine" | Get-ClusterParameter MoveTypeThreshold | fl *

    MoveTypeThreshold

    For example, if for some reasons you want all VMs to quick migrated, set it to 3001 or higher.

    To set this property:

    Get-ClusterResourceType "Virtual Machine" | Set-ClusterParameter MoveTypeThreshold 1000

     

    2. Per VM

    Each Virtual Machine resource has a DefaultMoveType property: Default is –1 (4294967295 with powershell), which means VM does not have default and will inherit settings from golbal setting above from Virtual Machine Resource Type.

    To override the defaults:

    • -1 (4294967295): Use global
    • 0: Turn off
    • 1: Quick migrate
    • 2: Shut down
    • 3: Shut down
    • 4: Live migrate

    Get-ClusterResource | ?{$_.resourcetype -eq "Virtual Machine"}
    #to get all Virtual Machine Resources for their names in cluster

    Virtual Machine Resource Type

     

    Get-ClusterResource "Virtual Machine testsharediso" | Get-ClusterParameter | ft Name,Value

    #get cluster resource after passing the name found in the first powershell

    DefaultMoveType

    Get-ClusterResource "Virtual Machine testsharediso" | Set-ClusterParameter DefaultMoveType 1

    #set defaultmovetype

    Bulent Tolu

    Bulent Tolu

    Sr. Systems Engineer at VMware
    Bulent is an IT professional with Master's in MIS and 10-years of experience in broad range of Information Technologies. He is exposed to engineering/architecting, implementation/integration, and administration of various high-available IT systems and infrastructure. He has a passion to continually research, test and evaluate new technologies and follow industry best practices to secure and optimize IT systems. Currently, he lives in Istanbul and works as a Sr. Systems Engineer at VMware.
    Bulent Tolu

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Post Navigation

    Share
    Translate »