Grouping Hyper-V VMs for Veeam jobs
Some of you may know me many years and know that I started with VMware Virtualization back in 2006 and not get warm with Hyper-V. Actually I worked on an opportunity related to Hyper-V and I stumbled over a dialog box option in Veeam Backup & Replication when adding virtual machines to a backup job and wondered what are VM Groups and how can I create them because I didn’t seen them in Hyper-V Manager.
But how can I create VM Groups?
VM Groups are a helper solution for management of VMs, e.g. if we need to group VMs for a Hyper-V operation. In Veeam Backup & Replication we are also able to use this VM groups to group virtual machines what seems to be a solution to create a structure in Hyper-V (maybe also apply to clusters?). This was before a big backdrew of Hyper-V compared to VMware.
First of all we need to create a new VMGroup, which is called “testserver” in my lab.
$testserver = New-VMGroup testserver -GroupType VMCollectionType
Next we need to get the VM objects. We added this two VM objects to variables and added this variables to the previously created VMGroup.
$hvm01 = get-vm -Name "lab-hvm01" $hvm02 = get-vm -Name "lab-hvm02" Add-VMGroupMember -Name testserver -VM $hvm01,$hvm02
If we don’t need a deeper structure we are finished now. But we want to have an option to build a tree structure. In our case we created another VM Group which has a slightly other configuration. This VM Group is another GroupType called “ManagementCollectionType”. With this type we are able to create a tree structure and add other VM Groups with the GroupType “VMCollectionType” to this VM Group.
$root = New-VMGroup root-group -GroupType ManagementCollectionType Add-VMGroupMember -Name root-group -VMGroupMember $testserver
We can select either one of the testserver groups or even the root-group and all VMs below the selected VM group will be backuped. If we need to remove a VM group, we need to first remove all member objects and after this we can remove the group itself.
We are also able to add the same VM multiple times to different VM Groups. In my opinion the usablilty of this VM Groups is a little bit like the Tags used at VMware. It cannot be compared to the folders in Vmware because one VM can only be in one folder.
Even restore delegation is possible :)
And even in Veeam Backup Enterprise Manager we can use this VM Groups to delegate restores to specific users or groups.
Veeam is also able to use tags from System Center Virtual Machine Manager (SCVMM), but the most customers doesn’t add it to Veeam Backup and Replication because of performance reasons. All call done via SCVMM takes more time than talking directly to Hyper-V. Thats why this VM Groups solution is in my opinion a good option to work without SCVMM.
If somebody of you see a solution how to manage this VM groups by GUI please give me feedback. I will try to build something, but not sure if I get it done. ;-)
Where do you run these commands? On the Veeam Server?
On the Hyper-V Node