tkutil
Enthusiast
Enthusiast

FIx Block Alignment

What solutions/alternatives are available to take a VM that was not block aligned and make it aligned?

One thought was to create a block aligned VM and then recover the non block aligned VM to it with ASR and backup software.

Tags (2)
0 Kudos
15 Replies
patrickds
Expert
Expert

For the system disk that would be the only solution: backup, create new disk with aligned partitions, restore. Using an imaging solution for the backup/restore will be faster.

For additional disks, you can also attach a new vmdk, create aligned partitions on it, and copy all the data.

Then remove the original, unaligned vmdk, check drive letters and you're good to go again.

tkutil
Enthusiast
Enthusiast

That is what I was thinking for the system disk as well, but you have me curious about your comment about an imaging solution. Could you expand on that? My thought was to use our backup software EMC Networker to do a tape restore with ASR, but after reading the directions it didn't seem the cleanest or easiest way to go about this.

Thanks

0 Kudos
patrickds
Expert
Expert

With an imaging solution i mean something like Ghost, Acronis True Image, Drive snapshot, or any Linux rescue CD you like using the dd command.

Create a new vmdk and create new, aligned partition on the new vmdk, and attach it to the VM.

Boot your VM with a bootable CD or floppy image containing your chosen solution.

Use the imaging solution to copy the unaligned partition over to the new aligned one.(don't copy the disk, or you'll just copy the misalignment as well)

Remove the old vmdk from the VM.

You will probably have to take some additional measures to make the new disk bootable.

When you use a normal backup solution, you'll have to install your guest OS, and then restore your backup on it, which takes quite some time.

I don't know ASR (not even what it is), so cannot comment on that.

That said, there probably isn't much to gain by aligning system partitions; not enough to be worth the trouble anyway.

I usually stick to aligning partitions on the data disks for VMs containing databases, mailservers, and anything disk intensive.

If you only have one disk in your VM, containing both your OS and data, that's another thing, and you may wan to try the above method.

0 Kudos
titaniumlegs
Enthusiast
Enthusiast

NetApp has a tool called mbralign. It's free, but not readily available yet. If you know somebody at NetApp they may be able to get you a copy. Rumour has it, it may become available on the NOW Toolchest soon. I know the guy who wrote it, and I know the guy who wrote the documentation really, really really, well. Smiley Wink

Vizioncore vOptimizer can do it.

Some P2V tools (Vizioncore, PlateSpin) claim to align, but I haven't tested them.

All of these can align a boot disk or data disk, but require down time per VM.

Peter

Share and enjoy! Peter If this helped you, please award points! Or beer. Or jump tickets.
0 Kudos
happyhammer
Hot Shot
Hot Shot

take a look at vizioncore vOptimizer which will resize and re align vm's

0 Kudos
tkutil
Enthusiast
Enthusiast

Hi patrickds,

Could you explain the procdure to do this with Ghost please? I've been trying various ways and still cannot get this to work.

Thanks

0 Kudos
patrickds
Expert
Expert

Could you explain the procdure to do this with Ghost please? I've been trying various ways and still cannot get this to work.

I haven't done this myself, but it should be pretty straightforward, like i described in previous post.

Test this on a non-production VM first.

- add a new vmdk to your VM, and create the aligned partition (diskpart on windows)

- restart your VM with your bootable CD containing Ghost or whatever imaging software you use (may need to add drivers for VM scsi adapter)

- copy the unaligned partition from the original vmdk to the aligned partition on the new one (be sure you copy partition to partition and not disk to disk)

- when done, shutdown and remove original VMDK, change SCSI ID of new vmdk to match the old one.

- Boot up the VM (you may need additional work to make the new disk/partition bootable, probably booting it using an installation CD of the installed OS will enable you to fix this)

Or you could download a trial of VMOptimizer and let that handle it, like a previous poster suggested.

0 Kudos
titaniumlegs
Enthusiast
Enthusiast

NetApp has now posted mbralign on the NOW Toolchest. You need a NOW account to get to it.

Enjoy!

Peter

Share and enjoy! Peter If this helped you, please award points! Or beer. Or jump tickets.
0 Kudos
chouse
Enthusiast
Enthusiast

Is the realignment process that vOptimizer uses non-destructive to the data in the partition? Can I point it at an existing partition with data, have it do its thing while the VM is offline, and then when it finishes, power on the VM and see that the data is still there?

0 Kudos
titaniumlegs
Enthusiast
Enthusiast

I believe so. The NetApp mbralign tool is non-destructive.

Share and enjoy! Peter If this helped you, please award points! Or beer. Or jump tickets.
0 Kudos
chouse
Enthusiast
Enthusiast

Is there anything about NetApp's mbralign utility that is specific to NetApp storage?

0 Kudos
williambishop
Expert
Expert

MBRALIGN from netapp works really well....From what I hear Smiley Wink

It is non-destructive. But you have to have room for a copy of the vm (it copies then does it's magic)

Ita feri ut se mori sentiat
0 Kudos
titaniumlegs
Enthusiast
Enthusiast

Nope. We didn't sabotage it for other people's storage.

Well, actually, we align at 32768 (64 blocks). Some vendors may need to align at 65536 (128 blocks). Check with your vendor or their docs. Or get some NetApp!

Share and enjoy! Peter If this helped you, please award points! Or beer. Or jump tickets.
0 Kudos
pattho
Contributor
Contributor

./mbralign --help

mbralign version 1.40090416.

Copyright 2009 NetApp

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

Usage: mbralign ... SOURCE

or: mbralign ... SOURCE DEST

or: mbralign ... 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 isi

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.

0 Kudos
MHAV
Hot Shot
Hot Shot

Hi tkutil,

you can

1. use the fdisk command on our ESX Console to allign the Primary Boot/SYSTEM Disk of the operating system to do the alignment corret.

2. use the NetAPP Tool to do the alignment more comfortable

3. use vOptimizer wich does nothing else but using the fdisk on the Console of the ESX Server (doesnt work with ESXi)

Regards

Regards Michael Haverbeck Check out my blog www.the-virtualizer.com
0 Kudos