Home > Microsoft, Virtualization > Virtual Machines that are misaligned

Virtual Machines that are misaligned

For existing child VMs that are misaligned, in order to correct the partition offset, a new physical disk must be created and formatted, and the data has to be migrated from the original disk to the new one.

Important note: Both Windows 7 and Windows 2008/2008R2  create aligned partition

This problem  occurs when the partitioning  scheme used by the host OS doesn’t match the block boundaries inside the LUN.If the guest file system is not aligned, it may become necessary to read or write twice as many blocks of storage than the guest actually requested since any guest file system block actually occupies at least two partial storage blocks.

All VHD types can be formatted with the correct offset at the time of  creation by booting the child VM before installing an OS and manually setting the partition offset. . The recommended starting offset value for Windows OSs is 32768. The default starting offset value typically observed is 32256.
How to verify the Offset value:

1. Run msinfo32 on the guest VM by selecting
Start > All Programs > Accessories > System Tools > System Information.
or type Start > Run and enter the following command : MSINFO32
2. Navigate to Components > Storage > Disks and check the value for partition starting offset.


If the misaligned virtual disk is the boot partition, follow these  steps:
1. Back up the VM system image.
2. Shut down the VM.
3. Attach the misaligned system image virtual disk to a different VM.
4. Attach a new aligned virtual disk to this VM.
5. Copy the contents of the system image (for example, C: in Windows) virtual disk to the new aligned virtual disk.
There are various tools that can be used to copy the contents from the misaligned virtual disk to the new aligned virtual disk:
− Windows xcopy
− Norton/Symantec™ Ghost: Norton/Symantec Ghost can be used to back up a full system image on the misaligned virtual disk and then be restored to a previously created, aligned virtual disk file system.
For Microsoft Hyper-V LUNs mapped to the Hyper-V parent partition using the incorrect LUN protocol type but with

aligned VHDs, create a new LUN using the correct LUN protocol type and copy the
contents (VMs and VHDs) from the misaligned LUN to this new LUN.

For Microsoft Hyper-V LUNs mapped to the Hyper-V parent partition using the   incorrect LUN protocol type but with misaligned VHDs, create a new LUN using the correct LUN protocol type and copy the contents (VMs and VHDs) from the misaligned LUN to this new LUN.!01

Next, To set up the starting offset, follow these steps:

1. Boot the child VM with the Windows Preinstall Environment boot CD.
2. Select

Start > Run and enter the following command:
diskpart
3. Type the following into the prompt:
select disk 0
4. Type the following into the prompt:
create partition primary align=32
5. Reboot the child VM with the Windows Preinstall Environment boot CD.
6. Install the operating system as normal.
Virtual disks to be used as data disks can be formatted with the correct  offset at the time of creation by using Diskpart in the VM. To align the virtual disk, follow these steps:

1. Boot the child VM with the Windows Preinstall Environment boot CD.
2. Select Start > Run and enter the following command:
diskpart
3. Determine the appropriate disk to use by typing the following into the prompt:
list disk
4. Select the correct disk by typing the following into the prompt:
select disk [#]
5. Type the following into the prompt:
create partition primary align=32
6. To exit, type the following in the prompt:
exit
7. Format the data disk as you would normally

For pass-through disks and LUNs directly mapped to the child OS, create a new LUN using the correct LUN protocol type, map the LUN to the VM, and copy the contents from the misaligned LUN to this new aligned LUN.

For info about  misaligned in Windows 2003, please have a look here : http://support.microsoft.com/default.aspx?scid=kb;EN-US;929491
Advertisement
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: