Blog D'Joy

This [we]blog will be used to share thoughts (mostly technical), examples, tutorials, etc. for Microsoft Tech (mostly System Center).

8 Minute Demo – Automated Hyper-V Integration Services Upgrade with OIS and VMM!

8 Minute Demo – Automated Hyper-V Integration Services Upgrade with OIS and VMM!

  • Comments 2
  • Likes

Hello readers and viewers!

I realize it has been a LONG time since I published an “8-Minute-Demo”, but I figured it was time. I was going to wait until my voice was back to normal, but I didn’t know how long you would have to wait. So, please excuse the hoarseness of my voice.

Today’s Video Topic: Have you recently upgraded your Windows Server 2008 R2 machine with Hyper-V to Service Pack 1? Well, some unique changes to Hyper-V come along with that upgrade. One of these is the need to upgrade the Integration Services (Components) for each of the VMs on your Hyper-V Server. This video shows how you can automate the upgrade of all your VMs utilizing OIS and the available VMM Integration Pack.

That said, here is the video!

So that you can draw from the same raw materials I did in the demonstration, the following table contains the PowerShell I used in the OIS workflow:

PowerShell for Querying the IntegrationServicesVersion values for VMs on the Hyper-V Host (requires http://pshyperv.codeplex.com/). Appears at timestamp 00:01:47 in video.

Import-Module "##YOURPATH##\HyperV.psd1"
$vminfo = Get-VMKVP | Select VMElementName, IntegrationServicesVersion
$vminfo
Remove-Module HyperV

PowerShell for Querying the Registry on the target VMs for their IntegrationServicesVersion value. Appears at timestamps 00:04:12 and 00:07:29 in video.

$password = ConvertTo-SecureString -String "##PASSWORD VARIABLE##" -AsPlainText -Force;
$credential = New-Object System.Management.Automation.Pscredential ("##DOMAIN VARIABLE##\##DOMAIN USERNAME##" , $password);
$session = New-PSSession -ComputerName "##COMPUTER NAME PUBLISHED DATA FROM GET VMS##" -Credential $credential -Port 5985 -Authentication Default;
$ICVersion= Invoke-Command -Session $session -ScriptBlock {Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Virtual Machine\Auto" | Select-Object -ExpandProperty IntegrationServicesVersion;}
Remove-PSSession -Session $session;

Also, the other blog post that I mentioned in the video (timestamp 00:04:33) is the “8 Minute Demo – OIS-SCVMM PowerShell Execution Options”. This is where I introduced the syntax for using PowerShell to access information on remote machines from OIS installed on a Windows Server 2008 x64 machine.

Finally, attached to this blog post, I have included the OIS_EXPORT of a version of the workflow in the demonstration. This can be used as a guide to recreate this process in your own OIS environment. The version of the workflow included here has a bit more error checking and includes a loop on the “Verify IC Version on VM” object, which will ensure success of the verification check PowerShell command before the workflow continues to the comparison object.

image

Keep in mind, this process will do exactly what you have configured it to do. If your DC (or any VM that is a network dependency for other VMs) is in the automated upgrade list, it will be shutdown, updated and restarted. In fact, if it applies, you will want to manually upgrade your OIS and VMM m virtual machines’ ICs for Hyper-V so that they is off the list. ;)

NOTE: As this is simply an example of what you *could* do, only a sample of options are covered in this video and workflow example. Your specific experience will vary based on your environment and process. You may want to add some “intelligent branching” after the “Get VMs” object to handle cases where the published data in the “Computer Name” field from that object will not work in the “Check IC Version on VM”. This would include non-Windows and old-Windows hosts where the PowerShell would not be able to connect and retrieve the IC version information. It may also be a good idea to add a filter to the “Get VMs” object to only return “Running” VMs, as the PowerShell commands will not work on “Stopped” or “Paused” VMs (or ensure all your VMs are “Running” before executing this workflow).


Same workflow, this time without verification steps (minimalistic approach):

image

You can use the “Get VMs” object in this example to filter out the machines you do not want to run through the process. See the following image of the “Get VMs” object properties:

image

You would still reference the “VM ID” in each of the subsequent objects, and of course, the “Update VM” object would still contain “True” for the “Install Virtualization Guest Services” field (see image below):

image

Whichever way you do it…

enJOY!

Attachment: AutomatedHyperVICUpgrade_ois_export_20110331.zip
Comments
  • hi!

    Do you have any experience with the Opalis SCVMM IP running against a SCVMM 2012 Beta Server? I do not get things running cause of "missing powershell snapins" although they are there...

    ciao, ralf

  • The existing OIS SCVMM IP is not compatible against SCVMM 2012. There will be a new line of OIS IPs for the SC 2012 products released later this year. Your best option in the meantime is to use PowerShell commands against the SC 2012 components from either the SC 2012 Orchestrator BETA or OIS 6.3.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment