Skip navigation
VM Groups in Windows Server 2016 Hyper-V

VM Groups in Windows Server 2016 Hyper-V

Q. What are VM Groups in Windows Server 2016?

A. VM Groups provide a new way to manage VMs by grouping VMs together that need actions performed on together. There are two types of group:

  • VM Collection Group - A collection of VMs
  • Management Collection Group - A collection of VM Collection Groups and/or other Management Collection Groups

VM Groups must be used when backing up VHD Sets (Shared VHDX) or replicating them with Hyper-V Replica as it enables the necessary orchestration between multiple VMs when performing actions on shared VHDX files. They also provide easy management of multiple VMs when using VM Collection Groups. Below is some example PowerShell to create and use the groups.

#Create new VM Collection Groups
New-VMGroup -Name VMCGroup1 -GroupType VMCollectionType
New-VMGroup -Name VMCGroup2 -GroupType VMCollectionType
New-VMGroup -Name VMCGroup3 -GroupType VMCollectionType

#Add VMs to the VM Collection Groups
Add-VMGroupMember -VMGroup (Get-VMGroup VMCGroup1) -VM (Get-VM VM1)
Add-VMGroupMember -VMGroup (Get-VMGroup VMCGroup2) -VM (Get-VM VM2)
Add-VMGroupMember -VMGroup (Get-VMGroup VMCGroup2) -VM (Get-VM VM3)
Add-VMGroupMember -VMGroup (Get-VMGroup VMCGroup3) -VM (Get-VM VM4)

#View the membership of the groups
Get-VM | ft Name, Groups -AutoSize
Get-VMGroup -Name VMCGroup2

#Perform actions on the group as if it were a VM
#Enable-VMReplication -VM (Get-VMGroup VMCGroup2).VMMembers ......
Start-VM -VM (Get-VMGroup VMCGroup2).VMMembers

#Create VM Management Group with VMCGroup2 and VMCGroup3 in it
New-VMGroup -Name MgmtGroup1 -GroupType ManagementCollectionType
Add-VMGroupMember -VMGroup (Get-VMGroup MgmtGroup1) -VMGroupMember (Get-VMGroup VMCGroup2)
Add-VMGroupMember -VMGroup (Get-VMGroup MgmtGroup1) -VMGroupMember (Get-VMGroup VMCGroup3)

#Create VM Management Group with VMCGroup1 and MgmtGroup1 to show nesting
New-VMGroup -Name MgmtGroup2 -GroupType ManagementCollectionType
Add-VMGroupMember -VMGroup (Get-VMGroup MgmtGroup2) -VMGroupMember (Get-VMGroup VMCGroup1)
Add-VMGroupMember -VMGroup (Get-VMGroup MgmtGroup2) -VMGroupMember (Get-VMGroup MgmtGroup1)

Get-VMGroup MgmtGroup2 | Select-Object -ExpandProperty VMGroupMembers

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish