Using PowerCLI to find ESX/ESXi BIOS Versions

A few weeks ago I updated the BIOS on several Dell R810 servers running ESXi 4.1U1. After applying the update I disabled the C-States and C1E settings as described here: http://enterpriseadmins.org/blog/virtualization/vmware-esxi-psod-on-dell-server/. Once I had all my updates completed, I wanted to validate that each host was reporting the latest BIOS version. A quick search of the PowerCLI forums turned up this article where @LucD had already provided the required code http://communities.vmware.com/message/1785476

Get-View -ViewType HostSystem | Select Name,@{N="BIOS version";E={$_.Hardware.BiosInfo.BiosVersion}},    
   @{N="BIOS date";E={$_.Hardware.BiosInfo.releaseDate}}

I ran into problems where only 3 of 16 hosts reported any BIOS Version. A little more searching, and I found some code that looks like someone else had encountered the same issue: http://www.sandfordit.com/vwiki/index.php?title=VI_Toolkit_(PowerShell). In the referenced WIKI article, the author checked the Hardware.BiosInfo, and if it wasn’t available they parsed Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo. This second method worked on all 16 of 16 hosts I was interested in (sample code below):

$report = @()
Get-View -ViewType HostSystem | %{ 
     $row = "" |Select Name, "BIOS Version", "BIOS Date"
     $row.name = $_.name
     $biosTemp = ((($_.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo | Where {$_.Name -like "*BIOS*"}).Name -split "BIOS ")[1] -split " ")
     $row."BIOS Version" = $biosTemp[0]
     $row."BIOS Date" = $biosTemp[1]
     $report += $row
}
$report

This code block is on the road map for a future release of vCheck. I’m actually planning to only show clusters that contain hosts with different BIOS versions; if the cluster is good there shouldn’t be a reason to report on the issue.

Posted in Scripting, Virtualization | 2 Comments

Indianapolis VMUG Demo Days 4 PowerCLI Lab

Last week the Indianapolis VMware User Group hosted the 4th annual Demo Days event. I had the privilege of working with Ryan Birk (@rlbindy) and Jake Robinson (@jakerobinson) on the PowerCLI self paced lab. The purpose of this lab was to introduce people to vSphere management with PowerCLI, provide some examples to get you hooked, but not take up a lot of time (people wanted to hear expert speakers such as Scott Lowe, Mike Laverick, David Davis and Vaughn Stewart who had gathered for this event).

Jake created the following diagram of the vApp used in the labs:

As you can see, the lab consisted of a vCenter server, two virtualized ESXi hosts and a virtual shared storage appliance. Each seat in the lab connected over Remote Desktop to the vCenter server in a dedicated vApp:

We plan to make the content of this self paced lab available to everyone as soon as we work out some typos. Hopefully this should happen in the next week or so.

A special thanks goes to Bluelock (www.bluelock.com) for providing the virtual data center services and 10zig Technology (www.10zig.com) for providing the thin client devices.

Posted in Scripting, Virtualization | 1 Comment

Make PowerCLI run faster

I came across this article: http://blogs.vmware.com/vipowershell/2011/06/how-to-speed-up-the-execution-of-the-first-powercli-cmdlet.html and decided to test the steps out myself:


REM View the following link for details: http://blogs.vmware.com/vipowershell/2011/06/how-to-speed-up-the-execution-of-the-first-powercli-cmdlet.html

C:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe install "VimService41.XmlSerializers, Version=4.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"
C:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe install "VimService40.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"
C:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe install "VimService25.XmlSerializers, Version=2.5.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"

REM If you are running on 64-bit OS, you need to run the following as well:
if %PROCESSOR_ARCHITECTURE% == AMD64 (
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe install "VimService41.XmlSerializers, Version=4.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe install "VimService40.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe install "VimService25.XmlSerializers, Version=2.5.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"
)

Running the NGEN.EXE commands made my connect-viserver cmdlet run a bit faster…it now takes 8 seconds the first time instead of 12. Not much savings, but if I had time to waste I wouldn’t be using PowerCLI in the first place!

Posted in Scripting, Virtualization | 3 Comments

Virtual Sound in Windows 2003 Server

As a VMware admin, I try to keep tabs on customer requests, especially when multiple issues are reported for similar problems. Recently I noticed two requests come through for virtual machine sound issues — within a day of each other. One customer was reporting that their application required a sound card to be installed and the other customer was reporting that their server was beeping and they wanted it to stop.

Issue #1: Sound card required
Description: The users application converted text to speech for use in an automated dialing application. The application would generate a WAV file, but an error would be generated as the the application attempted to play the file.
Resolution: Enabling sound for Remote Desktop Protocol in a Windows virtual machine http://kb.vmware.com/kb/1004839

Issue #2: Stop the beeping
Description: The customers application would beep when moving from tab to tab if the required form fields were not complete. This beep was was the standard system beep and could be recreated by typing the following at a command prompt echo <CTRL>+<G>.
Resolution: System Beeps after Installing Hotfix Rollup Pack 5 for XenApp 5.0/4.5 on Windows Server 2003 http://support.citrix.com/article/CTX126856

At first I believed these issues to be hardware/ESXi related — I hadn’t experienced either problem before and both requests were received within 24 hours. Fortunately, however, neither issue was virtual or physical hardware related and were easily resolved within the guest operating systems.

Posted in Virtualization | Leave a comment

Weird issue with disk management in Windows 2008

I have ran into this issue several times and thought it would be worth sharing. The issue appears to be related Windows 2008 Server (the version without R2) and applies to both Standard and Enterprise editions.

When extending the disk, the partition appears to grow but the file system size does not change as expected. You’ll note in the screenshot below that the disk management screen (at the bottom) shows disk 1 – the D: drive – as being 40GB but the screenshot in the middle shows drive D: as only 30GB.

I found the following article that applies to Windows XP and 2003 server. The partition size is extended, but the file system remains the original size when you extend an NTFS volume http://support.microsoft.com/kb/832316

I didn’t install the mentioned hotfix as it does not apply to Windows 2008. However, the following diskpart commands resolved the issue:

select volume d
extend filesystem

After running the extend filesystem command the volume size is increased to 40GB without reboot or issue. I hope this article helps others who might run into this issue.

Posted in Virtualization | 2 Comments