Quantcast
Channel: Shivermore
Viewing all articles
Browse latest Browse all 10

- Scanning and Remediating VMs with Misaligned Disks -

0
0

Disks can be aligned using two methods – Functional Alignment and Actual Alignment.  Functional Alignment can, in most cases, be used while the misaligned VMs are still online by creating an “Optimized” Datastore.  Storage vMotion is then used to migrate the VM to the Optimized Datastore.

Actual alignment will correct the misalignment issue at the VMDK level but requires the VM to be powered off.

Scan Datastore with VSC

This procedure will be used to demo scanning of a single VM to check for misaligned disks.  Scanning can be performed on multiple VMs at a time and can also be scheduled to auto-scan at a specified time.

1.  Open the vSphere client and then open the VSC plug-in

diskAlignment1

2.  Select ‘Optimization and Migration’

3.  Select ‘Scan Manager’

4.  Select a Datastore to scan

a.  Note:  If you do not specifically select a Datastore to scan then every Datastore will be scanned.  This should not be done during peak hours

diskAlignment2

5.  Click ‘Scan Selected’

a.  While the scan is active the status will display as “Scanner is RUNNING”

b.  Once the scan is complete the status will return to “Scanner is IDLE”

6.  View the VMs with misaligned disks by selecting ‘Virtual Machine Alignment’ under ‘Optimization and Migration’

7.  Select the ‘Misaligned’ folder

8.  You can sort by Datastore to view VMs on a specific Datastore

diskAlignment3

Enable SSH on an ESXi host

1.  Ensure SSH is enabled on the ESXi host you will be working from

2.  In the vSphere client browse to ‘Hosts and Clusters’

3.  Select the ESXi host you wish to configure

4.  Select the ‘Configuration’ tab

5.  Click the ‘Properties…” link to the right of ‘Services’

diskAlignment4

6.  Select ‘ESXi Shell’ and click ‘Options…” at the bottom

7.  Click the ‘Start’ button

8.  Select ‘SSH’ and click ‘Options…’ at the bottom

9.  Click the ‘Start’ button

diskAlignment5

10.  Check ‘Firewall’ settings to ensure that ‘SSH Server’ is enabled by clicking ‘Options…’ to the right of ‘Firewall’

diskAlignment6

 

Install MBR Tool

1.  Connect to the vCenter server using the vSphere client

2.  Select ‘NetApp’ icon from the ‘Solutions and Applications’ section from the vCenter server home page

3.  Select the ‘Tools’ link under ‘Monitoring and Host Configurations’

4.  Create a folder on your local hard drive called mbrtools

5.  Click the ‘Download’ button for ESXi 5.x and save to the folder you just created

diskAlignment7

6.  Select ‘Hosts and Clusters’ under the ‘Inventory’ section from the vSphere home page

7.  Select the ESXi host you will be running the MBR tool from, click the ‘Configuration’ tab and then click ‘Storage’ under ‘Hardware’

8.  Locate the ESXi local host Datastore

diskAlignment8

9.  Right-click the local Datastore and select ‘Browse Datastore’ from the dropdown menu

10.  Make sure the root folder is selected and click the ‘Upload Files’ icon to upload the mbrtools_esxi.tgz file

11.  SSH into the ESXi host

12.  Change directories to the location of the local Datastore

a.  # cd /vmfs/volumes/<insert local Datastore name>

13.  Copy the mbrtools_esxi.tgz file

a.  # cp mbrtools.esxi.tgz /

14.  Change directories back to /

a.  # cd /

15.  Extract the mbrtools by executing the following command:

a.  # tar –zxvf mbrtools_esxi.tgz

Scan Guest OS File System to verify alignment

Note:  you must power off the VM before running mbrtools commands.

1.  Change directories to the Datastore holding the VMs VMDK files

a.  # cd /vmfs/volumes/OS_FC_31/exchw2k3b

2.  Execute the mbrscan command against the <vmname>-flat.fmdk file

a.  #  /opt/ontap/mbrscan exchw2k3b-flat.vmdk

3.  Review output to see if the disk is aligned.  Output should be similar to the example below for misaligned disks:

diskAlignment9

Align the VMFS of a server

Note:  Ensure the VM is powered down

Note:  mbralign can only align one vmdk at a time

Note:  All VMware snapshots and linked clones must be deleted prior to mbralign

Note:  File system alignment can take an average of 5+ minutes.  The time it takes is directly proportional to the size of the VM.  Converting a 30GB vmdk took 16 minutes

Note:  Before proceeding with the alignment process, ensur sufficient space is available in the Datastore that the vmdk files to be aligned reside.  If the vmdk file to be aligned is 2GB, the Datastore must have at least 4GB of free space to accommodate both vmdk files

Note:  The GRUB boot loader must be reinstalled on the Linux guest OS after boot partition alignment

Note:  VMDKs that contain GPTs are not supported

VMDKs that contain Linux logical volume manager (LVM) are not supported

1.  Execute the mbralign command for each vmdk requiring alignment

a.  # /opt/ontap/mbralign exchw2k3b-flat.vmdk

2.  Read through the warning to ensure all tool compliance parameters are meet (same as the notes above)

diskAlignment10

3.  When ready press ‘y’ and press enter to start

4.  Progress is logged in your putty session

diskAlignment11

5.  Once the operation is complete you should re-run the mbrscan tool to confirm the disk is aligned

a.  #  /opt/ontap/mbrscan exchw2k3b-flat.vmdk

diskAlignment12

6.  Verify the VM powers on and is functional

7.  Delete backup files once the server tests as good

a.  From the vSphere client browse the Datastore that contains the VM

b.  Delete the following files:

i. <vmname>.vmdk-mbralign-backup

1.  Example:  exchw2k3b.vmdk-mbralign-backup

ii. <vmname)-flat.vmdk-mbralign-backup

1.  Example:  exchw2k3b-flat.vmdk-mbralign-backup

Rollback Procedures

In this example we will look at what steps to take if a vmdk becomes corrupt after running the mbralign tool.

1.  SSH into the ESXi host that you have installed the mbrtools

2.  Browse to the Datastore that contains the VMs vmdk files

a.  # cd /vmfs/volumes/OS_FC_31/exchw2k3b

3.  List the files in the VM directory using the ‘LS’ command to confirm the following files exist:

a.  <vmname>.vmdk

b.  <vmname>-flat.vmdk

c.  <vmname.vmdk-mbralign-backup

d.  <vmname>-flat.vmdk-mbralign-backup

4.  Delete the corrupted vmdk files

a.  # rm exchw2kb.vmdk

b.  # rm exchw2kb-flat.vmdk

diskAlignment13

5.  Rename the mbralign backup files

a.  # mv exchw2kb.vmdk-mbralign-backup exchw2kb.vmdk

b.  #mv exchw2kb-flat.vmdk-mbralign-backup exchw2kb-flat.vmdk

diskAlignment14

6.  Power on the VM from the vSphere Client


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images