First we need the MBRalign tools. You can download them from your vCenter client If you installed IBM N series VSC on your vCenter. If you didn't start installing. This will add a plugin to your VCenter Client. Once thats installed, good luck, select a ESX host and there should be a "IBM N Series" Tab. From there select tools and download.
VCenter IBM N Series Tab |
Once the "mbrtools.tar.gz" file is on the ESX host SSH to that
ESX host create the folder you want the file extracted to. In my case my local accounts home directory is fine. Then move the "mbrtools.tar.gz" file to the new directory and extract the contents.
mkdir /home/esxshell/mbrtools mv /home/esxshell/mbrtools.tar.gz /home/esxshell/mbrtools/mbrtools.tar.gz cd /home/esxshell/mbrtools tar -xzf mbrtools.tar.gzNow we're ready to use ./mbrscan and ./mbralign but before you do make sure of the following.
- The VM is powered off.
- There are no snapshots
- After mbralign you test if the alignment worked before deleting the *mbralign-backup files.
Find all Misaligned VMDK's
./mbrscan --all | grep 'aligned:No'
Command to Align a VMDK
./mbralign --thereAreNoVmSnapshots /vmfs/volumes/......../VM.vmdk
If your storage is an NFS Share you can also use "--sparse" but that option is only designed for NetApp NFS based datastores.
Find all the Backup VMDK Files left over from the mbr alignment
find / -name '*mbralign-backup' 2> list.txt
These files can be deleted if the alignment went successfully and the VM is bootable and all volumes mounted. Test before you remove these.
Output from an successful alignment.
[root@vmhost mbrtools]# ./mbralign --thereAreNoVmSnapshots --sparse /vmfs/volumes Part Type old LBA New Start LBA New End LBA Length in KB P1 07 63 64 61464691 30732313 P2 07 61464690 61464704 286455029 112495162 Creating a backup of /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2.vmdk Creating a backup of /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2-flat.vmdk Creating a copy the Master Boot Record Working on partition P1 (2): Starting to migrate blocks from 32256 to 32768. 12801 read ops in 5 sec. 21.45% read (17.68 mB/s). 16.56% written (0.15 mB/s) Working on P2 (3): Starting to migrate blocks from 31469921280 to 31469928448. 12801 read ops in 7 sec. 99.94% read (13.11 mB/s). 50.14% written (13.11 mB/s) Working on space not in any partition: Starting to migrate blocks. 100.00 percent complete. 50.18 percent written. 71365848KB saved. Making adjustments to /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2-flat.vmdk. Adjusting the descriptor file. [root@vmhost mbrtools]#If the Alignment was Unsuccessful
You can rerun the same "./mbralign --thereAreNoVmSnapshots /vmfs/volumes/......../VM.vmdk" command if you haven't yet deleted the '*mbralign-backup' file and it will prompt you if you want to restore the backed up version. Enter [y/n] to answer
[root@vmhost mbrtools]# ./mbralign --thereAreNoVmSnapshots --sparse /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2_1-flat.vmdk Error: A backup file named /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2_1-flat.vmdk-mbralign-backup was found. This may be from a failed realign. Please remove or rename all files ending in -mbralign-backup. Shall I restore /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2_1.vmdk from the backup I made?Alignment of Linux VMs
Unlike the Windows Virtual Machines you'll have to modify it before the VM will boot. The "howto.pdf" inside the "mbrtools.tar.gz" file has directions on how to fix this.
No comments:
Post a Comment
Please leave a comment; someone, anyone!