DaveWentzel.com            All Things Data

LUNs

 

What is a LUN?
To understand LUNs you must understand "exported storage".  This is the storage presented to the network from the subsystem after RAID, etc is applied to the physical disks.  Exported storage is referred to by the SCSI term "Logical Unit Number."  This is the partial definition.  To be precise a LUN can be any type of connected storage.  Most SAN folks equate LUN with a virtual disk with exported storage. 
 
Provisioning SAN storage involves defining a LUN on a target port and then assigning that LUN/target port to a logical unit such as "LUN 2 on Port 1". 
 
LUN Masking
This is where the disk subsystem allows or disallows a list of hosts from accessing a LUN.  This happens when LUNs are oversubscribed.  We don't want Host A accesing Host B's LUNs accidentally because they share the same port.  SAN guys, in an effort to obfuscate, consider this a "fencing technology".  Other fencing technologies are VSAN and zoning
 
From a security perspective LUN masking is very weak.  Also, it is easy for this to be misconfigured and cause issues.  Technically, LUN masking works by hiding devices by not responding to initiator inquiries for the given SCSI target. 
 
LUN masking is handled by the Storage Device Manager, generally the disk controller. 
 
Some Random LUN Thoughts
Part of that depends on how they setup the lun.. if you have 1 drawer with 14 drives in it.. and if the SAN guys set it up so that there are 3 luns, each with 4 drives a piece and allocate all the space on those drives to each separate lun.. then the lun and the drive letter they give you are pretty much the same thing.. but you are limited to only 4 drives for each drive letter.  That is not that many heads. 
 
If they want to take all 14 drives and make it one big lun.. and the give you separate drive letters within that lun.. you have more heads going after the data.  That won’t always help, but I am pretty sure that sql can use multipal request to the drives if it sees it as different drive letters.  So you still might get some help by doing it that way.
 
Just whatever you do, don’t let them set it up so that if your database server needs 150 gig, that they give you 150 gig on a drive or 2.  That is what has happened to me.. I didn’t get any say so in it and you can image how poorly the disk is performing.  The higher ups are starting to see the errors of their ways and I think hope we will be changing soon. 
 
 
More Random Thoughts
Just want to note that you may want to be mindful of the potential of running out of drive letters if you use small LUNs (albeit it's not  much an issue if you can make use of mount points). In our shared environments, we usually ask for 100GB LUNs. We always format each LUN as a single volume, and we never create multiple Windows logical partitions on a LUN.
 
Unless the workload of your system is high, mixing data and logs on the same spindle is unlikely to have a measurable performance impact due to the large cache in the SAN.  In practice you are more likely to be hit by a busy file server or print server sharing database spindles than by log and data sharing.  Again, the vendors monitoring software can detect these hotspots, and their data movement software can shift critical files to LUNs on 'cooler' spindles.
 
It's probably true that in most cases, on a shared/well-maintained SAN there is not as much a need for data/log separation as there is on traditional direct-attached storage devices. But if you look at the EMC recommendations, the data/log separation is still being preached as one of the top performance configuration rules. Fundamentally, it still makes sense. We at least try to separate a data LUN from a log LUN, though behind the fabric they may come from the same set of drives. Also from a disaster recovery perspective,  having data and log on different volumes is a good practice.

 

But in a highly centralized SAN environment, the requirement for data/log separation becomes less attainable because the DBAs are simple another group of users, and the SAN folks loathe the notion of making special provisions for any group, perceiving it to be something that would make their lives miserable.
 
Even More Thoughts
A mirrored pair can be accessed by two different target addresses in a SAN because a sinlge LU can be exported by the subsystem through a different port/LUN pair. 
 

Add new comment