Using BGInfo to help determine VM Guest partition alignment (Starting offset and allocation unit size)
We use BGInfo quite a bit to help us with basic VM guest information (IP Address, name, HD Space, etc)
Today I was thinking about the partition alignment (Starting offset and allocation unit size) on my Windows guests and wondered about their alignment.
There are programs made for this, some are quite good, but it wouldn’t be more convenient to have it come up with BGinfo?
I thought it would be especially handy because we have multiple templates some are aligned differently, and I could use this as a double check to those programs which correct this issue.
By adding the Starting Offset and volume block size(aka allocation unit size) to our BGinfo.bat file we can now see how are VM guest partitions are aligned!
From this screenshot we see 3 Volumes..
C: has a 32K Offset / 4K Allocation | D: 64K offset / 32K Allocation | E: 64K offset / 4K Allocation
The only volume that is optimal is our D: volume, the rest need some work…
Want to know more about alignment?
Go here >> http://www.vmware.com/pdf/esx3_partition_align.pdf and here >> http://www.vmware.com/pdf/Perf_Best_Practices_vSphere4.0.pdf
Here’s how to setup BGInfo…
- Download BGInfo from sysinsterals
- Create your *.bgi file (this file contains all the fields you want displayed, see below for the offset)
- Create a simple batch file to launch your *.bgi file on logon
- @echo off
- cd\
- CALL “C:\Files\bginfo.exe” “C:\Files\YOUR.bgi” /timer:0 /nolicprompt
-
Place all the files in a simple folder like c:\Files
-
Files Needed
- Bginfo.exe
- YOUR.bgi
- Startbgi.bat
-
- In Windows 2003 – Copy Startbgi.bat into “c:\Documents and Settings\All Users\Start Menu\Programs\Startup”
Every time you logon to the server, bginfo will launch and update your background with useful information..
Once you have created your basic *bgi file, then it’s time to add the WMI Query for Starting Offset and volume block size(aka allocation unit size)
- In BGInfo click on Custom, then New, Enter a name under Identifier, Choose WMI Query, then click on Browse
- Under WMI Class Choose Win32_DiskPatition and under Class Property choose StartingOffset
- Save it up and add it to your *.bgi file
Follow the same steps as above only this time…
Under WMI Class Choose Win32_Volume and under Class Property choose BlockSize (aka allocation unit size)
I hope this works for you as well as it did for me!
Enjoy!
Matt..