Brocade and Qlogic (SANbox2) switches in one fabric
Below is a quick guide about how to merge Brocade and Qlogic (SANbox2) switches together. I understand, that a more intellegent approach would be to stay away from mixing different vendors in a SAN environment but at times we live with what we’ve been given. As always in our life, there is a trade-off one will have to pay: since in the latest Brocade firmware (6.x) the interoperability mode 1 has been depricated thus you won’t be able to plug a new Brocade switch into a fabric built on Qlogic hardware. Another, and a more serious, issue is that with 6.x I was unable to propogate zone changes from Brocade in native mode to Qlogic switch which was set to interopmode 1. The only way to do that was to swipe out zone’s configuration completely from the Qlogic switch and recreate an ISL. If this a show-stopper then refrain from upgrading your Borcade switch and stay with 5.x firmware version.
Our initial state looked like this (port 3 was plugged to Qlogic):
swd77:admin> switchshow switchName: swd77 switchType: 34.0 switchState: Online switchMode: Interop switchRole: Principal switchDomain: 97 (unconfirmed) switchId: fffc61 switchWwn: 10:00:00:05:1e:02:a1:3c zoning: OFF switchBeacon: OFF Area Port Media Speed State Proto ======================================================================= 0 0 id N2 Online F-Port 50:05:08:b3:00:92:59:91 1 1 id N4 No_Light 2 2 id N2 Online F-Port 50:06:0b:00:00:38:fd:42 3 3 id N2 In_Sync 4 4 id N2 Online F-Port 50:05:08:b3:00:92:59:99 5 5 id N4 No_Light 6 6 id N2 Online F-Port 50:06:0b:00:00:38:fb:a2 7 7 id N4 No_Light 8 8 -- N4 No_Module 9 9 -- N4 No_Module 10 10 -- N4 No_Module 11 11 -- N4 No_Module 12 12 -- N4 No_Module 13 13 -- N4 No_Module 14 14 -- N4 No_Module 15 15 -- N4 No_Module swd77:admin> islshow No ISL found swd77:admin> cfgshow Defined configuration: cfg: default all_wwns zone: all_wwns 50:05:08:b3:00:92:59:91; 50:06:0b:00:00:38:fd:42; 50:05:08:b3:00:92:59:99; 50:06:0b:00:00:38:fb:a2 Effective configuration: no configuration in effect swd77:admin> portcfgshow 3 Area Number: 3 Speed Level: AUTO Trunk Port ON Long Distance OFF VC Link Init OFF Locked L_Port OFF Locked G_Port OFF Disabled E_Port OFF ISL R_RDY Mode OFF RSCN Suppressed OFF Persistent Disable OFF NPIV capability ON
The switches were connected through ports 3 and 0 on the Borcade’s and Qlogic’s sides repsectively and as you’ve already noticed port 3 was in sate “In_Sync”, which is a synonymous for “Bad”. The only way to recover from this state was a manual intervention and forcebly configuring port 3 as a G_Port.
swd77:admin> portcfggport 3,1
Only after doing that, an active ISL link was brought on-line:
swd77:admin> islshow 1: 3-> 0 10:00:00:c0:dd:02:cb:fa 98 sp: 2.000G bw: 2.000G swd77:admin> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name ------------------------------------------------------------------------- 97: fffc61 10:00:00:05:1e:02:a1:3c 10.3.241.225 0.0.0.0 >"swd77" 98: fffc62 10:00:00:c0:dd:02:cb:fa 10.3.241.226 0.0.0.0 "SANbox2-8"
So manually configuring port 3 on my brocade switch as a G_Port was the main trick that actually made everything spinning. Keep that in mind and have fun!
Hylafax game
Bellow is my short summary of how I was configuring a Hyalafax server on Ubuntu 10.04. The end result which I was striving to achieve was a fax server that could act both as a fax2email and an email2fax gateway.
Installing and configuring Hylafax server with a proven hardware is easy and surely not a rocket since at all. My advice, try to avoid as much as you can any kind of softmodem (winmodem) equipment and stick to hardware based one, that would save you a huge amount of time and your brain nerve cells as well. I’ve learned that hardway myself since I had no option but to use several of them myself (Intel536ep, Intel537, Lucent, Conexant HSF) and in my case only intel536ep delivered an acceptable level of stability. But in general all softmodems suck!
Back to our story. As I’ve already mention, the installation process is really easy in itself and reminds me the times when I had to install a Windows application: next, next, next, … , finish. Just double check that your modem has been identified and is active by using minicom or cu tools. Try to enter several AT commands, .e.g. ATZ, AT+FCLASS=1, etc. Here is a list of other AT commands you could find useful.
To setup a fax to email gateway is also a no brainer and is just a matter of adding a few lines into /etc/hylafax/FaxDispatch file:
FILETYPE="tiff pdf" SENDTO=email@address1
With these settings Hylafax would send fax in tiff and pdf formats to email@address1 and if you want the fax to be emailed to more than one address then just add another SENDTO1, SENDTO2, SENDTO3, etc. line/lines. Sometimes, tiff and pdf are not enough and you’d like to have a jpeg version of a fax but Hylafax doesn’t support that out-of-box. So I had to come up with a simple patch that would convert an incoming fax into jpeg and if it’s a multipage then a zip archive will be created with all pages inside. This patch was created against Hylafax server version 6.0.3 and could be download from here. After you apply this pach update FILETYPE and add jpeg or jpg as another option. Just a reminder, before applying the patch make a backup copy of your original common-functions file.
Setting an email to fax gateway is not harder and I will show how easy to do that with Postfix.
- Edit /etc/postfix/main.cf and add another transport map:
transport_maps = hash:/etc/postfix/transport fax_destination_limit = 1
fax.your_hostname.org fax:localhost
fax unix - n n - 1 pipe flags= user=faxmaster argv=/usr/bin/faxmail -d -n -N -T ${user}
In the end, I’d like to mention a very uselfull Hylafax’s option called jobcontrol that gives you the ability to customise outgoing jobs, i.e. have a different LocalIdentifier depending on a recipient or a sender. Just follow this link to get a better idea and take a look at different examples.
Happy faxing.
Migrating SVN repository to another server
Actually it’s a trivial task that has been already discussed and described in all glory details. Anyway, just for a record, I’ll duplicate that information here.
- Dump the content of your current SVN repository.
- Transfer it to a new server.
- Create a new repository and load the dump into.
svnadmin dump /var/svn > /tmp/svn_repository.dump
svnadmin create /var/svn svnadmin load /var/svn < /tmp/svn_repository.dump
Just that simple.
Upgrading Redmine on Ubuntu 10.04
In this post I’d like to describe the process of upgrading Redmine from 0.8 release to a new stable version (1.1) acompanied by a migration to a new host. Before we begin please visit the official upgrade guide since it lists all the details that would suffice most of the users.
- Save the content of your DB, I’m using MySQL, and the Redmine’s uploads.
- Prepare a new server and install the missing required software. In my case I had to install the following packages:
- cd to a directory where you’d like Redmine to be installed, I used /var/www, and check out from the SVN repository as it’s a recommended way.
- Due to the requirements imposed by Redmine I had to install several gems manually:
-
gem install rack -v=1.0.1
-
gem install rails -v=2.3.5
-
gem install -v=0.4.2 i18n
- Create a new database and copy previously saved database’s sql dump and the upload directory from the old server.
- Copy config/database.yml and config/email.yml from the old server.
- Change into Redmine's directory and run the upgrade.
- Finally I installed and configured Phusion_Passenger as described in my other post.
- As the last step, change the owner of the Redmine's files to belong to the Apache's user (in Ubuntu it's www-data).
# mysqldump --add-drop-database --add-drop-table -C -e redmine -uredmine -p > /tmp/redmine.sql
# tar -cpjf /tmp/redmine_files.tar.bz2 /var/www/redmine/files/
# apt-get install subversion rubygems rake librack-ruby librack-ruby1.8 libmysql-ruby1.8
cd /var/www svn co http://redmine.rubyforge.org/svn/branches/1.1-stable redmine-1.1
mysql -uroot -p mysql> create database redmine; mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'redmine_password';
# mysql -b redmine -uredmine -p < /tmp/redmine.sql
# cd /var/www/redmine-1.1 # rake generate_session_store # rake db:migrate RAILS_ENV=production # rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production # rake db:migrate_plugins RAILS_ENV=production
Don't forget to set DocumentRoot and PassengerAppRoot to corerctly point to the Redmin's installation. In my case it was:
DocumentRoot /var/www/redmine-1.1/public PassengerAppRoot /var/www/redmine-1.1
# chown -R www-data:www-data /var/www/redmine-1.1
Nginx is a memory savior.
As soon as I switched to Nginx yesterday the positive outcome wasn’t long in coming.
As you could see I was able to save 200MB of precious RAM just swapping from Apache and mod_fcgid to Nginx and php-fpm. Do happy savings ;-)
Linux Conf Au 2011
If you missed the chance to participate in linux.conf.au this year or, like me, you’re thousands miles away from Down Under then this link http://linuxconfau.blip.tv/ would help you stay tuned and feel the pulse of Linux kernel development. Another options is to subscribe to a podcast using iTunes. Choose one that suits you best. Enjoy watching the cool stuff.
I’m a racker
I’ve finally evaporated into the sky and moved my modest blog into the cloud hosting. The reason for this step was quite common – my previous VPS provider has been doing a marvelous job and always has been a quick responser to any issues I had. Unfortunately, the number of the support tickets began to curve up and what alerted me most was the fact that all of them were of the same kind – “Please, reboot my VPS”. I’ve been patient until one day the server was rebooted… but hadn’t come online. The support team told me that the only way to go was a complete reinstall. That was the last drop that overflowed the cup. Thankfully, I’ve been given the backups so I could quickly move everything into a cloud. In the end of a day I’ve noticed several advantages from migrating under a wing of a new provider:
- Noticeably faster and I could feel the better responsiveness even with 256MB instead of 512MB of RAM.
- Moderate price.
- Xen environment (was using Vertuozzo previously).
- Highly configurable, e.g. there are 14 options for Linux distros that one could choose from, an option to increase RAM online, weekly, daily or on-demand backups.
Truly, every cloud has a silver lining.
A fife or a pot
There was an old soviet cartoon that tells a story about a small girl who was too lazy to plunk the berries in a forest. I could understand her – this activity usually involves intensive crawling on the knees and there is no way to avoid bending your back so it certainly would immensely hurt in the evening. So she’d chosen another route and sought help from a dwarf which offered her too options:
- A fife.
- A pot.
Playing on a fife would make the berry-leaves to uncover the berries they were hiding. So it seemed, it was just a question of plunking them up and placing in a pot. But here came a problem. The girl wasn’t allowed to have both items at once: either a fife or a pot. So as soon as she stopped playing the fife and exchanged it for a pot all the berries had gone and instantly got the shelter under the berry-leaves. No way to see them unless to go down on her knees and start slowly and monotonically lifting up each berry-leaves hoping to find a berry beneath it. But it wasn’t part of her plan, so she rushed to the dwarf and exchanged the pot back for the fife, played on it and, miracle! All the berries were plainly visible. But again, where to put them into. So the story got into a loop: she hurried to the dwarf and got the pot in exchange for the fife and the berries just disappeared again. Eventually, the girl had understood that sometimes you just can’t have everything and hard-work is unavoidable.
Why am I telling all that? Well, I’ve been into a long run for a new job opportunity and I’m still in a pursuit and what I’ve noticed that after every single interview I had to put myself into that girl’s shoes but the options now are slightly different:
- A worthy compensation.
- A challenging position and day-to-day responsibilities.
The problem here is that I’m not afraid of a hard work, like that young lady from a cartoon story, but I don’t want to make any trade-offs and want to have both of these two. Unfortunately for some uncanny reason I’m continuously hitting the same wall again and again. Or maybe I just don’t know when I’m well off?!
Samurai. Art of War
This is the second time the exhibition “Samurai. Art of War” is being presented in Moscow. And even if you have visited the first one and still hesitate whether to attend an exhibition with the same name for the second time then here is my advise – drop away all your doubts and fears because behind the illusive similarity it’s absolutely different in every sense. First of all it’s bigger and holds more installations and the display units. Besides, all of them are original armors and swords, tsubas (guard), wood-prints, kimonos and more. Amongst them one of the four Muramasa sword that’s has reached our days after these swords fell out of favor with the Japanese government and Muramasa swords were forbidden and had to be melted down. The ones who disobeyed and kept them were treated as a threat to the Emperor and were killed together with their entire family members. Another glorious exhibit is a complete armor of Oda Nobunaga. What is interesting about this unit is its mask. Traditionally, the masks were used to intimidate or to mislead a foe and that’s why a matured and experienced samurai could wear a mask that depicted a youngster whilst a greenhorn, on the contrary, could be hiding behind a mask with a ferocious expression. But Oda Nobunaga ordered a mask with his own face – even his name, not mentioning his face, could instill terror into his enemies and that’s why there was no point in hiding his face.
The second notable difference, is that now there is a guide who would kindly walk you through the entire exhibition and would in vivid wording acquaint yourself with Japanese culture, traditions, legends and would give you a sense of what it was like to be a true Samurai.
You could find more information and discount details on the official web site – www.isamurai.ru
Enjoy and don’t miss it.
Winter fun
It’s been such a great fun to spend these long winter holidays with my family. Thankfully, because of a beautiful weather which gifted us with a lot of snow and frosty days, we stayed mostly outdoors plunging ourselves into snow, skating, sliding from icy hills and doing a lot of other snowish winter capering.