Storage

You are currently browsing the archive for the Storage category.

Storage / SAN Terminology

I realized as I reread my last posts that I used a lot of terminology related to storage and SANs that I didn’t do a very good job of explaining what they actually mean.  Additionally you’ll find that, as with any other field of IT, some terms begin to have double meaning and are used as a general term for something else.  I’d like to spend some time to review some of the more general terminology in regards to SANs and storage.  And in no particular order….

LUN – Logical Unit Number.  LUN actually comes from the SCSI world.  Basically an LUN represents an individual device (A disk) which is part of the target (The SAN Cluster).  LUN seems to be hang-over from the older SAN days and many different people have different opinions as to what its definition is.  I like to think of an LUN as a mapping to a disk.  So, in the old FC SANs I worked on, we would carve a disk out of the array, put them in a RAID configuration, and then attach an LUN number to them.  The concept is very much the same in ISCSI.  You create a disk on the SAN and it gets a IQN (defined below) attached to it.  The IQN is how the disk is identified on the SAN.

HBA – Host Bus Adapter.  Think of the HBA as the connection between a system and the SAN.  With Fiber Channel SAN it’s usually something like a QLogic Fiber card, with ISCSI it’s either the NIC that attaches you to the ISCSI SAN or a dedicated Hardware HBA that does more of the processing for you.

Zoning – Really more of an FC term.  When you were working with SAN switches you would create aliases for all the WWN (World Wide Numbers) which were the unique identifiers for SAN endpoints.  For instance, each HBA would have a WWN as well as each other device such as the disk controllers and so on.  After I aliased each WWN with a name (EX: 20:00 00:e0:8b 02:02:05 equals HBA1_Server2) I would put everything that needed to talk to each other in its own zone.  So, I might have a zone for Server2 which would include both of its HBAs and both of the disk controllers.  Or I might have a backup server that needed to talk to the disk controller and the tape library.  So that zone would include all the aliases for those devices.  Then only items in their own zone could talk to each other.  Similar to VLAN’s on a Ethernet network.

FC – Fiber Channel.  SANs were originally only FC due to the speed you needed to get for direct disk access.  The advantage to FC was that it forced you to create a separate network for disk.  No one had fiber for their normal servers so you had to put in an FC infrastructure designed just for disk access.  Now you can run ISCSI on a standard Ethernet network.  If not implemented separately/correctly you can have a lot of issues.

IQN – ISCSI Qualified Name.  Like a WWN it’s the identifier for the ISCSI network.  Each device that is going to communicate on the ISCSI network needs one.  When I create a Volume of a Snapshot on my LeftHand SAN the SAN also creates IQNs for each of them.  When I go on my ESXi host or on my server I will need to know what the IQN is for the volume I want to attach to.  Conversely you can use CHAP in which case you don’t need to know the IQN of the server you want to attach to.  As long as CHAP authenticates on the initiator side the volumes will come down to the server.

ISCSI – Internet Small Computer System Interface.  Basically let’s you encapsulate SCSI disk commands within Ethernet segments , so you have a SAN that works over long distances on existing infrastructure.

ISCSI Software Initiator – Uses your standard NIC and a piece of software to process ISCSI commands.  MS has a software initiator that you can download for free and use with their OS’s.

ISCSI Hardware Initiator – In the SAN world this is more or less an ISCSI HBA.  It’s usually a designated card that handles all of the processing of the ISCSI traffic.  It also usually has a built in bios allowing you to boot from ISCSI should you decide to do so.

TOE – TCP Offload Engine.  TOE Cards are a little more common that full ISCSI HBAs.  More often than not, a built in NIC might have TOE allowing it to offload some of its processing on the card but still requires some of the host systems CPU time for processing.

Spindle – An actual hard drive within an array

Disk / Volume – This is another term (or set of terms) that people use semi-interchangeably.  For instance on the older FC SANs I worked on, a disk represented an actual spindle.  When we carved volumes out of a SAN we specified 2 or more ‘disks’.  They were all numbered and you literally could pick which ones you wanted in each volume.  So a disk was a spindle and the volume was a group (in RAID) of spindles.  Now with the advent of Virtual SAN environments all of your storage is just seen as one large pool.  So you have an underlying RAID configuration and then the disk is presented to the SAN on top of that.  You make volumes from the available raw space.  Disks and spindles don’t really come through in the configuration side.

Tags: ,

The LeftHand Backup Script

I know I said that Part 5 would be my last LeftHand post for the time being but I couldn’t resist building a script to test out all of the scripting commands we just went through.  So I created two scripts that do the following.

Start.bat
-Creates a snapshot of a volume
-Assigns it to a server
-Attaches it to the server for access

End.bat
-Logs the ISCSI session off
-Un-assigns it from the server (removes the target portal)
-Deletes the snapshot

Take a look at it if you’d like, feel free to use any of the code yourself.  If you are going to use the entire batch file yourself, I ask that you leave the header in place that gives credit to this blog.  I’m contemplating making a CHAP version as well but I’ll have to find some time first.

DISCLAIMER
I, in no way, shape, or form guarantee this code to work.  It worked on my configuration but you might need to tweak it a little yourself.  I tried to document it as best as I could. Furthermore I am not claiming this as my own completely original work.  I used a lot of other concepts and examples that I found online to build the scripts.

Tags: , ,

In the last 4 posts I showed you how to configure a LeftHand VSA, create volumes, map them to servers, and then attach them to either a ESXi server or a physical Windows host.  Now we are going to learn how to do LeftHand scripting.  The scripting agent of the LeftHand SAN solution is pretty slick.  Alright, lets get right into it…

To start we need to ensure we have a few things in place.  I’m going to be working with a brand new physical server (doesn’t have to be) during this lab and the only item I need to install is the LeftHand CLIQ.  The LeftHand CLIQ is the LeftHand command line management utility.  To get it I suggest you contact your LeftHand support specialist and request it.  I’m not going to walk through the installation since its pretty straight forward but once you get it installed you’ll have access to the CLIQ interface at the command prompt.  In the next section I’m going to walk through a few commands that are of particular use in regards to the LeftHand SAN.  As an FYI you’ll need to enter your relevant info that is specified between the <> brackets.

Create a Snapshot of a volume
cliq createSnapshot volumeName=<volume name>  snapshotName=<snap shot name> login=<cluster IP address> userName=<username for the cluster> passWord=<password for the cluster>

Example – cliq createSnapshot volumeName=Volume1 snapshotName=BackupSnap login=10.20.30.111 userName=admin passWord=admin

Delete a Snapshot of a volume
cliq deleteSnapshot snapshotName=<snap shot name> login=<cluster IP address> userName=<username for the cluster> passWord=<password for the cluster> prompt=<True of False, if you want a prompt before you delete>

Example – cliq deleteSnapshot snapshotName=BackupSnap login=10.20.30.111 userName=admin passWord=admin prompt=false

Assign a snapshot/volume to a server
cliq assignVolume volumeName=<volume or snapshot name> initiator=<The ISCSI name of the host you want to attach to> login=<cluster IP address> userName=<username for cluster> passWord=<password for cluster>

Example – cliq assignVolume volumeName=Volume1 initiator=iqn.1991-05.com.microsoft:backupserver login=10.20.30.111 userName=admin passWord=admin

Unassign a snapshot/volume to a server
cliq unassignVolume volumeName=<volume or snapshot name> login=<cluster IP address> userName=<username for cluster> passWord=<password for cluster>

Example – cliq unassignVolume volumename=Volume1 login=10.20.30.111 username=admin pas
sword=admin

These are only 4 commands out of many more.  If you are interested I have attached a copy of the CLIQ user guide from LeftHand which walks through all of them.

Now that we know some basics of the CLIQ script interface let’s look at scripting with the MS ISCSI software initiator.  The MS scripting engine is installed by default when you install the initiator, all you have to do in order to access it is go to a command prompt and enter ‘iscsicli’ followed by the command of your choice.  Let’s walk through some of the basic commands.

Add a target portal 
iscsicli qaddtargetportal <Target’s IP address>

Example – iscsicli qaddtargetportal 10.20.30.111

Note: The full command here is addtargetportal.  The ‘q’ in front of the command specifies “quick” which means that you don’t have all of the available options for the command.  In this instance we only need to specify the Target’s IP address.  With the full command we can specify port number, CHAP user, CHAP Secret, etc…  If you need any of those options type in ‘iscsicli addtargetportal ?’ to get the full syntax.  In these examples I will not be using CHAP, rather I have specified the servers ISCSI IQN in the LeftHand CMC.

List the available volumes/targets
iscsicli listtargets

Example – iscsicli listtargets

Note: This will return all of the available targets or volumes that you can logon to.  I have found that sometimes I can’t simply add a new volume to the server in the LeftHand CMC and then have it appear when I list the targets.  Rather I have to remove the target portal and re-add it.  You’ll need the IQN value this command returns to use in the Logon command shown next.

Logon to volumes/targets
iscsicli qlogintarget <volume/target IQN>

Example – iscsicli qlogintarget iqn.2003-10.com.lefthandnetworks:mg1:54:volume2

Note: Once you run this command the volume should appear under My Computer provided that it is formatted NTFS.  If not, check the Disk Manager to see if it’s showing up at all.  While doing some testing earlier I found that I couldn’t get the disk to appear despite the fact that it was listed as “connected” in the initiator.  After investing too much time in troubleshooting I uninstalled the initiator, rebooted the server, reinstalled the initiator and everything started working fine again.

Report the mappings
iscsicli reporttargetmappsings

Example – iscsicle reporttargetmappsings

Note: Once you logon to the target this command shows you the details of the actual connection.  For instance it shows you the session ID which is required for the logout command shown next.

Logout of volumes/targets
iscsicli logouttarget <session ID>

Example – iscsicli logouttarget ffffffff8585d6d4-400001370000000a

Note: After you logout of the target the initiator will still show the target.  The next command shows you how to remove that.

Remove a target portal
iscsicli removetargetportal <Target IP Address> <Target port Number (Default 3260)>

Example – iscsicli removetargetportal 10.20.30.111 3260

Note: For some reason I can’t find a ‘q’ version of this command so you need to specify a port number.

Again I have only gone over a few out of the large number of possible commands.  If you are interested in more I have attached the MS document on the ISCSI initiator which, starting on page 113, describes more ISCSICLI commands.

Summary: So as you can see you can do almost anything through both utilities scripting interfaces.  If you put all it all together and work in some temp file scripting (to pull variables) you can make your own backup scripts for your SAN.  If you aren’t interested in building your own, contact your local LeftHand technical resource.  They were able to provide me with quite a few examples.  I don’t think I have seen any that are ‘perfect’ as of yet, but everyone’s environment is different.

Tags: , ,

« Older entries