Tuesday, October 29, 2024

LXD (now Canonical's) a journey into the simplistically complex

The history of LXD is not part of this post...

LXC (Linux Containers) were not the goal.  I have experience with OpenStack and wanted to go that route but the hardware requirements and overhead for my particular project were so small (just a few different services) that someone on my team said "I'm just gonna install them all on my mac and be done with it.

I couldn't let that go, I needed some CI/CD and config management, I needed repeatable code based infrastructure!

I first found Canonical's MicroCloud and was kinda sold!  But their hardware requirement was min of three like servers and we just had two like servers.  So I did flirt with setting up LXD then putting a multi node MicroCloud cluster in it on VMs but that seemed a little crazy.

So I started with one host, configured LXD and started building containers with terraform and ansible.  It worked so well I was convinced that this was the right path forward.

The hardware are some Ryzen 5 boxes with max RAM and a few SSDs and a dual port 25GbE NIC.  One port from the NICs are direct attached to each other (no switching) and the other is into a 10GbE switch since that is what we have.

I configured each LXC server as a remote of the other and added the remote using the 25GbE network so copy/move operations would be max speed.

I had some trouble getting that part working since each time I would follow the steps to add the remote using the trust cert I would get an error.  No amount of googling found the answer so I tried to post on the LXD forums at Canonical... that was a waste of time since I couldn't even post and there was a disclaimer about "not for tech support" bla bla... so Reddit for the win!

I created a post "LXD to LXD host on one NIC, everything else on another?" in the LXD subreddit and within mins I was off and going!

I can run lxc commands from my laptop connected wifi and see both remotes and issue commands, it's wicked simple once you get it all setup and memorize all the CLI commands ;) 

I opted to have the 10GbE connected to the switch getting all the untagged VLAN traffic then use a linux bridge to pass the VLANs as networks into the containers.  I kinda followed the OpenStack pattern from the old days but also found Trevor Sullivan's YouTube Tutorials super helpful as well as the OG PM of LXD Stéphane Graber's YouTube and Site very helpful!

I might add more details in the future, but my hope is if anyone else is looking for some LXD/LXC servers that are not clustered and hit some of these road blocks maybe this will shorten their search a little.

Tuesday, September 10, 2024

MySQL dumps from cloudSQL, transform to csv, then load infile locally

I got some databases I need to migrate from one server to another.  We opted for the good old fashion `mysqldump`

So far it is wicked slow to import one of the tables, while working through the solution I needed to transform the data from the dump format of insert statements per line to a csv file.  Yeah, I could have just done the export again into this new format but why bother with all that and the network egress fees again, lets just transform what we have.

I asked ChatGPT to come up with some script to do this for me... that script failed :(

I ended up basically just settling on the good old fashion grep & sed commands:

time grep "INSERT INTO" /path/to/file_src.sql | sed -e 's/^[^(]*[(]//' -e 's/),(/\n/g' -e 's/);$//' > /path/to/file_dest.csv

so with this one command you consider only the lines with INSERT commands and you remove the front part something like: "INSERT INTO `table` ("

You also "split" and make new lines on "),(" which is the "boundary" between all the rows

Then we trim the end ");"

So in this one-liner we do basically all we need... if you have hundreds of gigs of tables like me it's faster to run this than re-export it all over the net.

We then needed to import it so I manually took the create table part of the dump, added it into another file and wrapped it in a loop.  I experimented with additional MySQL tuning bits and bobs over the iterations and have no idea if it is helping or not.

Find more and the scripts in this gist https://gist.github.com/ivanlawrence/c3fdbdcab0a34df714f0361f5f55e721

Friday, March 22, 2024

Google Workspace Routing: gmail pro catch-all routing

 I like to do this dumb thing where I use unique email addresses per service.  It started to thwart organizations from selling my email address, but now everything has been breached it has a unique benefit that I don't have the same username at every site so searching through my password manager is fast and also having someone try to login as `microsoft@example.com` but on google has nothing to do with my real account.

Well, I've moved my DNS registrar and name servers around a bit now that Google Domains has been sold.  Up shot is CloudFlare Domain Name Registration is a little cheaper and their API is very easy to deal with if you wanna do a roll your own Dynamic DNS service or something.

When I moved DNS some of my emails started to bounce :(

Looks like there was a gmail default route for "Google Domains Email Forwarding" but I couldn't find anything about it in the docs Set up Default routing for your organization which I think I was using before but now was no longer able to route since I wasn't using Google Domains?

The changes I made were for All Recipients > Envelope recipient > Change envelope recipient > Recipient username > my_username

When tested this seemed to give the result I wanted where the previously bounced emails like `foo@example.com` now was getting sent to `my_username@example.com`.

I thought I would share it here in case I forget and need to do it again.  I have other default routes for other domains and one of them adds a recipient instead of changing the recipient and that kinda dirties the email headers (more than they are now) but it's also a way.

Monday, September 16, 2019

MixPanel: use mixpanel.people.set() and mixpanel.identify() together

Found at https://community.mixpanel.com/questions/585/how-to-implement-peopleset-in-js-api.html
Question
avatar image
stephendb9 asked · 

How to implement people.set() in JS API

What is the right way to implement tracking for People properties in JS? The documentation states:
In order to send profile updates, you must call mixpanel.identify. The Mixpanel library does not automatically create people profiles for any user that performs an event; you have to explicitly call mixpanel.identify, which empowers you to only create profiles for registered users.
But in the examples, identify() is called before people.set() and sometimes it's after. Or not at all.
  • What is correct sequence of calls?
  • Does identify() have to be called every time you want to change a property? Or just once per Profile?
  • If identify() was already called for this Profile, do you just call it again with the same id?
  • What if this Profile was created with alias()?
apipeople profilespeople properties
 1
1 Answer
avatar image
annecamacho answered · 
The mixpanel.identify() call when paired with a mixpanel.people.set() call is intended to flush the data to Mixpanel, and it is required anytime that you intend to create or update a Mixpanel people property.
What is correct sequence of calls?
  • You just need to call identify in the same function/context that you call people.set — the actual sequence in your code is less critical.
Does identify() have to be called every time you want to change a property? Or just once per Profile?
  • Identify needs to be called every time you make a people.set call — to either create or update a people profile within Mixpanel.
If identify() was already called for this Profile, do you just call it again with the same id?
  • If you've already identified the user you do not need to pass anything through the identify function, as you are just using it to flush the data. My personal preference is to always have an empty identify call i.e. mixpanel.identify() vs mixpanel.identify(xyz) after every people.set to ensure the data is sent to Mixpanel and stored to the profile.
What if this Profile was created with alias()?
  • If you are aliasing or identifying a user, then a profile will not be created, unless you are also doing a people.set. Alias and identify methods are intended to help manage the identities of your users throughout their interactions in your site or app, but they also serve a second purpose of flushing the data to Mixpanel. The alias method, similar to identify, has a flush mechanism, but should only be used for the initial people.set calls when users are registering or signing up for an account. Whenever you add/update future people properties with people.set, you would call identify() to flush the data.
For more details on the alias and identify methods, here is a great overview.
-Anne

Friday, October 5, 2018

gcloud ADC for local testing (and how I will never get that day back)

After spending a day fighting permissions errors while running some test code locally using an account that I know for sure has the correct permissions:
{ Error: 7 PERMISSION_DENIED: User not authorized to perform this action.
at Object.exports.createStatusError (/Users/ivan/app/node_modules/grpc/src/common.js:87:15)
at Object.onReceiveStatus (/Users/ivan/app/node_modules/grpc/src/client_interceptors.js:1188:28)
at InterceptingListener._callNext (/Users/ivan/app/node_modules/grpc/src/client_interceptors.js:564:42)
at InterceptingListener.onReceiveStatus (/Users/ivan/app/node_modules/grpc/src/client_interceptors.js:614:8)
at callback (/Users/ivan/app/node_modules/grpc/src/client_interceptors.js:841:24)
code: 7,
metadata: Metadata { _internal_repr: {} },
details: 'User not authorized to perform this action.',
note: 'Exception occurred in retry method that was not classified as transient' }


I was even able to use gcloud to post a message to the same topic my code was trying to use just doing it from the CLI!  no permission errors there!

So after rebuilding and reconfiguring my environment, not to mention reinstalling gcloud and changing the configs a ton of times... I found out that 'gcloud auth login' no longer creates ADC for you... you must use
“gcloud auth application-default login”

This takes you through a browser based auth for the 'Google Auth Library' and BLAM-O you are in business!



Thursday, August 31, 2017

Dell iDRAC Reboot Guest OS and Restart DRAC commands

Send the following commands via SSH:

ssh <drac hostname or IP> 'racadm getsysinfo'

You can even redirect it to a file on your local system:
ssh <drac hostname or IP> 'racadm getsysinfo' | tee -a /path/to/file.txt

Reboot Guest OS (the OS installed on the hardware)

(from: https://www.devops.zone/tricks/connecting-ssh-drac-reboot-server/)
Connect to the Dell Remote Access Controller (Drac) IP address via SSH. Then execute:
racadm serveraction <action>
whereas you replace <action> with one of the following:
  • powerdown — Powers down the managed system.
  • powerup — Powers up the managed system.
  • powercycle — Issues a power-cycle operation on the managed system. This action is similar to pressing the power button on the system’s front panel to power down and then power up the system.
  • powerstatus — Displays the current power status of the server (“ON”, or “OFF”)
  • hardreset — Performs a reset (reboot) operation on the managed system.
So, to power off and back on your server, you just type racadm serveraction powercycle.
If your Drac crashes for any reason, you may want to reset it: (more info)
racadm racreset soft
If you want to have information about your current server, type:
racadm getsysinfo
(from: https://frednotes.wordpress.com/2012/11/13/reset-dell-idrac-using-ssh/)

How to reboot an DELL idrac when web page refuse access:

Connect to idrac IP using ssh with the password refused by web page
$ ssh root@192.168.0.120
root@192.168.0.120's password:
The magic DELL tool is here : radadm
/admin1-> racadm
===============================================================================
 RACADM version 1.80 (Build 17)
 Copyright (c) 2003-2010 Dell, Inc.
 All Rights Reserved
 ===============================================================================
RACADM usage syntax:
racadm <subcommand> <options>
Examples:
racadm getsysinfo
 racadm getsysinfo -d
 racadm getniccfg
 racadm setniccfg -d
 racadm setniccfg -s 192.168.0.120 255.255.255.0 192.168.0.1
 racadm getconfig -g cfgLanNetworking
Display a list of available subcommands for the RAC:
racadm help
Display more detailed help for a specific subcommand:
racadm help <subcommand>
------------------------------------------------------------------------------
So to reboot :
/admin1-> racadm racreset soft
RAC reset operation initiated successfully. It may take up to a minute
for the RAC to come back online again.
/admin1-> Connection to 192.168.0.120 closed by remote host.
Connection to 192.168.0.120 closed.



Thursday, August 3, 2017

I need to rsync from a root protected directory on one server to a root protected directory on another...


Thanks to: https://crashingdaily.wordpress.com/2007/06/29/rsync-and-sudo-over-ssh/


sudo rsync -av -e "ssh" --rsync-path="sudo rsync" username@srv01.prod.example.com:/tftpboot/ /tftpboot/

So here is the thing...

I SSH(ed) to the remoteA and forwarded my ssh keys (ForwardAgent yes) and ran this command:

Breakdown:
sudo rsync -av -e "ssh" 
^ On the host I'm running this on run it under sudo
--rsync-path="sudo rsync" username@srv01.prod.example.com:/tftpboot/ /tftpboot/
^ On the remote server run rsync server as sudo

Tuesday, May 2, 2017

SSH ProxyCommand to use a "gateway" ssh server for subsequent SSH connections

from: https://heipei.github.io/2015/02/26/SSH-Agent-Forwarding-considered-harmful/

ProxyCommand to the rescue

If you’re still reading this, chances are that you’re not aware of the awesome toolbox that is SSH (or at least OpenSSH, let’s be honest).
OpenSSH has an option called ProxyCommand. It works by specifying a ProxyCommand to connect to host B. The config would look like this for our simple example:
1 Host hosta
2  User userfoo
3  Hostname 123.123.123.123
4 
5 Host hostb
6  User userbar
7  Hostname 192.168.1.1
8  Port 2222
9  ProxyCommand ssh -q -W %h:%p hosta
This config tells your local SSH client to connect to host A via a direct connection. Now, if you type ssh hostb what it will do is connect to host A first and then forward your SSH client via the ProxyCommand to the host and port specified by the -W parameter, in this case I used 192.168.1.1 to underline that this is an internal host. Your local SSH client will then authenticate to host B as if you were connected to it directly.
Another observation here is that you don’t need to memorize anything about the host, neither it’s IP or obscure hostname, port or username when you can simply alias it with the Host line.

Monday, February 8, 2016

OSX Keychain Prompting for SSH key passphrase even after saving it.

From StackExchange: http://apple.stackexchange.com/questions/62270/os-x-keychain-keeps-prompting-me-for-my-ssh-passphrase-even-though-i-save-it-os
and http://apple.stackexchange.com/questions/18458/password-dialog-appears-when-ssh-private-key-permissions-are-set-to-0600/26252#26252

The solution for getting a keychain prompt when using ssh and keys with your ssh config file using "identitiesonly yes":
Make sure you have a corresponding id_rsa.pub or id_dsa.pub in your ~/.ssh directory.
When I had an id_rsa but not a corresponding id_rsa.pub, Mac OS X kept popping up the dialog and remember passowrd in my keychain did nothing.
cd ~/.ssh
ssh-keygen -y -f id_rsa > id_rsa.pub
generated the appropriate public key file for me.
If you already had your public file there (rename it to another name) and generate the public key again using the above command, you'll notice that the generated and the old one are not equal. Somehow the older versions of Mac OS X generated a public key that Lion does not like anymore, generating it again fixes that.
For the curious, the key is exactly the same, the part that changes is that there is no "comments" section after the key on the file any longer.

Wednesday, November 4, 2015

VMWare ESXi vCenter Error: The data service timed out because a back-end task took more than 120

The data service timed out because a back-end task took more than 120

While working with VMware ESXi 6.0 and through our vCenter server using the webUI we began getting the aforementioned error.  The solution (after three days of back and forth with VMWare support) was to remote into the vCenter Virtual Appliance and restart the web client service:
service vsphere-client stop
service vsphere-client start

Some of the back and forth was to convince support that we had not changed anything, no decommissioning of a server, no additional hosts, etc.  We left Friday and all was working, come Monday morning we could not manage any of our VMs (could not edit the configs or create new VMs)!

We were offered a publicly available solution (https://noteits.net/2015/08/17/the-data-service-timed-out-because-a-back-end-task-took-more-than-120/#more-414) that did not match our scenario since we had not made any changes to our vCenter environment.

Thursday, June 26, 2014

grep or less for MAC address using regex

Easy enough:

grep -i '\([0-9A-F]\{2\}[:-]\)\{5\}\([0-9A-F]\{2\}\)' file.txt

Or less
less file
/([0-9A-F]{2}[:-]){5}([0-9A-F]{2})

Thursday, January 9, 2014

What package contains this file or library? Use "yum provides" to find out

If you are trying to install an application which gives an error about a missing file you might be able to use yum to easily determine the package and install it.
Error ex:
error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory

One way to resolve this is by using the provides option in yum.

In a terminal, as root (or sudo), type yum provides libssl.so.6 then copy and paste the resulting package name into yum install _____.

Wednesday, November 13, 2013

UNIX find command to open permissions

Thanks to:
http://www.giannistsakiris.com/index.php/2008/12/20/unix-how-to-find-files-that-do-not-match-a-pattern-or-other-criteria/

and:
http://stackoverflow.com/questions/5119946/find-exec-with-multiple-commands

Using find we can query a storage volume and open permissions (or change permissions to other permissions) to ease permissions issues in a heterogeneous environment.

The "old" way to open all the permissions in the volume /media/volB is to run a chmod recursively on all the files in the directory:
chmod -R 777 /media/volB

This will touch each file and update its "Change" time.  That can cause issues if you are relying on that  for knowing when to archive files.

In steps using find to find everything that is not 777 permissions:
find /media/volB ! -perm 777
(The ! means "not")

adding the part that will change the permissions on the resulting files found:
find /media/volB ! -perm 777 -exec chmod 777 {} \;

done

Tuesday, November 5, 2013

Accessing your iCloud Photostream on a Mac

From http://benward.me/blog/tumblr-22113784911

Accessing your iCloud Photostream on a Mac


iCloud's Photostream feature is neat. All the photographs and screen grabs I take with my iPhone or iPad are shared between the devices automatically. But getting to them on the Mac is more complicated, and if you're approaching it from a pure product perspective it appears that you have no choice but to use iPhoto or Aperture to get to the images on a Mac. Turns out this isn't true. Hunting for options, I found a Mac OSX Hints thread about finding the underlying iCloud sync location on disc, and automatically copying the files elsewhere so you can use them in Finder, or import into some other app. Read that thread if you like, but the most useful comment is the last one, by Joh:
Just use a saved search in Finder
A few nice ideas here, but the most simple way to get easily at your Photo Stream without iPhoto is to create a smart folder (saved search) in Finder with kind JPEG in the assets/sub folder. Easily accessible from the side bar, with preview icons and everything. You can even set sorting order and display type there and it will stick.
To extrapolate that into a handy step-by-step, here's how to get your Photostream in Finder:
  1. Open Finder, hit ⌘⇧G, or hit Go: Go To Folder…
  2. Enter ~/Library/Application Support/iLifeAssetManagement/assets/sub. Hit Enter.
  1. Now that you're in the right place, hit ⌘F to open the search interface. You don't need to enter a search term.
  2. Make sure that the search is focused on “sub”, and not “This Mac”, and then in the first Smart Search option, from the three drop-downs choose Kind is Image JPEG.
  3. Now you're seeing all your Photostream photos.
  4. Hit Save in the search interface, save the search as a Smart Folder in your Pictures directory, or wherever you like. You can now use this folder to access Photostream without importing into iPhoto first, and can use it to import into other apps such as Lightroom.
You can repeat the process, but choose a file type of PNG instead of JPEG, and create an equivalent Smart Folder for iOS screen grabs.

    Thursday, September 12, 2013

    Search Multiple Words / String Pattern Using grep Command

    From http://www.cyberciti.biz/faq/searching-multiple-words-string-using-grep/

    How do I search multiple strings or words using the grep command? For example I'd like to search word1, word2, word3 and so on within /path/to/file. How do I force grep to search multiple words?

    The grep command supports regular expression pattern. To search multiple words, use following syntax:
    grep 'word1\|word2\|word3' /path/to/file

    In this example, search warning, error, and critical words in a text log file called /var/log/messages, enter:
    $ grep 'warning\|error\|critical' /var/log/messages

    To just match words, add -w swith:
    $ grep -w 'warning\|error\|critical' /var/log/messages

    Compare Directories using Diff in Linux

    From: http://linuxcommando.blogspot.com/2008/05/compare-directories-using-diff-in-linux.html

    To compare 2 files, we use the diff command. How do we compare 2 directories? Specifically, we want to know what files/subdirectories are common, what are only in 1 directory but not the other. 

    Unix old-timers may remember the dircmp command. Alas, that command is not available in Linux. In Linux, we use the same diff command to compare directories as well as files.

    $ diff  ~peter ~george
    Only in /home/peter: announce.doc
    diff /home/peter/.bashrc /home/george/.bashrc
    76,83d72
    <
    < # Customization by Peter
    < export LESS=-m
    < export GREP_OPTIONS='--color=always'
    < shopt -s histappend
    < shopt -s cmdhist
    < export PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
    < #echo keycode 58 = Escape |loadkeys -
    Only in /home/george: .mcoprc
    Only in /home/peter: .metacity
    Only in /home/george: .newsticker-images
    Only in /home/peter: .notifier.conf
    Only in /home/george: targets.txt
    Only in /home/peter: .xsession-errors
    

    Without any option, diffing 2 directories will tell you which files only exist in 1 directory and not the other, and which are common files. Files that are common in both directories (e.g., .bashrc in the above listing) are diffed to see if and how the file contents differ.

     If you are NOT interested in file differences, just add the -q (or --brief) option.

    diff -q ~peter ~george  |sort
    Files /home/peter/.bashrc and /home/george/.bashrc differ
    Only in /home/george: .mcoprc
    Only in /home/george: .newsticker-images
    Only in /home/george: targets.txt
    Only in /home/peter: .metacity
    Only in /home/peter: .notifier.conf
    Only in /home/peter: .xsession-errors
    Only in /home/peter: announce.doc
    

    diff orders its output alphabetically by file/subdirectory name. I prefer to group them by whether they are common, and whether they only exist in the first or second directory. That is why I piped the output of diff through sort in the above command. Note that by default diff does not reach into the subdirectories to compare the files and subdirectories at that level. To change its behavior to recursively go down subdirectories, add -r.

      diff -qr ~peter ~george |sort

    Creating a StorNext Filesystem (cvfs v4.3 or earlier)

    Creating a StorNext Filesystem (cvfs v4.3 or earlier)

    You may have just provisioned some new DDN 9900 LUNs or otherwise added new storage to your StorNext based SAN.  You now need to create the filesystem.

    Prerequisites:

    • StorNext MDS/MDC (MetaData Server/Controller) in this example this will be built on RHEL
    • A LUN presented to the MDS/MDC system(s) to be used for metadata storage.  This should be fast, capable of large IOPS, and as low latency as possible.
    • LUNs presented to all of your client systems to be used for your data pool where the StorNext file system will be created and you data will be stored.

    Overview:

     

    CVLABEL - Label the Disks / LUNs for use with StorNext

    WARNING: The CVLABEL command is similar to formatting a disk!  Using the wrong device name could result in data loss!

    First you need to view the LUNs that are available to StorNext.  This should be done via the StorNext command cvlabel:

    NOTE: Using the command cvlabel -c will output information in the same format as is required to make a "cvlabel file" for "labeling" later in the process.

    [user@system]# cvlabel -c
    CvfsDisk_UNKNOWN /dev/sda    # host 2 lun 0 sectors 1170619103 sector_size 512 inquiry [DotHill DH3000          T230] serial 600C0FF000132F1A8BC8EB4E01000000
    CvfsDisk_UNKNOWN /dev/sdb    # host 1 lun 0 sectors 487997407 sector_size 512 inquiry [Adaptec systemOS       V1.0] serial 166D4B28
    CvfsDisk_UNKNOWN /dev/sdd    # host 2 lun 0 sectors 9376430047 sector_size 512 inquiry [DDN     S2A 9900        6.11] serial 60001FF01590A361000001000008BB85
    CvfsDisk_UNKNOWN /dev/sdp    # host 2 lun 1 sectors 9376430047 sector_size 512 inquiry [DDN     S2A 9900        6.11] serial 60001FF0157EA47E010001000008BB85
    CvfsDisk_UNKNOWN /dev/sdv    # host 2 lun 2 sectors 9376430047 sector_size 512 inquiry [DDN     S2A 9900        6.11] serial 60001FF01590A3C8020001000008BB85
    

    Output this same info to a file cvlabel -c >> /path/to/file.txt to then manipulate it for "labeling".  Remove all LUNs that are not applicable by running the output through the grep command to focus on only the DotHill for metadata LUNs, DDN for data LUNs, or all LUNs from a particular host if you have multiple paths to your storage.  (ex: cvlabel -c | grep "host 2" | grep DDN >> /path to file or if you know how the system or OS disk will be presented you can show everything but that cvlabel -c | grep -v Adaptec >> /path to file)

     

    The resulting info breaks down as follows:

    CvfsDisk_UNKNOWN = StorNext Label

    /dev/sda = Device

    # host 2 lun 0 sectors 1170619103 sector_size 512 inquiry = commented (unused) info about the LUN to detarmain source

    [DotHill DH3000 T230] = [ Vendor info ]

    serial 600C0FF000132F1A8BC8EB4E01000000 = LUN / Disk serial number

     

    Replace CvfsDisk_UNKNOWN with the desired label (ex: LUN14 to LUN16) in the text file.

    META_LUN2 /dev/sda 1170619103 EFI    # host 2 lun 0 sectors 1170619103 sector_size 512 inquiry [DotHill DH3000          T230] serial 600C0FF000132F1A8BC8EB4E01000000
    LUN14 /dev/sdd 9376430047 EFI    # host 2 lun 0 sectors 9376430047 sector_size 512 inquiry [DDN     S2A 9900        6.11] serial 60001FF01590A361000001000008BB85
    LUN15 /dev/sdp 9376430047 EFI    # host 2 lun 1 sectors 9376430047 sector_size 512 inquiry [DDN     S2A 9900        6.11] serial 60001FF0157EA47E010001000008BB85
    LUN16 /dev/sdv 9376430047 EFI    # host 2 lun 2 sectors 9376430047 sector_size 512 inquiry [DDN     S2A 9900        6.11] serial 60001FF01590A3C8020001000008BB85
    

     NOTE:  If you have redundant paths you only have to label each LUN once on any one of the paths, not once per path.  Also, be sure LUN labels are unique per LUN, meaning, LUN1 may be presented multiple times but in the storage device (DDN) there is only one LUN1.  If multiple unique LUNs are given the same names data corruption may occur!

     

    Apply the label(s) using cvlabel /path/to/cvlabel/file.txt: (ex: cvlabel.txt)

    NOTE: Be sure the LUN_label - to - device association in the file is correct or data loss could occur!  You will be prompted for each LUN prior to making changes, please read all the information completely before proceeding.

    [user@system]# cvlabel cvlabel.txt
    
    *WARNING* This program will over-write volume labels on the
              devices specified in the file "cvlabel.txt".
    
              After execution, the devices will only be usable by the
              StorNext. You will have to re-partition the
              devices to use them on a different file system.
    
    
    Do you want to proceed? (Y / N) -> y
    
    /dev/sdd   [DDN     S2A 9900        6.11] SNFS-EFI "LUN14"  Controller 'DAE54B28', Serial 'DAE54B28', Sector Size 512, Sectors 9376430047 (4.8TB), GUID 99a524b2-f943-11e2-b832-00259004d1b4 [Tue Jul 30 11:12:31 2013 00:25:90:04:d1:b4]
    
    Disk "/dev/sdd" already has a valid label, and is being changed:
    
    - The ctq_depth is changing from 0 to 16.
      This may change disk performance on IRIX systems.
    
    Warning: The raw capacity (9376430047 sectors) of disk "/dev/sdd" might make it unusable by some older Solaris systems.
    
    Warning: Because it will use an EFI label, disk "/dev/sdd" will not be usable by earlier StorNext releases.
    
    Do you want to re-label it SNFS-EFI - Name: LUN14 Sectors: 9376430047 (Y / N) -> y
    New Volume Label -Device: /dev/sda  SNFS Label: LUN14  Sectors: 9376430047.
    

     

    Making the File System Config File

    In some cases you are able to use an existing file system config file (or the following) and simply change a few parts to add additional file systems to an existing SAN.  For this example we will use the following existing file: volA.cfgx

    <?xml version="1.0"?>
    <configDoc xmlns="http://www.quantum.com/snfs" version="1.0">
      <config configVersion="0" name="volA" fsBlockSize="16384" journalSize="16777216">
        <globals>
          <abmFreeLimit>false</abmFreeLimit>
          <allocationStrategy>round</allocationStrategy>
          <haFsType>HaUnmanaged</haFsType>
          <bufferCacheSize>33554432</bufferCacheSize>
          <cvRootDir>/</cvRootDir>
          <storageManager>false</storageManager>
          <dataMigrationThreadPoolSize>128</dataMigrationThreadPoolSize>
          <debug>00000000</debug>
          <dirWarp>true</dirWarp>
          <extentCountThreshold>32768</extentCountThreshold>
          <enforceAcls>false</enforceAcls>
          <fileLocks>false</fileLocks>
          <fileLockResyncTimeOut>20</fileLockResyncTimeOut>
          <forcePerfectFit>false</forcePerfectFit>
          <fsCapacityThreshold>0</fsCapacityThreshold>
          <globalSuperUser>true</globalSuperUser>
          <inodeCacheSize>65536</inodeCacheSize>
          <inodeExpandMin>0</inodeExpandMin>
          <inodeExpandInc>0</inodeExpandInc>
          <inodeExpandMax>0</inodeExpandMax>
          <inodeDeleteMax>0</inodeDeleteMax>
          <inodeStripeWidth>0</inodeStripeWidth>
          <maxConnections>32</maxConnections>
          <maxLogSize>4194304</maxLogSize>
          <maxLogs>4</maxLogs>
          <remoteNotification>false</remoteNotification>
          <reservedSpace>true</reservedSpace>
          <fsmRealTime>false</fsmRealTime>
          <fsmMemLocked>false</fsmMemLocked>
          <opHangLimitSecs>180</opHangLimitSecs>
          <perfectFitSize>131072</perfectFitSize>
          <quotas>false</quotas>
          <restoreJournal>false</restoreJournal>
          <restoreJournalDir/>
          <restoreJournalMaxHours>0</restoreJournalMaxHours>
          <restoreJournalMaxMb>0</restoreJournalMaxMb>
          <stripeAlignSize>0</stripeAlignSize>
          <trimOnClose>0</trimOnClose>
          <threadPoolSize>64</threadPoolSize>
          <unixDirectoryCreationModeOnWindows>777</unixDirectoryCreationModeOnWindows>
          <unixIdFabricationOnWindows>false</unixIdFabricationOnWindows>
          <unixFileCreationModeOnWindows>777</unixFileCreationModeOnWindows>
          <unixNobodyUidOnWindows>501</unixNobodyUidOnWindows>
          <unixNobodyGidOnWindows>501</unixNobodyGidOnWindows>
          <windowsSecurity>false</windowsSecurity>
          <eventFiles>true</eventFiles>
          <eventFileDir/>
          <allocSessionReservationSize>1073741824</allocSessionReservationSize>
        </globals>
        <diskTypes>
          <diskType typeName="MetaDrive" sectors="1170619103" sectorSize="512"/>
          <diskType typeName="DataDrive" sectors="9376430047" sectorSize="512"/>
        </diskTypes>
        <stripeGroups>
          <stripeGroup index="0" name="MetaFiles" status="up" stripeBreadth="65536" read="true" write="true" metadata="true" journal="true" userdata="false" realTimeIOs="0" realTimeIOsReserve="0" realTimeMB="0" realTimeMBReserve="0" realTimeTokenTimeout="0" multipathMethod="rotate">
            <disk index="0" diskLabel="META_LUN0" diskType="MetaDrive" ordinal="0"/>
          </stripeGroup>
          <stripeGroup index="1" name="DataFiles_0" status="up" stripeBreadth="1048576" read="true" write="true" metadata="false" journal="false" userdata="true" realTimeIOs="0" realTimeIOsReserve="0" realTimeMB="0" realTimeMBReserve="0" realTimeTokenTimeout="0" multipathMethod="rotate">
            <affinities exclusive="false">
              <affinity>data0</affinity>
            </affinities>
            <disk index="0" diskLabel="LUN0" diskType="DataDrive" ordinal="1"/>
            <disk index="1" diskLabel="LUN1" diskType="DataDrive" ordinal="2"/>
            <disk index="2" diskLabel="LUN2" diskType="DataDrive" ordinal="3"/>
            <disk index="3" diskLabel="LUN3" diskType="DataDrive" ordinal="4"/>
            <disk index="4" diskLabel="LUN4" diskType="DataDrive" ordinal="5"/>
            <disk index="5" diskLabel="LUN5" diskType="DataDrive" ordinal="6"/>
            <disk index="6" diskLabel="LUN6" diskType="DataDrive" ordinal="7"/>
            <disk index="7" diskLabel="LUN7" diskType="DataDrive" ordinal="8"/>
            <disk index="8" diskLabel="LUN8" diskType="DataDrive" ordinal="9"/>
            <disk index="9" diskLabel="LUN9" diskType="DataDrive" ordinal="10"/>
          </stripeGroup>
        </stripeGroups>
      </config>
    </configDoc>

     

    The above file can be copied to make a new file system config file with some changes: volB.cfgx

    <?xml version="1.0"?>
    <configDoc xmlns="http://www.quantum.com/snfs" version="1.0">
      <config configVersion="0" name="volB" fsBlockSize="16384" journalSize="16777216">
        <globals>
          <abmFreeLimit>false</abmFreeLimit>
          <allocationStrategy>round</allocationStrategy>
          <haFsType>HaUnmanaged</haFsType>
          <bufferCacheSize>33554432</bufferCacheSize>
          <cvRootDir>/</cvRootDir>
          <storageManager>false</storageManager>
          <dataMigrationThreadPoolSize>128</dataMigrationThreadPoolSize>
          <debug>00000000</debug>
          <dirWarp>true</dirWarp>
          <extentCountThreshold>32768</extentCountThreshold>
          <enforceAcls>false</enforceAcls>
          <fileLocks>false</fileLocks>
          <fileLockResyncTimeOut>20</fileLockResyncTimeOut>
          <forcePerfectFit>false</forcePerfectFit>
          <fsCapacityThreshold>0</fsCapacityThreshold>
          <globalSuperUser>true</globalSuperUser>
          <inodeCacheSize>65536</inodeCacheSize>
          <inodeExpandMin>0</inodeExpandMin>
          <inodeExpandInc>0</inodeExpandInc>
          <inodeExpandMax>0</inodeExpandMax>
          <inodeDeleteMax>0</inodeDeleteMax>
          <inodeStripeWidth>0</inodeStripeWidth>
          <maxConnections>32</maxConnections>
          <maxLogSize>4194304</maxLogSize>
          <maxLogs>4</maxLogs>
          <remoteNotification>false</remoteNotification>
          <reservedSpace>true</reservedSpace>
          <fsmRealTime>false</fsmRealTime>
          <fsmMemLocked>false</fsmMemLocked>
          <opHangLimitSecs>180</opHangLimitSecs>
          <perfectFitSize>131072</perfectFitSize>
          <quotas>false</quotas>
          <restoreJournal>false</restoreJournal>
          <restoreJournalDir/>
          <restoreJournalMaxHours>0</restoreJournalMaxHours>
          <restoreJournalMaxMb>0</restoreJournalMaxMb>
          <stripeAlignSize>0</stripeAlignSize>
          <trimOnClose>0</trimOnClose>
          <threadPoolSize>64</threadPoolSize>
          <unixDirectoryCreationModeOnWindows>777</unixDirectoryCreationModeOnWindows>
          <unixIdFabricationOnWindows>false</unixIdFabricationOnWindows>
          <unixFileCreationModeOnWindows>777</unixFileCreationModeOnWindows>
          <unixNobodyUidOnWindows>501</unixNobodyUidOnWindows>
          <unixNobodyGidOnWindows>501</unixNobodyGidOnWindows>
          <windowsSecurity>false</windowsSecurity>
          <eventFiles>true</eventFiles>
          <eventFileDir/>
          <allocSessionReservationSize>1073741824</allocSessionReservationSize>
        </globals>
        <diskTypes>
          <diskType typeName="MetaDrive" sectors="xxxxxxxxxx" sectorSize="512"/>
          <diskType typeName="DataDrive" sectors="xxxxxxxxxx" sectorSize="512"/>
        </diskTypes>
        <stripeGroups>
          <stripeGroup index="0" name="MetaFiles" status="up" stripeBreadth="65536" read="true" write="true" metadata="true" journal="true" userdata="false" realTimeIOs="0" realTimeIOsReserve="0" realTimeMB="0" realTimeMBReserve="0" realTimeTokenTimeout="0" multipathMethod="rotate">
            <disk index="0" diskLabel="META_LUN2" diskType="MetaDrive" ordinal="0"/>
          </stripeGroup>
          <stripeGroup index="1" name="DataFiles_0" status="up" stripeBreadth="1048576" read="true" write="true" metadata="false" journal="false" userdata="true" realTimeIOs="0" realTimeIOsReserve="0" realTimeMB="0" realTimeMBReserve="0" realTimeTokenTimeout="0" multipathMethod="rotate">
            <affinities exclusive="false">
              <affinity>data0</affinity>
            </affinities>
            <disk index="0" diskLabel="LUN14" diskType="DataDrive" ordinal="1"/>
            <disk index="1" diskLabel="LUN15" diskType="DataDrive" ordinal="2"/>
            <disk index="2" diskLabel="LUN16" diskType="DataDrive" ordinal="3"/>
          </stripeGroup>
        </stripeGroups>
      </config>
    </configDoc>

     NOTE: The following is the minimum amount of info that needs to be changed (needs to be unique across file systems or data loss can occur)!  The name of the file needs to match the file system name.  Additionally, based on the info gathered from running the CVLABEL command earlier, be sure to reflect the new metadata label and sectors and data label and sectors from the cvlabel output.

    CVMKFS - Make the File System

    The cvmkfs command is used to create / format the StorNext file system using the .cfgx file. Be sure to use the file system name and not the file name (ex: use cvmkfs volB not cvmkfs volB.cfgx)

    [user@system]# cvmkfs volB
    Checked Build disabled - default.
    StorNext File System Initializer.
    
    ** WARNING ** This will destroy all contents and data of the
    
                  --- [volB] ---
    
                  file system. Re-initialization cannot be un-done!
    
    Do you want to proceed? (Y/[N]) -> y
    
    Re-initializing file system 'volB'.
    
    
    *Warning*: Inode Expand Min is deprecated and will no longer be supported in future releases
    *Warning*: Inode Expand Max is deprecated and will no longer be supported in future releases
    *Warning*: Inode Expand Inc is deprecated and will no longer be supported in future releases
    *Warning*: AllocationStrategy must be Round Robin ("round") when AllocSessionReservation is enabled.  Ignoring current setting.
    
    Shared Meta Data File System.
    Meta Data Root is on "MetaFiles".
    Resetting Arbitration Block.
    Writing Configuration Information Block.
    Writing Root Directory Block.
    Writing Disk Information Block.
    Writing Stripe Group Index "MetaFiles".
    Writing Stripe Group Index "DataFiles_0".
    Resetting File System Journal.
    Creating Free List.
    Writing Initial 512 Inodes.
    Inode block size is 1024 bytes.
    Writing Initialization Control Block.
    Setting "Force Stripe Alignment"
    Resetting Super Block.
    Writing Reserved Allocations.
    
    File system 'volB' successfully created.
    

     

    Bringing the New File System Online

    Using the cvadmin interactive console you need to start then activate the file system:

    [user@system]# cvadmin
    StorNext Administrator
    
    Enter command(s)
    For command help, enter "help" or "?".
    
    List FSS
    
    File System Services (* indicates service is in control of FS):
    
    No FSSs are active.
    Select FSM "none"
    
    
    snadmin> start volB
    Starting FSS locally.
    Start FSS "volB"
    
    FSS 'volB' start initiated.
    FSS 'volB' started.
    
    snadmin> select
    List FSS
    
    File System Services (* indicates service is in control of FS):
     1> volB[0]              located on Venice02:36526 (pid 4814)
    
    No FSSs are active.
    
    snadmin> activate volB
    Activate FSM "volB"
    
     Created           :    Wed Sep 11 17:37:36 2013
     Active Connections:    0
     Fs Block Size     :    4K
     Msg Buffer Size   :    4K
     Disk Devices      :    4
     Stripe Groups     :    2
     Fs Blocks         :    3071783232 (11.44 TB)
     Fs Blocks Free    :    3070700352 (11.44 TB) (99%)
    
    
    snadmin (volB) > select
    List FSS
    
    File System Services (* indicates service is in control of FS):
     1>*volB[0]              located on Venice02:36526 (pid 4814)
    
    
    snadmin (volB) > _
    

    NOTE: the select command can be used to "refresh" the list of file systems.  Notice there is no * next to the file system prior to activation, the presence of an * indicates the file system is active.

     

    Now the file system needs to me mounted for use:

    [user@system]# mkdir /media/volB
    [root@Venice02 ~]# mount -t cvfs volB /media/volB/
    mount.cvfs: Filesystem volB mounted on /media/volB
    [user@system]# mount
    /dev/sdb1 on / type ext3 (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    tmpfs on /dev/shm type tmpfs (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    nfsd on /proc/fs/nfsd type nfsd (rw)
    /dev/cvfsctl1_volB on /media/volB type cvfs (rw,sparse=yes)

    Your new file system should now me usable / mountable by any of your SAN clients.

    Making the New File System Automatically Online and Mount Across Reboots

     The file system needs to be listed among the file systems being managed my this server (by the FSM service).  This means the file system name needs to be added to /usr/cvfs/config/fsmlist file within the MDS.

    NOTE: If running multiple MDSes for failover / high availability you will need to do the following on both servers.

    Edit the file /usr/cvfs/config/fsmlist and add the following:

    volB . 0

    NOTE: On the secondary MDS change the 0 to a 1:

    volB . 1

    You then need to add the mount to /etc/fstab:

    LABEL=/                 /                       ext3    defaults        1 1
    LABEL=backup            /mnt/backup             ext3    noauto          0 0
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
    LABEL=swap              swap                    swap    defaults        0 0
    volB                    /media/volB             cvfs    rw              0 0
    

     NOTE: It is a good idea to backup the file before making changes.

    Your new filesystem should now be usable locally and persistent after reboot.

    Tuesday, September 10, 2013

    VIM substitution to prepare XML code samples for HTML blogs

    I sometimes need to include XML code samples in my blogs.  When I do this I need a quick way to format it for HTML, more specifically, format it for whatever blogging software I'm using.  Since it is infrequent I just use VIM substitution (I know, I could do this in SED but for now VIM is good enough)

    From http://vim.wikia.com/wiki/Search_and_replace:
    :%s/foo/bar/g
    Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.

    I search for < or > then replace them with &lt; or &gt; and done.

    :%s/</\&lt\;/g to replace all instances of < with &lt;
    :%s/>/\&gt\;/g to replace all instances of > with &gt;

    Thursday, September 5, 2013

    Adding Disks and Creating LUNs in DDN9900 and DDN S7000 Chassis

    Installing disks into a DDN enclosure

    There are four different enclosure configurations for a DDN based SAN: 5, 10, or 20 enclosures

    5 Enclosures (SS7000_1X Enclosure mapping)

    BACK
    I/O Modules
    PSU
    25 26 27 28 29 30
    DIMMs
    25 26 27 28 29 30
    19 20 21 22 23 24 19 20 21 22 23 24
    13 14 15 16 17 18 13 14 15 16 17 18
    7 8 9 10 11 12 7 8 9 10 11 12
    1 2 3 4 5 6 1 2 3 4 5 6
    A B
    FRONT

    10 Enclosures (SS7000_2X Enclosure mapping)

    BACK
    I/O Modules
    PSU
    49 50 51 52 53 54
    DIMMs
    55 56 57 58 59 60
    37 38 39 40 41 42 43 44 45 46 47 48
    25 26 27 28 29 30 31 32 33 34 35 36
    13 14 15 16 17 18 19 20 21 22 23 24
    1 2 3 4 5 6 7 8 9 10 11 12
    A
    FRONT

    20 Enclosures (SS7000_2X Enclosure mapping)

    BACK
    I/O Modules
    PSU
    49 50 51 52 53 54
    DIMMs
    55 56 57 58 59 60
    37 38 39 40 41 42 43 44 45 46 47 48
    25 26 27 28 29 30 31 32 33 34 35 36
    13 14 15 16 17 18 19 20 21 22 23 24
    1 2 3 4 5 6 7 8 9 10 11 12
    A
    FRONT
    BACK
    I/O Modules
    PSU
    109 110 111 112 113 114
    DIMMs
    115 116 117 118 119 120
    97 98 99 100 101 102 103 104 105 106 107 108
    85 86 87 88 89 90 91 92 93 94 95 96
    73 74 75 76 77 78 79 80 81 82 83 84
    61 62 63 64 65 66 67 68 69 70 71 72
    A
    FRONT

     

    Here is an example of a 5 enclosure install already populated with "14 tiers" of disks:

    BACK
    I/O Modules
    PSU
    25 26 27 28 29 30
    DIMMs
    25 26 27 28 29 30
    19 20 21 22 23 24 19 20 21 22 23 24
    13 14 15 16 17 18 13 14 15 16 17 18
    7 8 9 10 11 12 7 8 9 10 11 12
    1 2 3 4 5 6 1 2 3 4 5 6
    A B
    FRONT
    BACK
    I/O Modules
    PSU
    25 26 27 28 29 30
    DIMMs
    25 26 27 28 29 30
    19 20 21 22 23 24 19 20 21 22 23 24
    13 14 15 16 17 18 13 14 15 16 17 18
    7 8 9 10 11 12 7 8 9 10 11 12
    1 2 3 4 5 6 1 2 3 4 5 6
    C D
    FRONT
    BACK
    I/O Modules
    PSU
    25 26 27 28 29 30
    DIMMs
    25 26 27 28 29 30
    19 20 21 22 23 24 19 20 21 22 23 24
    13 14 15 16 17 18 13 14 15 16 17 18
    7 8 9 10 11 12 7 8 9 10 11 12
    1 2 3 4 5 6 1 2 3 4 5 6
    E F
    FRONT
    BACK
    I/O Modules
    PSU
    25 26 27 28 29 30
    DIMMs
    25 26 27 28 29 30
    19 20 21 22 23 24 19 20 21 22 23 24
    13 14 15 16 17 18 13 14 15 16 17 18
    7 8 9 10 11 12 7 8 9 10 11 12
    1 2 3 4 5 6 1 2 3 4 5 6
    G H
    FRONT
    BACK
    I/O Modules
    PSU
    25 26 27 28 29 30
    DIMMs
    25 26 27 28 29 30
    19 20 21 22 23 24 19 20 21 22 23 24
    13 14 15 16 17 18 13 14 15 16 17 18
    7 8 9 10 11 12 7 8 9 10 11 12
    1 2 3 4 5 6 1 2 3 4 5 6
    P S
    FRONT

     

    Tier Information:
    -----------------
    
                             Space
                 Capacity  Available     Disk
    Tier Owner     (MiB)     (MiB)      Status                LUN List
    -----------------------------------------------------------------------------
       1 +  1     4578344          0  ABCDEFGHPS  0 
       2 +  2     4578344          0  ABCDEFGHPS  1 
       3 +  1     4578344          0  ABCDEFGHPS  2 
       4 +  2     4578344          0  ABCDEFGHPS  3 
       5 +  1     4578344          0  ABCDEFGHPS  4 
       6 +  2     4578344          0  ABCDEFGHPS  5 
       7 +  1     4578344          0  ABCDEFGHPS  6 
       8 +  2     4578344          0  ABCDEFGHPS  7 
       9 +  1     4578344          0  ABCDEFGHPS  8 
      10 +  2     4578344          0  ABCDEFGHPS  9 
      11 +  1     4578344          0  ABCDEFGHPS  10 
      12 +  2     4578344          0  ABCDEFGHPS  11 
      13 +  1     4578344          0  ABCDEFGHPS  12 
      14 +  2     4578344          0  ABCDEFGHPS  13 
    
    Verifying TIER 1, 38.3%, Continuous.
    Verifying TIER 3,  0.4%, Continuous.
    Verifying TIER 8, 83.1%, Continuous.
    Verifying TIER 10, 71.2%, Continuous.
    All disks are healthy.
    
      Automatic disk restarting:   Disabled
      Automatic disk rebuilding:   Enabled
      Automatic SMART replacement: Disabled
      Maximum active rebuilds:     4
      Maximum active verifies:     2
      System rebuild extent:       64 MiB
      System rebuild delay:        10
      System delay IO limit:       0
      Journaling:                  Enabled                                     
                                         
                  System Capacity 64096816 MiB, 0 MiB available.

     

    If you were to add additional drives, say 30 drives for a total of 3 new tiers (10 drives per tier), you would add them to "15", "16", and "17" of each of the five enclosures.

    BACK
    I/O Modules
    PSU
    25 26 27 28 29 30
    DIMMs
    25 26 27 28 29 30
    19 20 21 22 23 24 19 20 21 22 23 24
    13 14 15 16 17 18 13 14 15 16 17 18
    7 8 9 10 11 12 7 8 9 10 11 12
    1 2 3 4 5 6 1 2 3 4 5 6
    A B
    FRONT

    ...

     Once the disks are installed you will create internal LUNs.  For ease of configuration use one LUN per Tier.  You will use the command lun add=<LUN#>:

    NOTE: LUN numbers start at "0" but Tier numbers start at "1".  In our example, Tier 15 will be used to create LUN 14 which we label "LUN14"

    S2A 9900[1]: lun add=14
    
    Enter a label for LUN 14 (up to 16 characters): LUN14
    
    Enter the capacity (in Mbytes) for LUN 14, LUN14
    
    0 for all available capacity (default): 0
    
    Enter the number of tiers (1..8)
    
    Default will auto select, 'e' to escape: 1
    
    Enter the tiers, each one on a new line, or 'e' to escape:
    15
    
    Enter the block size, (512, 1024, 2048, 4096)
    Default is 512, 'e' to escape: 512
    
    Attempting to add LUN 14
    Operation successful: LUN 14 was added to the system.
    
    The LUN must be formatted before it can be used.
    
    Would you like to format the LUN now? (y/N): Y
    
    INFO INIT_137 1-22 18:48:21 Starting Format of LUN 14

    NOTE: The lines that say (default) in them will allow simply hitting the ENTER key to apply the default value instead of entering a value.

     

    Repeat the above for each internal LUN / Tier that has been added.

    NOTE: Each LUN / Tier will be "owned" by the controller that was used to create it.  To "load balance" the creation of LUNs you can alternate creation between both controllers.

     

     The following will need to be done on each controller individually

    Next we need to present, or map, the internal LUN / Tier through the fiber ports as "external" LUNs.  This is done using the zoning edit=n command:

    NOTE: zoning edit can be invoked without specifying a port number (=n) in which case you will be asked to specify a port number.

      S2A 9900[1]: zoning edit=1
    
      Enter the new LUN zoning for host port 1.
    
      Enter the unique LUN mapping, as follows:
    
      G.l   GROUP.LUN number
      P     Place-holder
      R     Before GROUP.LUN to indicate Read-Only
      N     Clear current assignment
     ENTER  No change
      E     Exit command
      ?     Display detailed help text
    
    External LUN 0: is not mapped.  Enter new internal LUN:
    

    NOTE: zoning edit will cycle through each external LUN number even after you have passed the number of available internal LUNs / Tiers, to escape the loop type e

    CAUTION: Changes take effect immediately!  If you accidentally change the mapping for an existing LUN it could cause data loss/corruption and will most-likely at least interrupt (offline) the SAN.  Changes should be done carefully.  Mistakes are best avoided by focusing on each line individually, the line will indicate current LUN mappings.  When in doubt strike the ENTER key or use e to escape and start over.

     

    Next, run tier verify=on to allow the controller to continuously check the tier for disk related problems.

    S2A 9900[1]: tier verify=on
    
                                 Tier Status     
    
                             Space
                 Capacity  Available     Disk
    Tier Owner     (MiB)     (MiB)      Status                LUN List
    -----------------------------------------------------------------------------
       1 +  1     4578344          0  ABCDEFGHPS  0 
       2 +  2     4578344          0  ABCDEFGHPS  1 
       3 +  1     4578344          0  ABCDEFGHPS  2 
       4 +  2     4578344          0  ABCDEFGHPS  3 
       5 +  1     4578344          0  ABCDEFGHPS  4 
       6 +  2     4578344          0  ABCDEFGHPS  5 
       7 +  1     4578344          0  ABCDEFGHPS  6 
       8 +  2     4578344          0  ABCDEFGHPS  7 
       9 +  1     4578344          0  ABCDEFGHPS  8 
      10 +  2     4578344          0  ABCDEFGHPS  9 
      11 +  1     4578344          0  ABCDEFGHPS  10 
      12 +  2     4578344          0  ABCDEFGHPS  11 
      13 +  1     4578344          0  ABCDEFGHPS  12 
      14 +  2     4578344          0  ABCDEFGHPS  13
      15 +  1     4578344          0  ABCDEFGHPS  14
      16 +  2     4578344          0  ABCDEFGHPS  15
      17 +  1     4578344          0  ABCDEFGHPS  16
    
                             Tier Verification Status:
    
     TIER   Scheduled   Continuous  Progress    Passes  Last Verify Completion Time  
    
    -------------------------------------------------------------------------------
    
       1                    Yes       0.8%          29     16:17:07 01/22/2011 
       2        No          Yes                     29     16:17:05 01/22/2011 
       3                    Yes                     28     19:25:51 01/12/2011 
       4        No          Yes                     28     11:47:25 01/16/2011 
       5                    Yes                     28     09:35:10 01/22/2011 
       6        No          Yes                     27     09:46:24 01/22/2011 
       7                    Yes                     24     15:09:06 11/28/2010 
       8        No          Yes                     24     15:20:22 12/01/2010 
       9                    Yes                     24     09:21:15 12/04/2010 
      10        No          Yes                     24     15:10:33 12/12/2010 
      11                    Yes                     24     23:28:35 12/13/2010 
      12        No          Yes                     24     12:19:44 12/21/2010 
      13                    Yes                     48     22:39:50 12/30/2010 
      14        No          Yes                      0     12:46:02 01/05/2011 
      15                    Yes                      0     21:10:56 01/05/2011 
      16        No          Yes                      0     23:02:30 01/05/2011
      17                    Yes                      0     23:02:30 01/05/2011 
    
      System verify extent:    32 Mbytes
      System verify delay:     40
      Maximum active verifies: 2
    
    
    Please enter a TIER ('a' for all TIERs owned by this unit or 'q' to quit): a
    
    ALL valid TIERs owned by this unit selected
    
    Do you want the verify to run continuously? (y/N): y
    

     

    Next, run cache writeback=on and av fastav=on

    S2A 9900[1]: cache writeback=on
    
                              Current Cache settings
    
               Write   Maximum   MF  Prefetch
        LUN   Caching  Prefetch  Bit  Ceiling
     ------------------------------------------------------------------------------
          0   Enabled    x    1   On   65535
          1   Enabled    x    1   On   65535
          2   Enabled    x    1   On   65535
          3   Enabled    x    1   On   65535
          4   Enabled    x    1   On   65535
          5   Enabled    x    1   On   65535
          6   Enabled    x    1   On   65535
          7   Enabled    x    1   On   65535
          8   Enabled    x    1   On   65535
          9   Enabled    x    1   On   65535
         10   Enabled    x    1   On   65535
         11   Enabled    x    1   On   65535
         12   Enabled    x    1   On   65535
         13   Enabled    x    1   On   65535
         14   Enabled    x    1   On   65535
         15   Enabled    x    1   On   65535
         16   Enabled    x    1   On   65535
    
    Writeback Limit: 75%
    
                         2560.0 Mbytes of Cache Installed
                          (2048 Segments of 1024 Kbytes)
    
    S2A 9900[1]: av fastav=on
    
               Current LUN Audio/Visual settings
    
                                    Read     Write   Maximum
      LUN  Label          FastAV Continuous Caching  Prefetch
    -----------------------------------------------------------
        0 SAS_0              On      Off       On       x  1
        1 SAS_1              On      Off       On       x  1
        2 SAS_2              On      Off       On       x  1
        3 SAS_3              On      Off       On       x  1
        4 SAS_4              On      Off       On       x  1
        5 SAS_5              On      Off       On       x  1
        6 SAS_6              On      Off       On       x  1
        7 SAS_7              On      Off       On       x  1
        8 SAS_8              On      Off       On       x  1
        9 SAS_9              On      Off       On       x  1
       10 SAS_10             On      Off       On       x  1
       11 SAS_11             On      Off       On       x  1
       12 SAS_12             On      Off       On       x  1
       13 SAS_13             On      Off       On       x  1
       14 SAS_14             On      Off       On       x  1
       15 SAS_15             On      Off       On       x  1
       16 SAS_16             On      Off       On       x  1
    
      Disk Audio/Visual settings are:  Disabled  (Using disk defaults)
        Recovery Time Limit:           65535
    
      Ordered Tag Count:     0
      Unit Attention:        Enabled
      FASTAV Timeout:        200
      RC Timeout:            250
      Fail Check Condition:  Disabled