Virtu-Al.Net

Virtually everything is poshable

PowerCLI: More HAL Information

If you have performed Physical to Virtual (P2V) Migrations before you will know about the significance of having the correct Hardware Abstraction Layer (HAL) installed within the operating system.

Without the correct HAL you may experience a speed decrease or even a hung operating system.

For a single processor VM you will need a Uniprocessor Hal and for a multi (2-8) processor VM you will need a Multiprocessor Hal.

The following one-liner expands on my previous one-liner to include the following information:

  • Name
  • Number of CPUs
  • HAL installed in the OS
  • OS Version
  • OS Service Pack Version

Note:  You will need access to read WMI information from the guest operating system with the account which runs this script.

    Get-VM |Where {$_.PowerState -eq PoweredOn} |Sort Name |Select Name, NumCPU, @{N=OSHAL;E={(Get-WmiObject -ComputerName $_.Name-Query SELECT * FROM Win32_PnPEntity where ClassGuid = ‘{4D36E966-E325-11CE-BFC1-08002BE10318}’ |Select Name).Name}}, @{N=OperatingSystem;E={(Get-WmiObject -ComputerName $_ -Class Win32_OperatingSystem |Select Caption).Caption}}, @{N=ServicePack;E={(Get-WmiObject -ComputerName $_ -Class Win32_OperatingSystem |Select CSDVersion).CSDVersion}}

An example output from this script with using Export-CSV on the end shows us the information we need to rectify any potential VM mis-configurations:

image

For advice on how to convert the HAL you are using follow these steps over on vmetc.com

, , ,

6 Responses to “PowerCLI: More HAL Information”

  • Are you talking about me?

  • Virtu-Al says:

    @Hal Rottenberg
    Yes I finally worked out the code that converts you into a virtual Hal so we can all have our own little PowerCLI Guru.

  • Arsento says:

    Thank you! You often write very interesting articles. You improved my mood.

  • Robert van den Nieuwendijk says:

    I didn’t get the OSHAL with your script. The Get-WmiObject -ComputerName $_.Name-Query “SELECT * FROM Win32_PnPEntity where ClassGuid = ‘{4D36E966-E325-11CE-BFC1-08002BE10318}’“ gave an Invalid Query error on the where clause. So I changed the script to:

    Get-VM |Where {$_.PowerState -eq “PoweredOn”} |Sort Name |Select Name, NumCPU, @{N=”OSHAL”;E={(Get-WmiObject -ComputerName $_.Name-Query “SELECT * FROM Win32_PnPEntity” |Where { $_.ClassGuid -eq ‘{4D36E966-E325-11CE-BFC1-08002BE10318}’ } |Select Name).Name}}, @{N=”OperatingSystem”;E={(Get-WmiObject -ComputerName $_ -Class Win32_OperatingSystem |Select Caption).Caption}}, @{N=”ServicePack”;E={(Get-WmiObject -ComputerName $_ -Class Win32_OperatingSystem |Select CSDVersion).CSDVersion}}

    This version works for me.

  • Lieven says:

    Would it be possible to include this script in your vCheck script?

  • [...] have made an little script somewhat alike to Alan Renouf´s to get the HAL of the VM guest running in your environment, the difference in my approach is that i [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>