EMC Developer Network
 

EMC Developer Network - Mapping VMFS Volumes to Symmetrix

Mapping VMFS Volumes to Symmetrix

April 2008
Contributed by - David Chandler and Bogdan Nicolae

Abstract

Mapping VMHBA's and VMFS volumes to Symmetrix logical volumes within a VMware ESX environment is not the easiest task to perform manually. Using the native Linux tools and inq software from EMC, this operation becomes easier, and the ability to document fully the VMware environment becomes less time consuming. The common denominator in mapping Linux device files to VMFS volumes to VMHBA's to Symmetrix logical volumes, comes in the form of the device WWN, as seen from the Symmetrix, and the links between VMFS volumes and the Linux device files.


The problem

We walked into a VMWare environment, with little to no documentation of what Symmetrix disks were mapped to which VMFS volumes, due to a not so well thought out naming convention. We decided to set out and try to find this information out. We tried to use Virtual Center and inq.linux to find a common ground that was easily mapped, to no avail. Although we were able to map the disks to the standard naming convention for Linux disks, there was no way to map those to VMFS volumes. Our goal was to be able to find the mappings without removing the disk one at a time, as the ESX servers are in production. Using a combination of EMC software and native linux tools we were able to successfully create a mapping of Symmetrix Device ID's to VMHBA's and LUNS (from the VMWare perspective).


The environment

The environment we found included:


  • VMWare ESX 3.5 (Build 64607)
  • Symmetrix DMX3000
  • Virtual Center 2.5

Additional EMC software needed for the solution:


  • inq.linux

Operating requirements:


  • Place the inq.linux application in the root (/) directory
  • Execute the script from the root (/) directory
  • Make sure that the script is executable (chmod 755)

The process

First we had to find a common ground between the inq.linux output and how VMWare looks at the disk. This took a little time to figure out, but we found a common ground in the device file names created for the VMFS volumes and the WWN of the Symmetrix Device. The VMFS devices (listed in /vmfs/devices/disks are derived from the WWN of the Symmetrix Devices) are named using the WWN of the Symmetrix Device, they are further linked to a friendly name. Once we figured this out and tested it, we were able to start working on the script.


The second operation was to format the ouput so that it is readable, which was done using the native Linux tools that are bundled and installed by default with ESX Server


Here's the code



#!/bin/bash

## Get the WWN of the visible SYM devices and output to a temp file ##

/inq.linux -sym_wwn > /tmp/symmdev_wwn.out

## Clear the screen for ease of readability ##

clear

## Parse the SYM devices and associated WWN of devices ##

cat /tmp/symmdev_wwn.out|grep "/dev"|awk '{print $3,$4}' > /tmp/symmdevwwn_only.out
printf "SymDev\tSym Serial#\tSize\tVMHBA\n\n"

## For each WWN of SYM devices, match up to linked device file ##

for dev in `cat /tmp/symmdevwwn_only.out|awk '{print $2}'`
do
        symserno=`/inq.linux -sym_wwn -nodots|grep $dev|awk '{print $2}'`
        devid=`/inq.linux -sym_wwn -nodots|grep $dev|awk '{print $3}'`
        GB=`/inq.linux -nodots|grep -i $devid|awk '{print ($7/1024)/1024}'|sed 's/\./ /g'|awk '{print $1}'`
        MB=`/inq.linux -nodots|grep -i $devid|awk '{print $7/1024}'`
        if [ $MB -gt 1024 ]
        then
                printf "$devid\t$symserno\t$GB GB\t"
        else
                printf "$devid\t$symserno\t$MB MB\t"
        fi
        if [ $devid == "00000" ]
        then
                printf `ls -latr /vmfs/devices/disks|grep $dev|grep vmhba|awk '{print $9}'|head -1`"\t(VCMDB)\n"
        else
                ls -latr /vmfs/devices/disks|grep $dev|grep vmhba|awk '{print $9}'|head -1
        fi
done

You can see the mappings in the output shown below. The script output gives you the ability to go back to Virtual Center and mapp the Symmetrix Devices to VMHBA adapters, the size of the volume, whether or not the device is the VCMDB, and to which array it is allocated from (providing you have multiple arrays presented):



SymDev Sym Serial# Size VMHBA

00000 00018788xxxx 45 MB vmhba0:0:0:0 (VCMDB)

007FE 00018788xxxx 385 GB vmhba0:0:19:1

0082D 00018788xxxx 385 GB vmhba0:0:20:1

0085C 00018788xxxx 385 GB vmhba0:0:21:1

00756 00018788xxxx 406 GB vmhba0:0:22:1

0077E 00018788xxxx 406 GB vmhba0:0:23:1

About the Authors

David Chandler and Bogdan Nicolae are Sr. Storage Operations Specialists within the EMC Federal Residency Program. David currently holds the EMC Technology Architect (EMCTA) certification, with a specialization in SAN. His area of expertise is Storage Networking, Symmetrix, and BURA. Bogdan is a VMware Certified Professional, and his area of expertise is Storage Networking, Virtualization, and Microsoft technologies.


Discuss

Click here to discuss this article