June 2009 - Posts

In order to delegate management to a subset of the virtual machines running on a Hyper-V server, you must create a new Authorization Manager scope and apply it to the target set of virtual machines before creating a new role, task, and role assignment. You can create the new scope using the Authorization Manager Console. Then, to apply the new scope, you must set the ScopeOfResidence property to the new scope name for each target virtual machine. Because you cannot perform this step using the Authorization Manager Console, you have to use a script to modify each virtual machine ScopeOfResidence property. Following is a sample VBScript that allows you to assign a new scope to a virtual machine.

Option Explicit

Dim WMIService
Dim VMDim VMManagementService
Dim VMSystemGlobalSettingData
Dim VMName
Dim VMScope
Dim Result


'Enter the VM name and the name of the scope to assign it to
VMName = InputBox("Specify the virtual machine to change scope on:")
VMScope = InputBox("Specify the new scope to be used:")

'Get an instance of the WMI Service in the virtualization namespace
Set WMIService=GetObject("winmgmts:\\.\root\virtualization")

'Get a VMManagementService object
Set VMManagementService = WMIService.ExecQuery("SELECT * FROM Msvm_VirtualSystemManagementService").ItemIndex(0)

'Get the VM object that we want to modify
Set VM=(WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem WHERE ElementName='" & VMName & "'")).ItemIndex(0)

'Get the VirtualSystemGlobalSettingsData of the VM to be modified
Set VMSystemGlobalSettingData = (VM.Associators_("MSVM_ElementSettingData", "Msvm_VirtualSystemGlobalSettingData")).ItemIndex(0)

'Change the ScopeOfResidence property
VMSystemGlobalSettingData.ScopeOfResidence = VMScope

'Update the VM with ModifyVirtualSystem
Result = VMManagementService.ModifyVirtualSystem(VM.Path_.Path,
VMSystemGlobalSettingData.GetText_(1))

If you have not seen a Windows Server 2008 R2 Hyper-V Live Migration demo using AMD Barcelona-based platforms, you can watch one that was posted on YouTube.

Hyper-V R2 Live Migration on AMD-V

What is interesting in this video is that you can see that although the Live Migration feature does not instantaneously move a virtual machine from one failover cluster node to another, it does show that the virtual machine maintains a performance level during the Live Migration process that does not cause any service interruption of the application running in it.

I’m interested in how your IT department plans to deploy and use Live Migration. If you care to share, drop me a line at askme@doingitvirtual.com.