Hyper-V host only accept the VMs I define

Andre Henrique Fonseca 0 Reputation points
2023-02-08T08:29:26.93+00:00
I have a Hyper-V Cluster with 5 nodes, and approximately 100 virtual machines.
I would like to fix 10 of these virtual machines on a specific host.
Example: Node1 accept only VMs (VM10, VM11...up to VM20). If any of the other nodes fail, Node1 must not accept migration of any VM, only the selected virtual machines must remain on it
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,814 questions
Windows Server Clustering
Windows Server Clustering
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Clustering: The grouping of multiple servers in a way that allows them to appear to be a single unit to client computers on a network. Clustering is a means of increasing network capacity, providing live backup in case one of the servers fails, and improving data security.
1,025 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Limitless Technology 44,526 Reputation points
    2023-02-08T14:56:34.5866667+00:00

    Hello there,

    You can try the load balancing to achieve this.

    Enabled by default in Azure Stack HCI, Windows Server 2019, and Windows Server 2016, VM load balancing is a feature that allows you to optimize server utilization in your clusters. It identifies over-committed servers and live migrates VMs from those servers to under-committed servers. Failure policies such as anti-affinity, fault domains (sites), and possible owners are honored.

    https://learn.microsoft.com/en-us/azure-stack/hci/manage/vm-load-balancing

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments

  3. Eric Siron 1,566 Reputation points MVP
    2023-02-08T16:45:23.8866667+00:00

    You don't set that on the host. You set it on each VM.

    In Failover Cluster Manager:

    1. Highlight a VM.
    2. At the very bottom of the lower pane, click to the Resources tab. It starts on the Summary tab.
    3. The Resources tab shows at least a Virtual Machine item. Right-click on that and click Properties.
    4. In the Virtual Machine Properties window, switch to the Advanced Policies tab.
    5. In the upper part of the dialog box, you will find a list box of checked items called Possible Owners. Unselect the hosts that you want to prevent from hosting the VM.
    6. Repeat 1-5 for all other VMs.

    PowerShell can be kind of a pain because there isn't a wonderful bridge between the VM objects and their cluster resources. But once, you figure it out, it's a lot faster and less obnoxious than dipping in and out of the GUI a bunch of times.

    First, discover the names of your virtual machine resources:

    Get-ClusterResource
    

    That will list every resource on your cluster. While it's possible to rename them, it's unlikely that anyone has done that. So, your virtual machine resources will almost certainly look like this: "Virtual Machine VM1".

    Then you can set possible owners like this:

    Set-ClusterResource -Resource 'Virtual Machine VM1' -Owners 'NODE1'
    

    and on the others like this:

    Set-ClusterResource -Resource 'Virtual Machine VM30' -Owners 'NODE2', 'NODE2', 'NODE3'
    

    You can batch them with something like this:

    1..10 | % { Set-ClusterResource -Resource "Virtual Machine VM$_" -Owners 'NODE1' }
    

    There are any number of ways to filter names and pass them via the pipeline.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.