Quando si arriva ad avere un alto numero di host è evidente che il numero di guest sarà ancora più difficile da gestire e in fase di migrazione, come per esempio in questo frangente nel quale si migra da Hyper-V R2 a Hyper-V R2 SP1, tenere traccia dei guest nei quali si è già provveduto ad aggiornare gli Integration Services può essere complicato.
Ancor di più se consideriamo che tramite la GUI non è poi così comodo andare a trovare la versione installata degli Integration Services di Hyper-V. In nostro soccorso accorre prontamente Powershell che ci consente, tramite un semplicissimo script, di elencare le versioni attualmente installate su tutte le macchine virtuali degli Integration Services.
Lo script è il seguente:
function Get-IntegrationServicesVersion ($HVhost = $(throw "E' richiesto almeno un Host Hyper-V"))
{
Write-Host "Sto verificando i guest su $HVhost."
$kvps = Get-WmiObject -Namespace root\virtualization -ComputerName $HVHost -Query "Select GuestIntrinsicExchangeItems From Msvm_KvpExchangeComponent"
foreach ($kvp in $kvps)
{
$vmkvp = $Kvp.GuestIntrinsicExchangeItems
$vmkvp | select-object @{Label="Host Hyper-V";Expression={$HVHost}},@{Label="Guest";Expression={([xml]$vmkvp[0]).instance.property[1].value}},@{Label="Versione IC";Expression={([xml]$vmkvp[14]).instance.property[1].value}} -first 1
}
}
cls
$hvhosts = get-content .\hosts.txt
Write-Host "Il numero di host è: $($hvhosts.Count)"
Write-Host "Gli host esaminati saranno: $hvhosts"
foreach ($hvhost in $hvhosts) {
Get-IntegrationServicesVersion $hvhost}
e il suo funzionamento è veramente semplice. Sarà sufficiente creare un file di testo hosts.txt nella stessa cartella dove salverete lo script all’interno del quale dovrete inserire l’elenco dei vostri host fisici (uno per ogni linea). A questo punto non dovrete fare altro che lanciare lo script per ottenere un output come quello dell’immagine seguente:
Vale la pena di ricordare che si sono susseguite numerose versioni degli Integration Services dal rilascio di Microsoft Hyper-V e la tabella seguente ci può aiutare a mettere un po' in ordine i numeri:
|
Versione di Windows + Hyper-V
|
Versione IS
|
| Windows Server 2008 + Hyper-V Beta |
6.0.6001.17101 |
| Windows Server 2008 + Hyper-V RTM (KB 950050) |
6.0.6001.18016 |
| Windows Server 2008 + KB956710 |
6.0.6001.22258 |
| Windows Server 2008 + KB959962 |
6.0.6001.22352 |
| Windows Server 2008 + SP2 |
6.0.6002.18005 |
| Windows Server 2008 + KB 975925 |
6.0.6002.22233 |
| Windows Server 2008 R2 RTM |
6.1.7600.16385 |
| Windows Server 2008 R2 + KB 975354 |
6.1.7600.20542 |
| Windows Server 2008 R2 + KB 981836 |
6.1.7600.20683 |
| Windows Server 2008 R2 + KB 2223005 |
6.1.7600.20778 |
| Windows Server 2008 R2 + SP1 Beta |
6.1.7601.16562 |
| Windows Server 2008 R2 + SP1 RC |
6.1.7601.17105 |
| Windows Server 2008 R2 + SP1 |
6.1.7601.17514 |
Ricordatevi che è sempre di fondamentale importanza mantenere aggiornati gli Integration Services e l’hypervisor poiché a volte le nuove features (vedi Dynamic Memory introdotta con il Service Pack 1 di Windows 2008 R2) o alcuni bug vengono corretti anche mediante l’aggiornamento degli IS.