In the previous article, we discussed how to use the fzone command via the command line to make zoning and switch changes to fabrics in a SAN environment. In this article, we discuss making changes to the Volume Logix database, which performs LUN masking on EMC Symmetrix systems. We need to use LUN masking as multiple hosts share the same fibre adaptor on the Symmetrix subsystem. Without LUN masking, all hosts with zoned access to the fibre adaptor would be able to view and modify the disks, presenting a serious data integrity risk. Volume access is granted to specific WWNs (World Wide Names), which correspond to hosts. Before we look at the command options, it is necessary to ensure a command device is available from the Symmetrix to the host from which any configuration listing or changes will be made. This can be any generic device on the subsystem and is typically a gatekeeper type device, or small LUN, thereby not wasting space unnecessarily. In all the examples shown here, we will use the Powerpath device name \\.\PHYSICALDRIVE10 to refer to the command device. Incidentally, you can list all of the command disks on your host using the vcmfind command. So, let's look at what we can achieve with the fpath command. There are eight major list commands, two commands to add and remove disks access, the change name command, the swaphba command, the clear wwn command and the change attribute command, plus commands to manage backup and restore. List Commands There are eight list commands that display configuration information from the Volume Logix database. We will look at the three most useful. The lsdb option displays all volumes on each FA and the WWN that has access to them. An example of this command is shown here:
C:\WINNT\ >fpath lsdb -d \\.\physicaldrive10 -s on
Copyright EMC Corp. 2002 @(#) fpath Revision: V5.0-278 $
lsdb VCM DB device = \\.\PHYSICALDRIVE23
VCM Database entries for FA 3aa
-------------------------------------
WWN = 200000e06941160d AWWN = host1/host1_A
Volumes : 000e-0010 001a-0023 0025-002d 003f-0044 00b8 00ba-00be
     00c0-00c1 00c4-00c9 00cb 00cd 00d0-00d6 00ed-0104 011f-0131
     0136 0148 015a 01a0-01a9 0203-0204

WWN = 200000e069411365 AWWN = host12/ host12_A Volumes : 0080-0087 0089-008a 009e-00a6 00a8-00ad 00af-00b3 00b6
WWN = 200000e069411976 AWWN = host13/ host13_A Volumes : 002e-002f 0045-0053 0105-010e 013a-013c 013e-0140 0145-0146 014a-014b 014d-014e 032b-0331
Each WWN entry also has an AWWN or ASCII World Wide Name, which is a more usable representation of the host. The format of the AWWN is hostname/adaptorname and can be used within other commands to reference a specific WWN. The lshosts subcommand displays the host login history for fibre adaptors. This is a particularly useful command as it shows the hosts currently logged into an FA and is therefore great for diagnosing zoning or disk allocation problems. An example of the output is shown here:
C:\WINNT\ >fpath lshosts -d \\.\physicaldrive10
Copyright EMC Corp. 2002 @(#) fpath Revision: V5.0-278 $

Displaying login-history table for FA 3aa Entry Valid SID originator originator user gen user gen On logged Code node_wwn port_wwn node name port name Fabric in 0 VLOG 041800 20000000c928159e 10000000c928162e host1 host1_A Yes Yes 1 VLOG 011800 20000000c928166b 10000000c9281704 host2 host2_A Yes Yes 2 VLOG 051600 20000000c92fbc4b 10000000c92fbc4b NULL NULL No No
The lssymmdev sub-command displays details on the devices currently assigned to an FA through SDR (Symmetrix Device Reallocation). The output from this command is extensive and so is not reproduced as it would take pages of output from most systems! Adding and Removing Devices
There are two subcommands for adding and removing devices that are assigned to a host. These are adddev and rmdev, the format of each is shown here: fpath adddev -d -w | -u -f -r fpath rmdev -d -w | -u -f -r Both commands allow disks to be added or removed by specifiying either the WWN of the host or the ASCII WWN. The FA must be specified as well as the device range, which can be a single device or a range separated by the hyphen. These changes are instant and will be reflected on the host immediately. Swapping an HBA
Occasionally HBAs do fail! In the instance of a failure, a replacement HBA needs to be rezoned to the system and to have access granted through Volume Logix. To make this process easier to manage, the swaphba sub-command is available. The format of this command is shown here: fpath swaphba -d -w | -u -n The ability to swap an HBA in this manner is extremely useful and saves a lot of manual work, especially if an HBA is allocated to multiple FAs. Backup and Restore
One set of commands worthy of mention are the backup and restore commands. These have the following format: fpath backupdb -d -o hostpath fpath restoredb -d -o hostpath These commands allow the contents of the Volume Logix database to be saved to or restored from an external file. As good practice, it is advisable to take a backup of the database before making any changes. These commands can easily be included in scripts. Summary
Using the command line is a useful alternative to the ESN Manager GUI and doesn't have to be used only when the GUI is not available. It is easy to write simple scripts which can be used to automate disk allocations and which perform much faster than the standard ESN Manager interface. Here we have shown only a brief glimpse of some of the available commands. Try them for yourself and see what you can achieve!