VMware vSphere

 View Only
  • 1.  Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 05:42 PM

    In short, no matter what I try I get "A disk read error occurred. Press ctrlaltdel to restart" when creating a new Windows Server 2003 Standard R2 64-bit virtual machine with a properly aligned disk/partition. I spent many hours troubleshooting this yesterday - including reading many blogs and forum posts - to no avail.

    Long story:

    Following a couple of sessions I attended at VMworld 2010 I decided to look deeper into disk alignment. We have a few ESXi 4.0u2 clusters with a variety of Windows and Linux VMs and 3 different types of SANs (FC, iSCSI, NetApp). I will look into re-aligning the existing VMs later (mbralign, vOptimizer, etc). Instead, to begin I want to create a new Windows Server 2003 Standard 64-bit template. I have tried many methods of creating a 20 or 30 GB vmdk with a properly aligned partition but Windows setup always gets the error above after the first reboot during setup.

    Here are some examples of what I tried...

    Method #1 - diskpart & format by attaching the .vmdk to an existing Windows VM (tried Win2K3 and Win2K8)

    select disk 1

    create partition primary align=64

    assign letter=d:

    format d: /FS:NTFS /Q /A:32K

    Method #2 - fdisk (both on the ESXi host via the support console and using Parted Magic livecd)

    grep for ddb.geometry.cylinders in the VM.vmdk file

    fdisk VM-flat.vmdk

    x (expert mode)

    c (set cylinders)

    (from above, ignore error)

    p (to check cylinders)

    r (exit expert mode)

    n (new partition)

    p (primary partition)

    1 (first partition)

    Enter

    Enter

    x (expert mode)

    b (starting block)

    1 (first partition)

    64

    p (to check starting block)

    r (exit expert mode)

    t (create partition of type X)

    1 (first partition)

    7 (HPFS/NTFS)

    w (write changes, ignore error)

    mkfs.ntfs /dev/sda1 –c 32768

    Here are some of the resources I used to get a better understanding of this:

    http://www.vmware.com/pdf/esx3_partition_align.pdf

    http://blogs.netapp.com/storage_nuts_n_bolts/2009/01/mbrscanmbralign.html

    http://blog.aarondelp.com/2009/10/netapp-mbrscan-and-mbralign-for-virtual.html

    http://www.tcpdump.com/kb/virtualization/vmware-esx-server/vmware-disk-alignment/all-pages.html

    http://www.yellow-bricks.com/2010/04/08/aligning-your-vms-virtual-harddisks/

    http://msdn.microsoft.com/en-us/library/dd758814.aspx

    http://ctxadmtools.musumeci.com.ar/VMCheckAlign/VMCheckAlignment10.html

    Thoughts?

    - Aaron Rogers



  • 2.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 05:54 PM

    so you want to align your C: drive for your template, corrrect? You create a VM, did you install the OS? If so, you can't. You need to boot off a WinPE CD, then go to diskpart and list volume, select volume and create partition primary align=64. Once that is done, mount your OS media and install Windows.



  • 3.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 06:00 PM

    Thanks for the response, but I'm pretty sure you didn't actually read what I wrote. :|

    • Aaron



  • 4.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 06:10 PM

    What I usualy do when I need/want to align a partition is to boot the new VM from a Windows 7 DVD into repair mode and start the command line.

    From there I use diskpart to:

    - clean (Remove all partition info if any exists)

    - create partition primary align=1024 (Align in the way MS does it with all OS's starting with Windows Vista)

    - active (Set the partition as the active one)

    - exit (done)

    Then install the OS and select to use the existing partition.

    André



  • 5.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 06:23 PM

    Thanks for the response, but I'm pretty sure you didn't actually read what I wrote

    Don't know what they told you at VM Ware, Alignment isn't all that. It's really for VERY high IO VM's, and there is some doubt that it actually affects performance (good OR bad), for the SAN and the VM. So you probably don't need it.

    It's one of those don't know what you don't know, like drinking water, and smoking cigarettes. People have died early when healthy, and lived to be a hundred smoking for 85 years.. so in this case, it MAY help you or it could be a waste of time (like us). We use it on some templates, when someone wants a high IO VM I just create it, performance isn't affected, and I am not going out of my way to align it, especially when we see a LOT of benchmarks that pretty much proves that even if there SOME improvement (and by that it's negligible) it depends on the VM and the SAN anyway.

    Besides, most people don't defrag.. so the little alignment that could make your VM's faster, is more than reversed inside the VM with tons of fragments.

    IF you run defrag, and IF your VM's are maintained (disk, registry, optimized), and IF your SAN is in perfect condition, and IF you manage to use HIGH IOPS disk, and then MAYBE alignment might help.. MAYBE.

    After all of this if you still want to do it.. try vizioncore (quest software) voptimize. You can optimize 1 VM (a template), but I can tell you from experience this effort will be for naught.



  • 6.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 06:15 PM

    I read your post, maybe I don't understand. You can't align a partition if you have an OS or data on it already. (other than the NetAPP or Vizioncore tools)



  • 7.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 06:33 PM

    @a.p.

    Thanks, I'll give that a try.

    @ Troy Clavell

    I will look into re-aligning the existing VMs later (mbralign, vOptimizer, etc). Instead, to begin I want to create a new Windows Server 2003 Standard 64-bit template.

    @ vmroyale

    I read that too but I want to see the results for myself.

    @ RParker

    Same as above. I want to see what the results are in our environment across our 3 different SANs.

    - Aaron



  • 8.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 08:13 PM

    Aha, I finally found the solution! Apparently the system partition must use an allocation unit size of 4096 bytes.

    I found that note here:

    http://social.technet.microsoft.com/Forums/en-US/itproxpsp/thread/8dd2af22-75f7-4f07-8d08-36270b2f6010

    - Aaron



  • 9.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 10, 2010 04:00 PM

    Note: Keep in mind that in the Windows world the system partition is used to boot the OS and the boot partition is where the OS resides. :|

    http://en.wikipedia.org/wiki/System_partition_and_boot_partition

    In case anyone runs into this, here's what I did...

    First, I added a second hard drive (30G B) to an existing Windows Server 2008 virtual machine. I then opened a command prompt, launched diskpart, and did the following:

    select disk 1

    create partition primary align=64 size=100

    create partition primary align=64

    That means choose the second hard drive, create a 100mb primary partition and then a second primary partition that uses the rest of the drive.

    Then I used diskmgmt.msc to format the 100mb partition with 4K cluster size and the second with 32K cluster size. I also set the second to active (though this might not have been necessary).

    I removed the second drive from my Win2K8 vm and added it (as the only drive) to my newly-created Windows Server 2003 Standard 64-bit vm. I then installed Windows to the second (29gb) partition making sure to choose to leave the partition alone. After the first stage of setup I got the (expected) dreaded "A disk read error occurred" message.

    I powered off the Win2K3 vm, re-attached the vmdk to my Win2K8 vm and launched diskmgmt.msc. I assigned a drive letter to both partitions, set Explorer to not hide hidden or system files, and copied boot.ini, ntldr, and ntdetect.com from the second partition to the first. I then removed the drive letters and set the first partition (the 100mb one) to active.

    After removing the vmdk from the Win2K8 box i fired up my Win2K3 vm and voila, it booted fine into the next stage of the Windows installer.

    The problem with this method, however, is that Windows assigns a drive letter to the system partition (the 100mb partition that is used to boot) and I seem to be unable to remove it. Thoughts? It's nice in Windows 7/2008 that the system partition is hidden with no assigned drive letter.

    Anyway, now it's time to test storage IOPS on our FC, iSCSI and NetApp SANs using the following 4 vms:

    • Windows Server 2003 Standard 64-bit, 1 default (improperly) aligned partition with default/4K cluster size

    • Windows Server 2003 Standard 64-bit, 1 properly aligned partition with default/4K cluster size

    • Windows Server 2003 Standard 64-bit, 1 properly aligned system partition with default/4K cluster size, 1 properly aligned boot partition with 32K cluster size

    • Windows Server 2008 R2 64-bit, 1 default, properly aligned partition with default cluster size

    - Aaron



  • 10.  RE: Windows Server 2003 & Disk Alignment

    Posted Sep 09, 2010 06:23 PM

    Hello.

    The Recommendations for Aligning VMFS Partitions" Performance Study states that "Aligning the boot disk in the virtual machine is neither recommended nor required. Align only the data disks in the virtual machine." It is a lot of work, as you have noticed, and likely won't gain you much in performance. With that being said, an aligned template isn't necessarily a bad idea. I have used the instructions here in Part 1-Step 4 with good results for Windows 2003, in the past.

    Good Luck!