Currently Being Moderated

UPDATE - mbralign is available from the now.netapp.com website

VERSION 6  Click to view document history

Created on: Mar 23, 2009 11:00 AM by forgette - Last Modified:  Jun 14, 2009 6:26 PM by forgette

Several people have recently inquired about the location of the mbrscan and mbralign tools.  The purpose of this document is to provide a link to each tool.

 

The mbrscan tool (version 1.2) is part of the VMware ESX Host Utilities version 5.0.

http://now.netapp.com/download/software/sanhost_esx/5.0R2/

 

The mbrscan tool (version 1.5) and the mbralign tool is part of the VMware  ESX Host Utilities version 5.1.

http://now.netapp.com/download/software/sanhost_esx/5.1/

 

Please take a look at the Frequently Asked Questions page for the mbralign tool for more information.

 

Technical Report (TR-3747) covers guest filesystem alignment and the use of these tools.  Abhinav Joshi links to a blog entry about this a in his his post.

 

Regards,

-Eric

----
Eric Forgette
Software Engineer
MFIT - Virtualization & Enterprise Applications BU
NetApp

Average User Rating
(2 ratings)
chriskranz chriskranz  says:

Thanks for the direct link to the tool, I couldn't find it the other day.

 

On checking, I've just noticed that it's not actually on the main toolchest page? Or atleast I can't find it!

 

Cheers! A life saver of a tool!

Andrew Miller Andrew Miller  says in response to chriskranz:

Wonderful tool -- thanks for your work on this Eric.

Andrew Miller Andrew Miller  says in response to chriskranz:

For what it's worth, it's still not on the main ToolChest page (I went looking there first for it).

 

https://now.netapp.com/eservice/toolchest

astueve-neo astueve-neo  says in response to Andrew Miller:

We have tested it on a Windows VM, and it does as advertised.

 

Findings - a 20Gb windows partition took 22 minutes to re-align. This was using NFS storage over 1Gb network.

 

Things to know

  1. the VM must be off while this is run
  2. a thin provisioned VMDK becomes thick in the process.

 

Down time is difficult to schedule, but if you are on SIS enabled volumes, you will get your space back.

forgette forgette  says in response to astueve-neo:

Hi Andrew,

     Thanks for your post.  There are a few things you can do to increase your performance.  The first thing will address the thin to thick conversion as well.  There is a --sparse option that instructs the tool to create a 'thin provisioned VMDK' (regardless of source type).  This obviously results in fewer blocks being consumed, but it also increases the speed becuase the tool doesn't have to write all the zero filled blocks.  The other option you might explore is the --bs option.  This allows you to specify the size of the block that the tool works with.  You can get a list of all the options by running the tool with --help.

Hope this helps.

BrendonHiggins BrendonHiggins  says:

Thanks will give it a go next week.

 

Bren

c_delporte c_delporte  says:

Hello,

 

With Windows2000 and windows 2003, mbalign doesn't support "Logical partition"

Result off mbralign :
"P1 is an extedned boot record.  This is not supported"

 

are there a workaround ?

 

Thanks. Christophe

forgette forgette  says in response to c_delporte:

Hi Christophe,
    There have been two versions of mbralign posted to the toolchest.  The first version is 1.2, which doesn't support EBR.  The 1.4 version was posted to the toolchest last week, however the documentation has not been updated yet.  The new version (1.40090416) will handle EBR (Logical partition).  You can tell which version you are running using the help option.

 

The following output is from mbralign 1.40090416:

 

[root@esx16 root]# mbralign --help

 

mbralign version 1.40090416.
Copyright 2009 NetApp

 

mbralign - Align MBR partition table based vmdk files to NetApp storage systems

 

Usage: mbralign [OPTION]... SOURCE
   or: mbralign [OPTION]... SOURCE DEST
   or: mbralign [OPTION]... SOURCE DIRECTORY
Options:
   --sparse          The resulting file will be sparse.  This option is
                      designed for NetApp NFS based datastores.
   --force           The default behavior is to skip properly aligned disks.
                      The --force option can be used to
                      override this. (Useful for migrating and making sparse).
   --bs=n            Use n as the block size (specified in kB).  n must be one
                      of (8, 16, 32, 64, 128, 1024).  The default is 8.
   --preview         Show what would be done, then exit.  No changes are made
                      to the file.
   --quiet           Only print warnings and errors (no other status is
                      printed to screen).
   --debug           Print debug comments.
   --help            Print usage.
   --thereAreNoVmSnapshots  Suppress the warning message about snapshots and

                             answer YES to the question of whether to continue.

 

Hope this helps,
-Eric

aarondelp aarondelp  says:

Eric - First off, thank you for the tool!  It has saved me a lot of time and headaches!

 

Since you can not use the mbralign tool on Windows Dynamic Disks and Linux LVM's, what is the best way to correct them?  I have a customer that has a bunch of both types.  I can't seem to find anything on what to do when you CAN'T use mbralign.

Andrew Miller Andrew Miller  says in response to aarondelp:

Create an aligned vmdk, copy the data into it, flip drive letters/mount points, remove old drive. Not ideal but doable with some down time....

 

Vizioncore's vOptimizer Pro does also handle this to a certain degree...

 

http://www.vizioncore.com/products/vOptimizerPro/

forgette forgette  says in response to aarondelp:

Hi Aaron,

 

I'm glad the tool has been helpful.

 

Andrew is spot on.  To get the OS data, you may have to attach the misaligned vmdk file (source) and the new aligned vmdk (destination) file to a separate VM, then perform the copy.  This is because the running OS may have locked files that aren't accessible until the OS is shutdown.

 

I have heard that vOptimizerPro will deal with Windows Dynamic Disks, but I'm not sure about LVM.  Linux has some wonderful tools for data migration though (cp, rsync, cpio, dump/restore, dd).  The simplest to used is probably dd.  You can create a new properly aligned volume (or partition) and dd the old to the new (after umounting the old).  Then as Andrew described, you simply mount the filesystem from the new aligned  volume (or partition) onto the previous mount point.

 

Hope this helps,
-Eric

aarondelp aarondelp  says:

Thank you Eric and Andrew for your comments!  I did some testing this morning on Windows 2003 Server and I found something a little different for Dynamic disks.  No matter what I did, once it was a dynamic disk, mbrscan show it as not aligned.  Looks like the only way around this is to stand up a basic disk and then copy the data from the dynamic disk to an aligned basic disk.

 

I tried creating a basic disk and aligning it first.  I then converted to to a dynamic disk.  mbrscan shows it as no aligned.  Looks like vOptimizerPro (I haven't dealt withit) is the only way to align a dynamic disk.

 

Any thoughts?

 

Thank you!

astueve-neo astueve-neo  says in response to aarondelp:

I had the same issues with creating an MBR aligned disk with Dynamic disks.

 

It seems to be a Win2k3 issue, that when you convert a disk to Dynamic, Win2k3 automatically changes the partition.  Even if you pre-partition the device, it resets it.

 

Given that this is a Win2k3 behaviour, I am not sure even vOptimizerPro will fix this.  You will have to test.

forgette forgette  says in response to aarondelp:

Ah, yes.  Sorry, I should have commented on this earlier.  The small amount of testing I did resulted in what you discovered.  It looks like the volume manager (Dynamic disk manager) is modifying the partition table in the MBR in both aligned and misaligned cases (probably to maintain compatibility).  In any case both msinfo32 and mbrscan are correct with regard to what the partition table says.  The mbrscan tool does not go the next step, which would be to read the dynamic disk metadata and determine the actual starting offset of the volume (Dynamic disk) and therefore the filesystem.  I'm guessing that msinfo32 is doing the same thing that mbrscan does, which is to simply report what is in the partition table.

 

One of our super Systems Engineers, Jason Pierson, pointed me to the dmdiag.exe tool.  This seems to be the best way to detect the alignment of a Dynamic disk.  It is a Windows executable, so you'll have to execute if from the guest operating system.  The starting sector is reported as "Rel Sec" in the "Dynamic Disk Information" section of the output.  Because this value describes disk sectors (512 bytes), any value divisible by 8 (without remainder) indicates a properly aligned volume.  If you use this tool, you should see the disk you created and aligned (durning the test you mentioned) is actually aligned even after you convert it to a Dynamic disk.

 

The dmdiag.exe  tool is in the Windows 2000 Resource Kit, but seems to work on win2k3 as well.  A link to the installation is provided in Microsoft knowledge base article 927229.

aarondelp aarondelp  says:

Good Afternoon Eric - A little more information and one or two questions for you.  I created two 2 GB partitions.  I made them both basic and then aligned one of the two.  I then converted them to dynamic.

 

The dmdiag tool you provided above doesn't show the information you need that I could tell.  But, the dmdiag from the XP Support Tools does provide the information.  Here is a post from a section of it:

 

---------- Dynamic Disk Information -----------
DiskGroup: Win2k-test2Dg1
  Group-ID: 945ac856-ebce-4108-a29e-dd3c3cd2d32d

 

   Sub Disk       Rel Sec  Tot Sec     Tot Size      Plex             Vol Type  Col/Ord  DevName    State 
   ========  =======  =======  ========  ====             ========  =======  =========  ======
   Disk1-01       63            4176837   4194304     Volume1-01    Simple    1/1      Harddisk1  ONLINE
   LDM-DATA  4192256  2048                                                              

 

   Disk2-01       64       4176837  4194305  Volume2-01  Simple    1/1  Harddisk2  ONLINE
   LDM-DATA  4192257  2048

 

Are you talking about dividing the Rel Sec value under the LDM-DATA line by 8 (4192256 for the first one and 4192257 for the second one)?  If so, then yes, my first volume was aligned prior to conversion and the second one was not so that would make sense.  Can you confirm that for me?

 

I was also wondering for Windows 2008 Server.  I hear that none of this matter anymore.  Is that correct?  Does it depend on the disk type at all?

 

Thanks again!!

forgette forgette  says in response to aarondelp:

Sorry for the confusion.  The "Rel Sec" I was referring to is 63 for Disk1-01 and 64 for Disk2-01.

 

It looks like Disk1 was a default MBR starting at 31.5KB (63 * 512 = 32256 bytes) which is misaligned.  Disk2 looks like it was aligned prior to becoming "Dynamic" since it starts at 32KB (64 * 512 = 32768 bytes).

 

I took a short cut and suggested that if this value is divisible by 8, the alignment was correct.  The full explanation is;
Each sector is 512 bytes.
Data ONTAP/WAFL works in 4KB blocks.

So, the divide by 8 rule is based on: (4096/512 = 8).

 

Disk 1 is misaligned (63/8 = 7.875), while Disk 2 is properly aligned (64/8 = 8).

 

With regard to Windows 2008, the default offsets (depends on size) for new partitions is evenly divisible by 8.  Therefore, manual alignment is no longer required.  I'm not sure what the impact is to Dynamic disks to be honest.  In my humble opinion, once you've virtualized your server and your storage, volume managers become a lot less interesting. 

 

BTW:  Something to keep an eye out for; If you're using a NetApp LUN as an RDM, connected to a  Windows 2008 VM, the lun type should be Windows_2008.

aarondelp aarondelp  says:

Eric - Thank you!  Of course, you are correct, I was looking at the wrong ones!  Because I know one of my customers will ask, if you have a win2k3 server and upgrade it to 2k8, the partitions will still not be aligned.  Makes sense, but I wanted to test it.  It didn't matter if they were basic or dynamic.

 

Also, both basic and windows disks in w2k8 are aligned by default and the XP mmdiag runs on 2k8 fine.  The moral of the story is to start fresh with w2k8 if at all possible and then there is no need to worry about alignment.

 

Thanks again!

forgette forgette  says in response to aarondelp:

Aaron,
    I'm glad to have helped.  Also, thank you!  I think this set of comments will help others as well.  I appreciate your time and effort getting to the bottom of this.
Cheers!

Andrew Miller Andrew Miller  says in response to aarondelp:

And...just a side note, what are the main reasons you've seen that people use dynamic disks inside Windows VMs?

 

I've generally recommended people stick with Basic Disks if at all possible.

aarondelp aarondelp  says in response to forgette:

Hey Eric - Another mbrscan question for you.  What will Linux LVM partitions look like with the tool?   I have a customer that will be doing scans on a bunch of LInux vm's and some will be standard and some may be LVM.  I know what a standard Linux output looks like.

 

Thank you!

forgette forgette  says in response to aarondelp:

Hi Aaron - The logical volumes are likely contained in a MBR partition.  mbrscan will only report on partitions, not the individual volumes contained within it.

aarondelp aarondelp  says in response to forgette:

Hey Eric - but what will mbrscan report?  For instance, windows will do somthing like this:

 

win2k3-test-flat.vmdk p1 (NTFS)    lba:64    offset:32768    aligned:Yes

 

A Windows Dynamic Disk (which you can't align):

 

win2k3-upgrade_2-flat.vmdk p1 (unknown - 0x42)    lba:63    offset:32256    aligned:No

 

A Linux Disk:

 

000063-Ubuntu-Tools-flat.vmdk p1 (Linux)    lba:63    offset:32256    aligned:No
000063-Ubuntu-Tools-flat.vmdk p2 (EBR )    lba:19984860    offset:10232248320    aligned:No
000063-Ubuntu-Tools-flat.vmdk e1 (swap)    lba:19984923    offset:10232280576    aligned:No

 

Since you can't use mbralign on Linux LVM's, what will mbrscan report as the type?  Is there anyway to tell LVM volumes from regular volumes like you can with Windows Basic and Dynamic disks?  I want to make sure our customer isn't trying to align LVM volumes but I don't know what they will look like to warn them.

 

Thank you!!

forgette forgette  says in response to aarondelp:

Unfortunately, it depends.  The mbrscan tool only reports what is in the partition table, it does not interrogate the partition itself.  For example : If the administrator assigned an ext3 label at the time the partition was created, then added the partition to a volume group, mbrscan will still report it as Linux (because the partition information would contain 0x83).  If the administrator created the partition durning the installation process, there is a higher likely hood that the partition would have the correct label (0x8e) and mbrscan would therefore report 'LLVM' for Linux Logical Volume Manager. 

fletch2007 fletch2007  says in response to forgette:

Found a VM with a 40Gb flat vmdk file reported as GPT format by mbrscan - what is the procedure for interrogating and aligning these?

 

thanks

 

[root@esx-01 v3]# /opt/netapp/santools/mbrscan vm/*flat*
--------------------

vm/vm_2-flat.vmdk - GPT format, skipping...

aarondelp aarondelp  says in response to forgette:

Hey Eric - Are there any known issues with mbralign and Cirtix Presentation Servers?  We had a customer that wasn't able to align 3 servers this weekend.  A bunch of other servers worked great but they managed to make 3 servers non-bootable after alignment.

 

The error presented states that login interface DLL's can not be loaded and the servers will not boot.  I can provide screenshots if needed.  Is this because Cirtix does some funky things with the drive letters (M:\ and N:\ in this case)

 

Also, mbrscan reported that the partitions were basic disks and looked fine, nothing different than any of the other servers (non-Cirtix) that worked great.

 

Thanks!

fletch2007 fletch2007  says in response to aarondelp:

Avoid wildcard with mbralign

I am running 1.4 (latest from HUK 5.1) and have noticed when you run:

 

mbralign vm123/*flat*vmdk

 

It will run but leave bad filenames of the form

 

vm123/*flat-flat.vmdk (adds a -flat)

 

Then the VM will not boot due to filename not found

 

I've been able to recover from all but one of these by manually sorting out what the tool should have done with filenames

But maybe this could be addressed in the next version of the tool

 

Oh, and integration with storage vmotion for zero downtime alignment too

 

thanks!

forgette forgette  says in response to aarondelp:

Hi Aaron,

     Yes, this is a known issue.  There is mention of it on the download page for the individual tool, but I don't know if it is mentioned in the ESX Host Utilities Kit documentation.  Here is the statement:

 

"It has been reported that there are issues when the OS drive has been mapped to something other than C (Windows). The report explains that Citrix provides a remapping tool that changes C: to M:. The tool should not be used on these disks."

 

Cheers

forgette forgette  says in response to fletch2007:

Hi Fletcher,

 

Good point! 
We didn't design mbralign to use wildcards, so you will get some strange results.  We have had reports of customers writing scripts that use a simple 'for loop' or the find command (with -exec) to run mbralign on all vmdk files in a directory to address this.
This is the primary reason we added the --thereAreNoVmSnapshots flag.  Of course, you'll want to verify that there are no snapshots before you use that flag. 
Thanks for the feedback!
Cheers

aarondelp aarondelp  says in response to forgette:

Eric - I never say that one before!  Thank you for the heads up!  Now I know...

aarondelp aarondelp  says in response to forgette:

Hey Eric - I have another one for you.  Have you ever seen a windows vm that loses the d: (or any drive other than c:\)?  We have a customer running a bunch of alingments and every once and awhile a d:\ will be aligned but the system will come back up without the d:\.  They will then have to go into the disk manager and reassign the d:\.  It is there, just the mapping to the drive letter is gone.

 

Seen this?

 

Thanks!

forgette forgette  says in response to aarondelp:

Hi Aaron,

Yes.  Windows (I haven't tested all versions) stores the 'drive letter to filesystem' mapping in the registry.  This information takes into account the offset of the filesystem from the beginning of the drive.  So, when mbralign moves the filesystem, the mapping is lost.  The good news is that no data is lost, the filesystem is intact and simply needs to be remapped to the drive letter.  The better news is, well, stay tuned for the better news (its coming)!

aarondelp aarondelp  says in response to forgette:

Thank you Eric!!

aarondelp aarondelp  says in response to forgette:

Eric - I put together an article with everything we have discussed here and some best practices around the tool.  I wanted to get it all down somewhere before the new tools come out.  Please check it out when you can and let me know what you think:

 

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

 

Thank you!

forgette forgette  says in response to aarondelp:

Hi Aaron,

Thanks for putting that post together.  I think its a great resource.  While I can't comment on specifics, 'shortly' is probably overly optimistic with regard to a plugin.  You can however use mbralign and mbrscan on ESX 4.0.  In fact the NetApp VMware Host Utilities Kit is fully supported on ESX 4.0.
Thanks again for all your work on this!
Cheers,
-Eric

aarondelp aarondelp  says in response to forgette:

Hey Eric!  Now that VSC is out, can you tell me if the alignment tools has the same caveats that the previous tool did?  I know I need to RTFM and I will in the next few days but just wondering if there is anything you wanted to add.

 

Did you help with the VSC tool?

 

Thanks!

forgette forgette  says in response to aarondelp:

The VSC has a slick way to get the binaries to the host, but they are the same binaries. 

 

I didn't work on the VSC directly, however our teams work very closely.

 

Cheers!

Bookmarked By (0)

More Like This

  • Retrieving data ...