Manage multiple VMM Library servers

VMM Library is the repository where are stored ISO, VHDX, answer files etc. This library is used by VMM to mount the ISO in a virtual machine, to deploy VM from VHDX or many others utilization. We will see in this topic how to manage multiple VMM library.

Create a VMM Library

To create a library, create a share of a folder. Mine is called VMMLibrary.

I set Authenticated Users to Read for the example. For production I recommend you to set Authenticated Users share permission to Full Control and manage access from NTFS permission.

Next add your VMM runAs account to Administrators local group.

Now that share is ready, you just have to add the library to VMM.

Add a Library to Virtual Machine Manager

To add the library to VMM, navigate to the Library tab and right click on Library Servers. Then click on Add Library Server.

Next select your RunAs account as below (that you have added to Administrators local group on your library server).

Next search for your library server from Active Directory. Mine is called vmlib01.

Then select the share which will be managed by VMM. I never add the default resources that useless from my point of view.

To finish adding the library click on Add Library Servers.

The PowerShell code:

$credential = Get-Credential
Add-SCLibraryShare -Description "" -JobGroup "87854076-414a-4d64-abb2-b529ddcb5901" -SharePath "\\\VMMLibrary"
Add-SCLibraryServer -ComputerName "" -Description "" -JobGroup "87854076-414a-4d64-abb2-b529ddcb5901" -RunAsynchronously -Credential $credential

Once the library is added, you should see under Library Servers.

As you can see in above screenshot, the objects are displayed twice: one from VMVMM01 server and one from VMLIB01 server. We will see after how to manage that. But before, we will assign libraries to host groups.

Assign a VMM Library to a host group

To assign a VMM library to a host group, open the Library tab and under Library Servers menu right click on a server name. Then select Properties.

I assign vmlib01 to Work host group and VMVMM01 to Home host group.

Now that library are associated with the host groups, it is time to manage equivalent objects.

Manage equivalent objects

Equivalent objects are used to say to VMM that two objects in the library are same. For example, you can see below screenshot where the same VHDX is located on each VMM Library server. These VHDX are marked as equivalent objects. When I use this VHDX on VM template, I select one instance of these equivalent objects. In this way, VMM will choose itself one instance on deployment.

This become beneficial when you assign VMM Library servers to host groups. If you deploy a VM from a template where the VHDX are marked as equivalent objects, VMM will select the instance of this equivalent object related to the VMM library which is assigned to host group where you deploy VM. Well, let’s see that! 

First I will mark as equivalent objects my anwser files to show you how to make that. So I click on Library Servers, I select my two equivalent anwser files and I click on Mark Equivalent on top menu.

I fill the fields family and release and I click ok.

Now my anwser files located on my two VMM library are marked as equivalent objects.

Now I use my VHDX W2012R2DTC_v1.1.vhdx that are marked as equivalent in a VM Template. As you can see below, I select one VHDX belonging to equivalent object.

Just to remember you, currently the VMVMM01 library is assigned to Home host group and VMLIB01 is assigned to Work host group. So I deploy a VM from the above template on hypervisor of Home host group. So as you can see on below screenshot, the VHDX chosen by VMM is located on VMVMM01.

In case you do not believe me, I will reverse the assignation of VMM library servers to host groups. I can’t show you from a different way because I have only one Hyper-V host. So as you can see below, I assign VMLIB01 to Home host group and VMVMM01 to Work host group.

So I redeploy a VM from a template, and as below screenshot, I select Home host group to place VM.

And VMM select the VHDX located on VMLIB01 because this library is assigned to Home host group.

You believe me now? J

Replicate Library

Microsoft doesn’t support VMM library that belong to a DFS namespace. That’s a shame because the other solution is Robocopy. To make that, you have to define a master server and slave servers. All modification make in library must be done from the master server and after that, launch a schedule task to robocopy change to slave servers. Below the robocopy command that I use:

Robocopy D:\VMMLibrary \\vmlib01\VMMLibrary /MIR /E /R:5 /W:30 /Log+:c:\temp\robocopy.log
  • /MIR: mirror a directory tree. If something is added to the directory tree located on slave servers, these objects will be deleted;
  • /E: copy subdirectories, including empty ones;
  • /R: number of retries;
  • /W: Wait X second between each retry;
  • /Log+: log file in appending mode.

About Romain Serre

Romain Serre works in Lyon as a Senior Consultant. He is focused on Microsoft Technology, especially on Hyper-V, System Center, Storage, networking and Cloud OS technology as Microsoft Azure or Azure Stack. He is a MVP and he is certified Microsoft Certified Solution Expert (MCSE Server Infrastructure & Private Cloud), on Hyper-V and on Microsoft Azure (Implementing a Microsoft Azure Solution).

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Check Also

Manage Switch Embedded Teaming from VMM 2016

Since System Virtual Machine Manager 2016 Technical Preview 5 with cumulative update 2, it is ...

Manage Storage Space Direct from Virtual Machine Manager

In a previous topic, I shown how to implement a Storage Space Direct on Windows ...

Rename VM’s Network Adapters automatically with Virtual Machine Manager 2016

The next version of Hyper-V comes with a new feature called Virtual Network Adapter Identification. ...